#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0

    Help for Uni Project


    Hello guys,
    I have a Uni project on Python. The project is a Patchwork sampler. Something like that: youtu .be/2382T2o_SNA (remove that space)
    Well, till now I have done:

    • A loop that checks if the given colour is in the colour list, if not, its repeating to ask for the colour.
    • Ask the coordinats of the patchwork. The numbers should be form 4 to 9 if not its repeating to ask for them.
    • I found a the main part of the project( the def that calls all the other defs) a friend of mine gave it to me and I edited it a bit.


    The problem are the shapes, Im not really into the design shapes and things like that.
    And to be honest I can't figure out how to make the shapes part of the whole program.
    If anyone knows about Python graphics and is willing to help me please post so I can pm the code I wrote till now to take a look on it.
    Thank you and Im really sorry for my poor English.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    b49p23tivg@yahoo.com
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by b49P23TIvg
    b49p23tivg@yahoo.com
    Hello,
    Thanks I have just emailed you my .py file !
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Here is my code, I need to make the shape 1 part of the def main(). So when the def main() calls the shape1() , the shape1() will draw the shape on the window.
    Last edited by Bobys; November 27th, 2012 at 10:10 PM. Reason: If you search the google you can easily find my code, and I don't want someone from my uni submit my code get me in trouble.my whole py file after submission though :)
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Hello,
    Finally I did the 1st shape and trying to figure out the 2nd.
    But on the Colors validation function I have a question.

    I would like to create an input box to ask the colors.

    Code:
    first_color = input("Invalid Color, The color must be red, blue, green or yellow, magenta, orange or cyan. Please enter your first valid color: ")
    But If i run the current code the input box would be a huge input box.
    So how can I give line spaces on an input box? like:

    Invalid Color!
    The color must be red, blue, green or yellow, magenta, orange or cyan.
    Please enter your first valid color:

    and Can I write the Invalid Color on the window Title? on the Upper left side of the window?

    Thank you
  10. #6
  11. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    Code:
    first_color = input('''Invalid Color, The color must be
    red, blue, green or yellow, magenta, orange or cyan.
    Please enter your first valid color: ''')
    [code]Code tags[/code] are essential for python code and Makefiles!
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    5
    Rep Power
    0
    Originally Posted by b49P23TIvg
    Code:
    first_color = input('''Invalid Color, The color must be
    red, blue, green or yellow, magenta, orange or cyan.
    Please enter your first valid color: ''')
    Thank you for you reply, was really helpful.

    How can I change the window title? Now is like Python input, is there any way change that?
  14. #8
  15. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,995
    Rep Power
    481
    Ask John Zelle,
    it is written by John Zelle for use with the book Python Programming: An Introduction to Computer Science (Franklin, Beedle & Associates).
    Realizing that graphics.py uses tkinter you could change the window title, I think, via the master attribute of the object controlling the window you want to alter.
    This book would be useful.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo