Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 9th, 2003, 09:45 AM
haus082780 haus082780 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Lisbonfalls Maine
Posts: 1 haus082780 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old March 9th, 2003, 11:25 AM
Ctb's Avatar
Ctb Ctb is offline
An Ominous Coward
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2002
Posts: 4,425 Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level)Ctb User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 10 h
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > I'm a newbie and I was wonderring how you saved Python code?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT