I once started to learn Python, with Think Python, but soon succumbed to Trivial inconveniences like having to save my programs, change to the interpreter and then loading them. Learn Python the Hard Way advises to do this, too. Is there a free or commercially available program which any of you could recommend that avoids these things without interfering in the learning process? Or any other way to get over this hurdle without overpowering it?
Typically people use a keyboard shortcut to save, which makes it less painful.
For running your program, try typing
python yourprogram.py
from your console/terminal/whatever after having navigated (by typing “cd directoryname” and “dir”/”ls” repeatedly) to the directory where your program is. After having typed the execution command once, you can just push the up arrow on your keyword to restore that command on the command line. So under ideal conditions, executing your program should consist of four actions: pushing a keyboard shortcut to save, switching to a terminal window, pushing the up arrow key, and pushing enter.
Probably the instructions I just gave you will be hard to follow because they are awfully compressed and I don’t know your platform. So feel free to tell me if you run into a problem. You may wish to make an explicit effort to learn the command line; I believe there is a Hard Way book about it.
Another option is to use the editor that comes shipped with Python, sometimes referred to as IDLE. Once you figure out where it is and start it running, go to the file menu and choose new document or something like that. Then press F5 at any time. It should prompt you to save and then run your program. (If I recall correctly.)
I’m sure there’s something unclear here, so please respond if you get stuck.
Thank you very much for your elaborate reply. Unfortunately I do seem to have miscommunicated; those steps as described by you are exactly what I dread.
I feel like I do not know enough to ask the right questions, so: I want a program which lets me debug with as less actions as possible while also giving me easily accessible help/documentation. They seem to be called IDEs.
IDLE (which comes with Python) is an IDE. It simplifies testing to the point where you pretty much just hit F5 then hit enter to give it permission to save, and you see the result right away. Alt-tab brings the file you are editing back to the front when you are ready to fix the bug or continue hacking. I’ve used it on Windows and Linux and the experience is pretty much exactly the same either way. There is also a help menu which takes you to the documentation website where you can search for whatever you are looking for.
This may or may not be helpful, but it sounds like you might have a use for guard which is unfortunately quite obtuse to set up, but once it’s running, it will automatically perform arbitrary tasks each time the file changes. If I plan to debug something, I tend to go build a Guardfile that runs that something every time I change it. Now the steps are:
Cmd-S to save.
Lazily cast eyes over the other half of my screen to see results.
Often, the best (not necessarily easiest, admittedly) way to do this is to have a web browser with tabs open to the documentation for the libraries you are using (doing this method gets easier and much faster with practice, as you can hold more and more of your program in your head).
However, for Python, you could experiment with some of these editors. Just glancing over it, the open source editors Eric and DreamPie and the proprietary Komodo look nice: they appear to offer auto-completion and pop-up documentation, and at least Eric and Komodo have built-in graphical debuggers.
I once started to learn Python, with Think Python, but soon succumbed to Trivial inconveniences like having to save my programs, change to the interpreter and then loading them. Learn Python the Hard Way advises to do this, too. Is there a free or commercially available program which any of you could recommend that avoids these things without interfering in the learning process? Or any other way to get over this hurdle without overpowering it?
Typically people use a keyboard shortcut to save, which makes it less painful.
For running your program, try typing
from your console/terminal/whatever after having navigated (by typing “cd directoryname” and “dir”/”ls” repeatedly) to the directory where your program is. After having typed the execution command once, you can just push the up arrow on your keyword to restore that command on the command line. So under ideal conditions, executing your program should consist of four actions: pushing a keyboard shortcut to save, switching to a terminal window, pushing the up arrow key, and pushing enter.
Probably the instructions I just gave you will be hard to follow because they are awfully compressed and I don’t know your platform. So feel free to tell me if you run into a problem. You may wish to make an explicit effort to learn the command line; I believe there is a Hard Way book about it.
Another option is to use the editor that comes shipped with Python, sometimes referred to as IDLE. Once you figure out where it is and start it running, go to the file menu and choose new document or something like that. Then press F5 at any time. It should prompt you to save and then run your program. (If I recall correctly.)
I’m sure there’s something unclear here, so please respond if you get stuck.
Thank you very much for your elaborate reply. Unfortunately I do seem to have miscommunicated; those steps as described by you are exactly what I dread. I feel like I do not know enough to ask the right questions, so: I want a program which lets me debug with as less actions as possible while also giving me easily accessible help/documentation. They seem to be called IDEs.
IDLE (which comes with Python) is an IDE. It simplifies testing to the point where you pretty much just hit F5 then hit enter to give it permission to save, and you see the result right away. Alt-tab brings the file you are editing back to the front when you are ready to fix the bug or continue hacking. I’ve used it on Windows and Linux and the experience is pretty much exactly the same either way. There is also a help menu which takes you to the documentation website where you can search for whatever you are looking for.
This may or may not be helpful, but it sounds like you might have a use for guard which is unfortunately quite obtuse to set up, but once it’s running, it will automatically perform arbitrary tasks each time the file changes. If I plan to debug something, I tend to go build a Guardfile that runs that something every time I change it. Now the steps are:
Cmd-S to save.
Lazily cast eyes over the other half of my screen to see results.
Often, the best (not necessarily easiest, admittedly) way to do this is to have a web browser with tabs open to the documentation for the libraries you are using (doing this method gets easier and much faster with practice, as you can hold more and more of your program in your head).
However, for Python, you could experiment with some of these editors. Just glancing over it, the open source editors Eric and DreamPie and the proprietary Komodo look nice: they appear to offer auto-completion and pop-up documentation, and at least Eric and Komodo have built-in graphical debuggers.
The perfect solution for my problem got listed here. Thanks again for all of you!