is perl better?

Peter Hansen peter at
Fri Mar 5 18:40:30 CET 2004

jon c wrote:
> well the cammand is
> java -hotspot -showversion ...... -classpath loads of entries 
> application-name

Okay, I accept that the string being passed in is very long, and that 
the details aren't relevant here.  How about some example code?  From 
the Perl one that works, and the Python one that doesn't.  There are a 
dozen ways of invoking external programs...

> the total string is 6809 characters long.

This is likely far too long for the Windows command line, but perhaps 
2000 is more sophisticated than I would expect...

> I do not know the allowed character length (I am using windows 2000)
> but perl just runs the command fine, whereas python results in
> The following character string is too long:

Is that the sum total of the error message?  Is it coming from Python, 
or from the shell, or what?  Sometimes cutting and pasting the actual 
string helps.  Unless that's really all there was, other than the string 

Without more info, all I can suggest is try using popen instead of 
os.system, but that's just guessing since we don't know you _are_ using 
os.system right now.


More information about the Python-list mailing list