Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed Ubuntu and it came with Python 2.7.3 but I can't save any of my programs. I tried going to File, looking for a Save option, but it is not present. What should I do?

share|improve this question
5  
What is the editor you use for writing your python programs? How is this question related to Windows 7 (you tagged it)? –  Takkat Mar 20 '13 at 11:43
4  
The answers make it clear what the OP's situation is and what is being asked--the OP was trying to use the Python interpeter itself to compose reusable scripts. We should reopen this--we can all tell what's being asked here now. (In case anyone is confused about the part with the File menu existing but not having a Save option--that's describing the File menu in GNOME Terminal, where python likely runs.) –  Eliah Kagan Mar 21 '13 at 9:59
1  
It maybe a good idea to wait for OP to clarify rather than speculate on what the question means based on the answers. –  user25656 Mar 21 '13 at 11:53
    
@vasa1 I think the question is clear enough to reopen it. –  Seth Mar 21 '13 at 13:57
    
@vasa1 Has anyone come up with any other likely interpretation of this? Alternatively, would this question not be helpful to other users (even if the OP never returns)? –  Eliah Kagan Mar 21 '13 at 14:30
show 1 more comment

2 Answers

The command line interpreter for Python is not an editor and does not have a save option. This is just something for testing your commands.

You need something like gedit (or another editor) to type your commands. Those editors all have save option.

share|improve this answer
add comment

If you want to program with Python on Ubuntu, I suggest you use IDLE. IDLE was built entirely using Python and tK (a window module for python) and it works fine for anything I have ever done.
It gives you syntax highlighting and debugging features, very handy for tracking down bugs and the like.

Gedit also works, and it has several languages that it can syntax highlight, but it doesn't have the debugging features (at least that I have seen.)

Another one you could look into is Stani's Python Editor, another IDE developed by a user.

Like @Rinzwind said, the python command line doesn't provide an option for saving your source files, it is just a way to test out commands and ideas without actually having to write a full program to do it.


EDIT:

Another one I found very useful was Geany.

I don't remember if I had to install it or not (probably did, simple search in the Software Center should bring it up). It gives code highlighting, auto-indentation, the ability to increase & decrease the indents on chunks of code, the ability to comment out chunks of code, and run the code directly from the IDE. You can also quickly swap between running it with python (default) and python3 or another.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.