Win98 PySol problem

Kragen Sitaker kragen at canonical.org
Sun Nov 25 21:18:38 EST 2001


"Bill Melcher" <wpmelcher at snet.net> writes:
> What fun!  After a few nanoseconds of thought, it occurred to me that what I
> should do is invoke the Windows Run window type:
> 
> python Q:\pysol-4.72\src\pysol.py
> 
> and click OK.
> 
> Wow!  A ton of messages in the DOS/python window followed by a popup message
> named "PySol installation error" that complains that "No cardsets were found
> !!!".

Cool!

I think you should use the console window instead of the Run window.
You can get a console window by typing 'cmd' or 'command' in the Run
window, depending on your version of Windows.

> I can get the cardsets from the Russian site and try to figure out where to
> put them.  Hung off src (AKA python Q:\pysol-4.72\src\) I would guess.
> 
> However, the messages from the compile scroll away far to fast to read. Is
> there a way to save these for debugging purposes or just, at this point in
> my python education, out of curiosity.

Well, running it in a console window will save the last
scroll-buffer-full.  You can set your scrollback buffer size (on
better versions of Windows) with some Properties dialog --- I can't
remember where.

There's little bits of python you could do to save the messages to a
file.  I think you can say:
import sys
sys.stdout = file.open("output", w)
sys.stderr = sys.stdout
execfile "Q:\\pysol-4.2\\src\\pysol.py"

> Also, where does the compiled PySol go? Our old friend src? Can I add an
> option to direct the compiled out put elsewhere?

python foo.py will run foo.py by compiling it into bytecode (P-code)
and then running the bytecode; if possible, Python will also save the
bytecode in foo.pyc.  In the future, python will check to see if
foo.pyc is newer than foo.py, and if so, it will run the bytecode from
the file instead of recompiling foo.py.

> I notice that the original PySol src archive does not contain any .pyc
> files.  This makes sense to me but the current directories do have .pyc
> files last modified 11/24/2001 8:15 AM and I have run the python command
> twice today.  My problem is that I do not remember what I did to cause the
> compile yesterday and do not understand why the compiles I did today did not
> affect the time stamps in my on-disk src directory structure.

See above.

> More to the point: Where in the documentation do I find the syntax of the
> python command itself?

I use Unix, and I type 'man python', which won't work on Win98.
Section 2 of the Python Tutorial has some of what you want; more of it
is in section 6.1.

> Another topic is a file called ".gdbinit" which contains:
> 
> file python
> set args -u -t pysol.py
> 
> What the heck is this?

Sounds like an initialization file for the GNU debugger, to set it up
to run your Python command under the debugger.  Dunno why Python
recorded this.  Mine sure doesn't.

> Matt, I am sure the other guys who have responded mean well but they and, to
> a lesser extent, you do not appreciate the depth of my ignorance of those
> things that 'everybody' knows.  The Python documentation goes into great
> detail about the language itself and how to program in it.  However, the
> really fundamental mechanics of how to get stuff done (especially in Win98)
> and who's doing what to whom appears to be missing.

That's a problem for sure.  I don't know where to point you now,
because much of the information you seek is scattered in bits and
pieces among the programming documentation.

> Ah well, if I keep pestering you guys, sooner or later you will tell me what
> I need/want to know or just get tired of me and go on to other things.

Glad you're not giving up!

> PS: I cut my programming 'eye teeth' on the IBM 701, then onto the 704,
> 709x, 704x, Philco 2000, Univac 1108, Univac 494, then IBM 360, followed by
> IBM XT and the subsequent IBM AT and IBM PC clones.

Wow.

> I think the most fun machine was the 494 and I had much more fun rewriting
> portions of Fortran II (once I snagged the source) than writing code in any
> higher level language.

Assembly language hasn't changed *that* much since the 360.

One of the more fun Python projects people are working on is Armin
Rigo's psyco, which is a Python on-the-fly compiler that compiles
Python bytecode into i386 machine code in core and then jumps to it.
Dunno if it sounds like something you'd like to play with after you
play PySol:

http://homepages.ulb.ac.be/~arigo/psyco/




More information about the Python-list mailing list