469,293 Members | 1,335 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,293 developers. It's quick & easy.

python script help...

Hi, I am new to this site and to programming.

I have been trying to program with Python, however I don`t know :confused: how to run scripts. I have created some in Windows notepad (I use windows xp) and succesfully added the ".py" extension. However, when I try to run the script, a python window will just blink and then disappear. I have tried a billion times! :mad:
How can I solve this problem?

THanks.
May 5 '06 #1
4 2433
Banfa
9,064 Expert Mod 8TB
Sounds like you may be trying to run the script by double clicking on explorer or something like that. Try starting a command prompt (Start Menu -> Run and type cmd) and run the Python script there. You will probably need to change to the directory that the scripts are in first just to make things easier.
May 5 '06 #2
I tried it but still nothing different happened . The command prompt told me that the directory I entered was not recognized :confused: . I am not very experienced with the command prompt so I think I must be entering something wrong (I am such an amateur! :o )... However I downloaded Activepython 2.4 and the python IDE was able to run and process my script. I still don`t know how to make the original command line run it but this activepython somehow did it. THanks anyway :) . Your input is highly appreciated.

Regards


shorty9588
May 6 '06 #3
bartonc
6,596 Expert 4TB
I tried it but still nothing different happened . The command prompt told me that the directory I entered was not recognized :confused: . I am not very experienced with the command prompt so I think I must be entering something wrong (I am such an amateur! :o )... However I downloaded Activepython 2.4 and the python IDE was able to run and process my script. I still don`t know how to make the original command line run it but this activepython somehow did it. THanks anyway :) . Your input is highly appreciated.

Regards


shorty9588
You can use the "raw_input" trick to keep the window from closing after your script has run. To do this, add the call:
Expand|Select|Wrap|Line Numbers
  1. raw_input("press a key to continue")
as the last thing that your script does.
Jan 19 '07 #4
Hi, I am new to this site and to programming.

I have been trying to program with Python, however I don`t know :confused: how to run scripts. I have created some in Windows notepad (I use windows xp) and succesfully added the ".py" extension. However, when I try to run the script, a python window will just blink and then disappear. I have tried a billion times! :mad:
How can I solve this problem?

THanks.
Let's start at base. Download the Python package from the sourceforce.net website. If you have difficulty with this, google 'download python' and just look for it.
Then when you finished downloading it, run the setup program in windows and
follow the prompts.
Now, what you do is simple:
You click on Start,Programs and you will see that there is a program python24 or whatever version you installed. Click on it
A new window will open, here you can enter some python code and get it compiled one line at a time.
If however it is not you liking to do it that way, click on File, New Window and a new window will open, enter your code and click on run (I'm a little rustic on the exact words but one of the menubar menus will have run inside it at least.
And thats it
Hope you get it right
Jan 19 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by satish | last post: by
reply views Thread by O'Neal Computer Programmer | last post: by
8 posts views Thread by Tero Pihlajakoski | last post: by
2 posts views Thread by Alain Paschoud | last post: by
6 posts views Thread by manatlan | last post: by
8 posts views Thread by Paul Cochrane | last post: by
37 posts views Thread by John Salerno | last post: by
3 posts views Thread by cosmo_general | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.