![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Help a newb please...
Well im new to python. Ive worked with html, php, and a little C++. For some reason ive having problems saving the file. Im just using the test script hello world. When I go to save the file I save it as hello.py in the default directory and I go to the command line, this is in windows xp pro by the way, and type cd python23 to get to the python directory. I then try to open hello.py I even try python hello.py THe file is no where to be found. Ive also tried python 2.4 and that wont work either. I read a post from august of last year with the same problem and I tried everything verbatum in that post. I believe legacy answered the question. I just get nothing from everything. Do I have to set up something for it to save correctly in windows or did I miss a step. I know this has to be easy but im stumped lol. Any help is greatly appreciated. Even a link to an answer would help. I really want to use python and dont want something this simple to push me away. Thanks again.
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2005
Posts: 54
Rep Power: 4
![]() |
Ok, let's say I create a simple python script and save it on my desktop. You need to figure out the full path to the file. If your windows login name is nissan and the script is named hello.py, the full path is probably c:\documents and settings\nissan\desktop\hello.py.
Now open a console window by clicking Start, then Run, then typing "cmd.exe" and clicking Ok. Change into the Python directory by typing "cd \program files\python24" or where ever you installed Python. Now run the script by typing "python c:\documents and settings\nissan\desktop\hello.py". But really, why do it the hard way? Find your script, right-click on it and select "Edit with IDLE". It will open two windows, one text editor with your script and another with the interpreter. From the editor, click on Run >> Run Module. Much easier! |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
ok I gave that a try and I get no such file, internal orexternal COMMAND,operable program or batch file. It just seems like the prgram isnt saving. If I save the file to my desktop for example I should at least see the file there right? Just sitting on my desktop. I did a search of my whole computer for the hello.py file and it couldnt find it. Anymore ideas?
|
|
|
|
|
|
#4 |
|
Professional Programmer
Join Date: Feb 2005
Posts: 434
Rep Power: 4
![]() |
Somehow you are missing something real basic. Go to our sister site DaniWeb.com, they have a sticky under Python with real basic beginner stuff. They recommend using Idle to write, save and run your program.
__________________
I looked it up on the Intergnats! |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
ok I figured it out. The person I got python from(on cd) gave me a version by activestate. That didnt work for me apperently so I just downloaded python from the .org site.Thanx for the help. It was a very simple problem. Now I be able to enjoy the python programming world
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|