Win98 PySol/Python Problems II

Bill Melcher wpmelcher at snet.net
Mon Dec 3 10:42:42 EST 2001


Hi Guys,

Thank you all for your interest and help in my thread "Win98 PySol problem"
thread. (See below for my current complaints.)  (-:

Matthew Dixon Cowles:
Especially for the mod to tkutl.py - That got rid of my first problem, the
'dither' problem

Kragen Sitaker:
For considerable help and good ideas when I was struggling with 'mechanics'

Neil Hodgson:
For turning me on to SciTE - great product that bypasses all the DOS crap
AND also captures both stdout and stderr in a file (?) that can be scrolled!

Also thanks to David Brady who said in the "WINDOWS USERS????" thread:

 "If you want a script to run by double-clicking it in
 Explorer, and you *don't* want a dos window to open,
 save the file as .pyw instead of .py. .pyw is for
 "Python Windows" scripts; they don't open a console
 window."

This is exactly the kind of little bit of information that 'everybody knows'
and is so hard to find.

Another bit of good advice (from me <grin>) is to buy a book or two!  I've
been reading O'Reilly's "Programming Python", Second Edition (got to be
careful about the Python version covered).

My problems with PySol and Python have not yet ended.

PySol - The 'bundle' Marcus alludes to involves (apparently) running 'python
pysol.py' with the --bundle option.  This does not work.  I get an error
when I reach the statement

bundle = bundle + 1

The complaint is that bundle has been referenced before it was defined or
some such.

I'll keep working on this but if any one has a bright idea, please let me
know.

I do know that there is no pysol.pyc created when I run pysol.py and that
the pysol.pyc's that Marcus created for distribution range in size from
1,012KB (PySol 4.20) to 1,150KB (PySol 4.72 - for Python 2.1). The latter is
from the distribution that does not work because of the -dither problem.

Python - So I get the book and try a little simple stuff. Whoops!

PythonWin 2.1.1 (#20, Jul 26 2001, 11:38:51) [MSC 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (MarkH at ActiveState.com) - see
'Help/About PythonWin' for further copyright information.
>>> import os
>>> os.environ.keys()
['TMP', 'INCLUDE', 'PATH', 'BKOFFICE', 'INETSDK', 'TEMP', 'WINBOOTDIR',
'BASEMAKE', 'MSSDK', 'BLASTER', 'LIB', 'COMSPEC', 'PROMPT', 'CMDLINE',
'MSTOOLS', 'WINDIR', 'DXSDKROOT']
>>> os.environ.keys('PATH')
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: keys() takes exactly 1 argument (2 given)
>>> os.environ.keys['PATH']
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: unsubscriptable object
>>>

The reason I tried the brackets is because the two books I have show braces
rather than parenthesis.  Neither form works.  I have tried other Python
shells and they all have the same problem.

In this case a bit of help would be great - I really have no idea how to
deal with this.

--
Cheers, Bill
TANSTAAFL!






More information about the Python-list mailing list