#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    543
    Rep Power
    24

    IDLE - Run Script


    Well, I'm trying to do this: Writing Hangman in Python

    There is no 'Run Script' command.

    This is my first time using IDLE. I'm using python.pyw
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    How Chief,

    In Python 2.3 IDLE has been totally rearanged! To run a Python script from IDLE you need go to "Run -> Run Module".

    Hope this helps,

    Have fun,
    Mark.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    543
    Rep Power
    24
    Yeah, I tried that. But it's either I get a syntax error or the script doesn't work.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    well shouldn't you fix these syntax errors and run the script?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    543
    Rep Power
    24
    Well the syntax errors are like:
    >>>
    ...

    and the copyright at the top.
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    2k makes a good point, if there is a syntax error you should probably fix it before running it. But, if you are relying on IDLE for error catching (as i've done in the past ) then you may have a problem here! Here's where Python gives you an extra hand.. by running your script from the command like with -i .

    First cd to your Python directory (you can do this with cd path/to/python), then type the following

    Code:
    python -i path/to/your/file
    This will execute the python program and then hop over to the interactive interpriter, you should be able to easily see Python's error messages, and test your code using the interactive prompt

    My favourate way , Python Rocks!

    Have fun,
    Mark.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    543
    Rep Power
    24


    Whoa! This is really cool! I had no idea you could do this. Python is the best. I'm going to have a lot of fun now.
  14. #8
  15. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Wow wow wow, why do you have interactive promps inside your Python program? If you saved a script you wrote in Interactive mode you will need to remove all the promps (>>>) and etc.. then I'd suggest you read throught the intro's on python.org, loads of intereating things to learn here

    http://www.python.org/doc/Intros.html

    Mark.
    Last edited by netytan; August 16th, 2003 at 07:08 PM.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
    just post the code..

IMN logo majestic logo threadwatch logo seochat tools logo