LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2002, 05:08 PM   #1
busbarn
Member
 
Registered: Feb 2002
Location: Denver, CO US
Distribution: Arch
Posts: 453

Rep: Reputation: 30
Newbie learning Python


I'm new at programming and am working through some python tutorials. There's a couple of silly things that I just can't figure out. I'm working through
/www.hetland.org/python/instant-hacking.php and it says to write the excercises in emacs or a text editor and then run them in pyhton. I have python, but as silly as this sounds, how do you open a file to run it?

Next aparently stupid yet stumping quesiton...how do you write a new file in emacs? All I can get are import files and open files. ONce again, any help would be greatly appreciated. THanks.
 
Old 08-09-2002, 06:56 PM   #2
darkmage
Member
 
Registered: Jun 2002
Location: Lousiville,KY
Distribution: Gentoo
Posts: 89

Rep: Reputation: 15
To open a file in Python, you save it with the type .py, for example helloworld.py. You can then run it from a command line cding to the directory and typing python and the name of the program (helloworld.py)
 
Old 08-09-2002, 06:57 PM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well that's really not to do with python as a language, just how to use an application. persoanlly i'd just say use idle, the python mini ide that you should already have with your system. and give diveintopython.org look, an entire open source python manual for non-newbies.
 
Old 08-09-2002, 11:50 PM   #4
busbarn
Member
 
Registered: Feb 2002
Location: Denver, CO US
Distribution: Arch
Posts: 453

Original Poster
Rep: Reputation: 30
Thank you very much--I'll look into it. I found out that I was entering the command wrong. I was trying #<file> python instead of #python <file>. Thanks for the help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python - worth learning? vharishankar Programming 39 07-08-2005 03:38 AM
Learning Zope (and Python) coolman0stress Programming 3 05-10-2004 05:01 PM
newbie learning C++ needs to see code GoinEasy9 Programming 4 03-27-2004 12:11 AM
Learning Python... where do i start?? Claus Programming 2 09-02-2003 07:42 AM
Try Python, O'reilly Learning Python haknot Programming 5 02-15-2002 09:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration