|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I'm a newbie and I was wonderring how you saved Python code?
Hey guys I was just wondering if I got this straight. I write python code in any old editor like vi. Then I save the file like this "filename.py"? Then I import the file to the python interpreter. Now when I save the file does it matter where? and when I go to import it to the python interpreter do I give it the full pathname? For example if I saved filename.py in my /usr/local dir, when i go to import the file do I have to type import /usr/local/filename.py or is it just import filename.py. Once the file is imported to the python interpreter, how do i execute it?? If you can help me in anyway it would be greatly appreciated. Thanks for your time.
Last edited by haus082780 : March 9th, 2003 at 12:36 PM. |
|
#2
|
||||
|
||||
|
AFAIK, all you have to do is run:
Code:
python PATH_TO_CODE That's the normal way of running scripts. i.e. if I have myscript.py in the current directory, I should be able to use: Code:
% python myscript.py to run it. Also, unless you're looking for spamming hellfire to come down on you, you might want to take your email address out of the post. It'll get indexed by some Bad Guy eventually if you leave it ![]() |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > I'm a newbie and I was wonderring how you saved Python code? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|