[python-win32] How to make python scripts output to current cmd window? (like linux terminal)

Tim Roberts timr at probo.com
Tue Nov 18 18:58:18 CET 2008


Mike Driscoll wrote:
> Tim Roberts wrote:
>>  
>> I realized when I read my reply that I really did nothing to clear up
>> any confusion.  Allow me to provide an example.
>>
>> Let's say I have c:\bin\remote.py, and client.py in the current
>> directory.  WIthout the file associations for .py and .pyw, I can say:
>>     python client.py
>>     pythonw client.py
>> If I set up file associations for .py and .py, then I can also say:
>>     client.py
>>     .\client.py
>> Further, as long as "c:\bin" is in the path, I can also say:
>>     remote.py
>>   
>
>
> Sorry to intrude, but what is "C:\bin" ? I don't have it on Windows XP
> and I couldn't find a "bin" folder in my Python25 directory either. Is
> this some kind of custom wizardry on your part?

It's not wizardry.  I spend most of my life in a command line, so my
computer is organized to make command line life easier, using lessons
learned from Unix.  I create directories called \apps, \bin, \etc, and
\tmp.  If I install a program that I think I will need in a command
line, I install it in \Apps instead of "\Program Files" (because it's
shorter, and because spaces are evil).  All the tools I write, all the
command line tools I download, and shortcut batch files to the other
tools I need all go in c:\bin.  That way, I can put "C:\bin" in the
path, instead of cluttering it up with dozens of directories that each
have one tool.  A long path costs performance.

Some people think they are stuck with the "\Documents and Settings" and
"\Program Files" nonsense that Microsoft dictates.  Not so.  It's your
computer, do what works for YOU.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list