[Tutor] Windows, Python and me

Rob Andrews rob@jam.rr.com
Sat, 11 Aug 2001 23:30:33 -0500


Roman Suzi wrote:
> 
> Hello,
> 
> I am not sure if my question fits here, but I see lots
> of such questions in c.l.p and probably this one could
> gather expert answers, easily found later via google.
> 
> Keywords: Python Win32 Windows DOS prompt path setup start run install
>           CRLF edit editor IDLE
> 
> For more than 4 years already I am working with Linux. But in order to do
> packaging of Python related material I need to make it "right" in Windows.
> 
> And here I understand how difficult things in Windows are (compared to
> Linux). Below I refer to Win98 SE.
> 

Just as linux appears bafflingly complex to native Windows users. ;-)

> 1. After installing Python under Windows, I can't just type "python" in
> DOS-prompt to run scripts. What is the easy way for the novice to set PATH
> correctly? ("> start python" works fine).
> 

This is how to initiate an interactive Python session from the "DOS"
command prompt:

Microsoft(R) Windows 98
   (C)Copyright Microsoft Corp 1981-1999.

C:\robsrc\Assignments>python
Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>>

If you wish to add (for instance) c:\python21 to the PATH list of
directories Windows searches for executable programs, the simplest thing
to do is to back up c:\autoexec.bat and then add it to the PATH
statement (creating a PATH statement, if necessary):

PATH=d:\jbuilder4\bin\;e:\perl\bin;c:\python21;

> 2. Some tar.gz archives are using LF-line ends (and this is right thing
> for UNIX or under IDLE). However, such scripts are not editable in NotePad
> which is fabulous default Windows editor. What is the better choice:
> to get/provide CR-LF-ed text files or (how?) make users decode text files
> for themselves?
> 

Isn't there a handy utility to handle these conversions between *nix and
Windows? WinZip is also great for handling such matters under Windows.

> The deadlock is: NotePad can't be used due to LF-ed py-files and IDLE
> internal editor can't be used because IDLE doesn't support non-latin-1
> chars... I could suggest Emacs, but for beginners... They will be
> pissed off not only for Emacs, but Python alltogether. This way or that
> solution must be "freely distributable".
> 
> 3. What is the preferred way to run setup.py script? (MS DOS prompt
> doesn't work due to the problem no 1 above and if it works, how do I open
> MS DOS prompt in the needed directory and not in the C:\WINDOWS> ? (using
> cd or adding some bat or pif files to the directory with unzipped contents
> is not an option: it makes feel like Python doesn't suit into Windows
> environment well). Or do I need to get some freeware kind of Norton Editor
> for such tasks? (What Windows "Explorer" is for, then?)
> 

Can't help you much on this one. I've never had any success with the few
methods I've tried to make Python scripts more handily executable under
Windows.

> * * *
> 
> I think, these questions have impact on Python usability under Windows.
> Probably, the best solution could be adding GUI to Distutils, so running
> JUST setup.py without options will bring up a dialog with all available
> options or at least a text-prompt for them (like this is done for Mac
> which do not have command line).
> 
> The reason I posted this to Tutor is that probably I need to learn more
> about Windows+Python to resolve problems stated above. And yes, I have
> read Distutils docs. (please, tell if I need to reread them).
> 
> Thank you for answers!
> 
> Sincerely yours, Roman Suzi
> --

Hope some of this is helpful,
Rob
-- 
As Useless as we wanna be....
Useless Python!
http://www.lowerstandard.com/python