[Tutor] IDLE vs PythonWin

W W srilyk at gmail.com
Sat Jan 31 16:41:58 CET 2009


On Sat, Jan 31, 2009 at 8:45 AM, Wayne Watson
<sierra_mtnview at sbcglobal.net>wrote:

>  Did I miss a response here?
>
> Wayne Watson wrote:
>
> vim? I'm looking at the interactive window now. Here are two choices for
> what you say:
> 1.
> alt-tab vim
> Traceback (  File "<interactive input>", line 1
>     alt-tab vim
>               ^
> SyntaxError: invalid syntax
>
> 2. Pressing the alt-tab keys moves me to the next Windows window, which
> happens to contain my mail window.
>
> I'm putting an image here. It may not get through to tutor.
>
>
> ALAN GAULD wrote:
>
>  > I'm not familiar with these acronyms. MDI, SDI,
>
> MDI = Multi Document Interface - has many windows within one single outer
> window.
> This was MS Standard for apps from Windows 2 through to Windows 95.
>
> SDI = Single Document Inteface - has each document within its own window.
> This has been the preferred styule since XP (between 95 and XP I think the
> preferred style was up to the developers!)
>
> Alt-Tab and up-arrow for navigating between windows/commands
> works for me :-)
>
> > As soon as I hit, alt-tab, Win moves between all the icons on my screen.
> > There's not chance to press an up arrow.
>
> Alt tab switches windows
> Up/Down arrow moves up/down the command history within a window
>
> So a typical session goes like:
>
> Experiment at >>> prompt
> Alt-Tab to vim
> Edit & save file in vim
> Alt-Tab to Console
> use up arrow to retrieve last command
> execute last command(ie run the script)
> Alt Tab to vim to fix bugs or >>> to try out new ideas <snip>
>
>
I think you may have misunderstood Alan.

He has open a vim editor and a python prompt. So he might do something like:

>>> def test():
...     print "Hello, does" + " this work?"
...
>>> test()
Hello, does this work?

in his interactive shell. So now he knows string concatenation works so  he
might hit alt+tab to his open vim window and there add something like this:

def salutation(fname, lname):
    print "Good morning, " + fname + " " + lname + ". Welcome to my
program!"

Or of course he could experiment with the actual bit of code he's trying to
write, but the illustration still stands. Then he saves his code in vim and
runs the script in the shell (in Ipython you'd use the magic function %run,
I'm not sure about the regular shell), to see how well his code works with
the rest of his program.

That's the same way I edit my code - vim + Ipython gives me all the tools I
need. The nice thing about working with another shell like that is you can
use your favourite editor, whether it be vim, or emacs, or gedit, or
notepad++ or scite, or MS Visual Studio, or notepad, or wordpad... I'm sure
you get the picture ;)

Heck, you can even use pythonwin the same way.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090131/7ec795df/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 25184 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20090131/7ec795df/attachment-0001.jpeg>


More information about the Tutor mailing list