[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] IDLE crashes on error?



James Hofmann wrote:
This option is the -n flag. It's saved me a lot
of trouble with IDLE.

>From the help:

Running without a subprocess:

If IDLE is started with the -n command line switch it
will run in a single process and will not create the
subprocess which runs the RPC Python execution
server. >This can be useful if Python cannot create
the >subprocess or the RPC socket interface on your
platform. However, in this mode user code is not
isolated from IDLE itself. Also, the environment is
not restarted when Run/Run Module (F5) is selected.
If
your code has been modified, you must reload() the
affected modules and re-import any specific items
(e.g. from foo import baz) if the changes are to take
effect. For these reasons, it is preferable to run
IDLE with the default subprocess if at all possible.
Man, did that cause me trouble. I made a 'config' module that I put variables I wanted
to be global for my program, so I could just say 'config.varname' to reference them,
but whenever I changed the 'config.py' module I had really weird behaviour, like I hadn't
even made changes. Now I know it's because 'config.py' had already been imported
and I had to restart IDLE every time I changed it. What a hassle.

This sounds like it does the opposite of what we
want...merges the processes instead of completely
seperating them.
It does :)
I tried running IDLE with it and then
forcing my pygame code to crash. IDLE will normally
zombify(unresponsive) if I do that and make me kill it
manually; but with -n it completely blew up and gave
me a MSVC crash box. So my conjectures are: we are not
running the same program and -n is doing something
completely different for you guys, the OS running this
is a factor, or I'm doing a better job at making
crashy code.
Nice conjectures, but I think the confusion is from David's response.
I think he meant to say '[turning on this subprocess] option is [removing] the -n flag'
The -n command is on by default on windows boxen (at least mine was.)
As per someone else's instructions (I can't remember who, sorry)
Open Windows Explorer
Tools Menu > Folder Options
File Types tab
select 'py' and hit advanced
select 'Edit with Idle' and hit Edit
under 'Application used to perform action:'
get rid of the -n argument that it passes.


You should probably do this with .pyw files also.

I can't imagine why giving it more than one -n would make a difference,
or how you added -n to the argument list, but anyway,
this should do what you want.  I just tried it and it is very helpful.
I used to create .bat files for all my programs
that would run my programs and then pause,
so if there were error messages I could see them,
since pygame apps would give me IDLE problems,
but I just wrote a pygame app and it worked fine once
I removed the -n flag.

Hope that helps :D
-Luke

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com