[Tutor] IDLE vs PythonWin

Eric Dorsey dorseye at gmail.com
Tue Feb 10 04:29:58 CET 2009


You can call a .py script from the command line, and it will run there. So,
in Windows XP: Start > Run > type "CMD"
Vista: Start > type "CMD" into the Start Search field.
If you're in Linux, get to a Terminal.
In Windows another window will open with something
like...C:\FolderWithMyPyFile>
Linux something like.... me at ubuntu-desktop:~$

Assuming "uberprogram.py" is in the current folder, you can then just type
into the command prompt like C:\FolderWithMyPyFile>uberprogram <then hit
enter>

You can see the results of the program right in the command prompt/terminal
window.

On Mon, Feb 9, 2009 at 6:09 PM, Wayne Watson
<sierra_mtnview at sbcglobal.net>wrote:

>  You must be up 24/7!
> When I open a py file with pythonwin, it brings up the dialog and in its
> window, there are two windows. One is called interactive window (IW), and
> the other (script window--SW) contains the program py code. To execute it, I
> press the little running icon or F5 and two printed lines appear, as they
> should, in the IW. If I remove the SW, how do I run it in another "editor",
> vi, vim, emacs, notebook, ... whatever, and see the output in the IW?
>
> ALAN GAULD wrote:
>
>  > Yes, but how do you debug the code interactively when you have
> > the editor outside pythonwin? Do you copy it into the pythonwin editor?
>
> Do you mean using the Python debugger?
> If I need to do that I will either use the command line debugger (pdb)
> inside the shell window or close the vim session and start pythonwin
> (or Eclipse which has a really good debugger!) But in 10 years of using
> Python I've only resorted to the debugger maybe a dozen times in total.
> Usually a few print statements and a session with the >>> prompt is
> adequate to find any bugs. The best debugging tools are your eyes!
>
> Remember too that you can always import the module into the shell
> window if you need to test specific functions in isolation.
>
> Alan G.
>
>
> ALAN GAULD wrote:
>
> The point wasn't about vim per se - that just
> happens to be my favourite editor - but really
> about the way of working with 3 separate windows.
>
> Really it was just to show that you don't necessarily
> need to use an all-in-one IDE like Pythonwin or IDLE,
>
>
>
> --
>
>            Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
>
>              (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
>
>  *The Richard Feynman Problem-Solving Algorithm:*
> *  (1) write down the problem;*
> *  (2) think very hard;*
> *  (3) write down the answer.***
>  **
>
> ******                    Web Page: <www.speckledwithstars.net/>
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090209/fd85e299/attachment.htm>


More information about the Tutor mailing list