473,513 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

python script help...

2 New Member
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 2540
Banfa
9,065 Recognized Expert Moderator Expert
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
shorty9588
2 New Member
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 Recognized Expert Expert
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
Extremist
94 New Member
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

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

Similar topics

2
2881
by: satish | last post by:
Hello all, I have a shared object executable viz. *cable* which I execute as follows : $ ansyscust71 -custom cable -p ANSYSRF **ansyscust71 is a shell script and is a part of a software...
0
2562
by: O'Neal Computer Programmer | last post by:
*** First of all, if there is a previous post on Temple of Elemental Evil, please provide a link to that/them so in order to create a larger resource on this game. Thanks! (Merci) ;-) *** Temple...
8
3034
by: Tero Pihlajakoski | last post by:
Hi, I've been experimenting on embedding Python to a C software, and ran into a little problem with PYTHONPATH (I'm running on linux). Here's the deal: When trying to call...
2
1922
by: Alain Paschoud | last post by:
Hi all, I made a small dialog in WxPython. I can run the python script with a double-click or through command line, and everything goes fine (dialog appears, which means that wx module has been...
6
7478
by: manatlan | last post by:
I've got a trouble, and i think that anybody there can help me I've got a python script which i distribute in somes packages for *nix. This script is full of python and need python 2.4 ! And i'd...
8
3016
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
37
2429
by: John Salerno | last post by:
I contacted my domain host about how Python is implemented on their server, and got this response: ------------------- Hello John, Please be informed that the implementation of python in our...
3
4699
by: cosmo_general | last post by:
Hi Folks, I just downloaded precompiled Python for Windows, and it runs. Now I have got the command line coding. However, I can't run my python scripts. My python script, foo.py, is located in...
4
3366
by: Alia Khouri | last post by:
Can we open up the discussion here about how to improve setuptools which has become the de facto standard for distributing / installing python software. I've been playing around with ruby's gems...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.