[Tutor] python interpreter vs bat file

Dinesh B Vadhia dineshbvadhia at hotmail.com
Sun Jul 19 14:40:41 CEST 2009


1.  Run Python Programs with Batch file
Python programs run from a Windows XP batch file (test.bat) in a CMD window initiated from Windows Explorer.  All programs except one execute successfully which stops with a memory error but batch file continues to execute other Python programs (as it should).

2.  Run Python Programs with Python Interpreter
Fire up Python Interpreter, open .py program, Run.  

When the program with the memory error in 1. is run independently as in 2. it works.

Dinesh



--------------------------------------------------------------------------------

Message: 4
Date: Sun, 19 Jul 2009 07:18:08 +0100
From: "Alan Gauld" <alan.gauld at btinternet.com>
To: tutor at python.org
Subject: Re: [Tutor] python interpreter vs bat file
Message-ID: <h3udr2$f89$1 at ger.gmane.org>
Content-Type: text/plain; format=flowed; charset="Windows-1252";
reply-type=original

"Dinesh B Vadhia" <dineshbvadhia at hotmail.com> wrote

> Not much more information available.  
> Have a batch file (eg. 'test.bat') with entries:
>
> python "program a.py"
> python "program b.py"
> python "program c.py"
>
> One of the programs (eg. 'program c.py') fails with a 
> memory error when performing a pickle.dump:
>
> Traceback (most recent call last):
>  ...
> File "....py", line 176, in pickleObject
>     pickle.dump(self, f, 2)
> MemoryError
> 
> When the programs are run in the same order from the 
> Python interpreter there are no memory errors.  

Can you elaborate on how you run the programs. It looks like 
an environmental issue so we need to know exactly what 
you are doing.

How do you run the bat file?
How do you run the programs "from the Python interpreter"

Are you using Windows Explorer or a CMD wondow? 
or the Start->Run dialog etc?

Which folders are you starting from in each case?

> This has happened before and it seems odd behavior.

So how did you fix it before? 
I've never seen or heard of this before.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090719/b4f210c9/attachment.htm>


More information about the Tutor mailing list