is perl better?

J

jon c

well the cammand is
Is that coming from Windows or Python? If the latter, give us the full
exception message, which will say from where in Python. Also, try putting
the long string in a .bat file and running the .bat file by itself and then
from Python.
Terry J. Reedy


the error is coming from windows!

the error message is as I wrote it.

if you try and execute the command directly from bat you get the error input
line too long!

can perl be somehow bypassing the windows terminal and running the command
directly (does this make sense?)

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
 
N

Nicolas Fleury

jon said:
if you try and execute the command directly from bat you get the error
input line too long!

can perl be somehow bypassing the windows terminal and running the
command directly (does this make sense?)

system uses the shell, even with Perl (in Perl it actually depends on
what are the parameters). But the shell can be bypassed, so I guess
this is a shell limit.

Like said Peter, we need to know:
- How is it called in Perl.
- How is it called in Python, and do you have the same problem by using
popen.

Regards,
Nicolas
 
P

Peter Hansen

jon said:
if you try and execute the command directly from bat you get the error
input line too long!

can perl be somehow bypassing the windows terminal and running the
command directly (does this make sense?)

Sure it can. Anything's possible. Code samples please!

-Peter
 
M

Mel Wilson

the error is coming from windows!

the error message is as I wrote it.

if you try and execute the command directly from bat you get the error input
line too long!

can perl be somehow bypassing the windows terminal and running the command
directly (does this make sense?)


Avoiding the command line might help. This runs in WinNT 4:



#=======================================
"""test_huge_command.py
"""
import os

command = r'e:\bin\python23\python.exe'

pid = os.spawnv (os.P_WAIT, command
, [command, 'number_args.py']
+ ['arg-%d'%(i,) for i in xrange (1000)]
)



#=======================================
"""number_args.py
"""
import sys

argc = len (sys.argv)
print "Called with %d arguments" % (argc,)
for i in xrange (min (3, argc)):
print "%d\t%s" % (i, sys.argv)
for i in xrange (max (3, argc-3), argc):
print "%d\t%s" % (i, sys.argv)
print



#=======================================
f:\home\mwilson\projects\python>python test_huge_command.py
Called with 1001 arguments
0 number_args.py
1 arg-0
2 arg-1
998 arg-997
999 arg-998
1000 arg-999



Regards. Mel.
 
K

Klaus Momberger

jon c said:
......
the error is coming from windows!

the error message is as I wrote it.

if you try and execute the command directly from bat you get the error input
line too long!

can perl be somehow bypassing the windows terminal and running the command
directly (does this make sense?)
you might try to define classpath as a system environment variable and
increase the environment buffer size using the /E:nnnnn option of
command.com.
It can be set from CONFIG.SYS with an entry like:

SHELL=C:/WINNT/SYTEM32/command.com C:\ /P /E:4096

or larger than 4096 in your case.

Maybe this helps,

-klaus
 
I

Irmen de Jong

Klaus said:
you might try to define classpath as a system environment variable and
increase the environment buffer size using the /E:nnnnn option of
command.com.

command.com is not used on windows NT/2000/XP
It can be set from CONFIG.SYS with an entry like:

SHELL=C:/WINNT/SYTEM32/command.com C:\ /P /E:4096

Config.sys ditto.

This won't work because he uses a windows 2000 system.

--Irmen
 
K

Klaus Momberger

Irmen de Jong said:
command.com is not used on windows NT/2000/XP


Config.sys ditto.

This won't work because he uses a windows 2000 system.

--Irmen
IIRC it helped me on my WIN2K system. But I am not going to check. ;-)

-klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,128
Latest member
ElwoodPhil
Top