Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > is perl better?

Reply
Thread Tools

is perl better?

 
 
jon c
Guest
Posts: n/a
 
      03-05-2004
well the cammand is

java -hotspot -showversion ...... -classpath loads of entries
application-name

the total string is 6809 characters long.

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:

.........

__________________________________________________ _______________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger


 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      03-05-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
itself.

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.

-Peter
 
Reply With Quote
 
 
 
 
Thomas Heller
Guest
Posts: n/a
 
      03-05-2004
>> 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:


Just to throw in some real numbers, MSDN knowledge base article 830473
<http://support.microsoft.com/default.aspx?scid=kb;en-us;830473>
says:

"""
On computers running Microsoft Windows XP or later, the maximum length
of the string that you can use at the command prompt is 8191
characters. On computers running Microsoft Windows 2000 or Windows NT
4.0, the maximum length of the string that you can use at the command
prompt is 2047 characters.

This limitation applies to the command line, individual environment
variables (such as the PATH variable) that are inherited by other
processes, and all environment variable expansions. If you use Command
Prompt to run batch files, this limitation also applies to batch file
processing.
"""

Read the article to found out more (but not much more).

BTW: The workarounds that the article mentions sound more like the old
MSDOS days than like a modern operating system.
Ridiculous examples:
# Use shorter names for folders and files.

# Reduce the depth of folder trees.

# Store files in fewer folders so that fewer folders are
# required in the PATH environment variable.

Thomas


 
Reply With Quote
 
=?ISO-8859-1?Q?Bernard_Delm=E9e?=
Guest
Posts: n/a
 
      03-05-2004
jon c wrote:
> well the cammand is
>
> java -hotspot -showversion ...... -classpath loads of entries
> application-name
>
> the total string is 6809 characters long.
>


Maybe a workaround would be to use the CLASSPATH environment
variable instead of the command line -classpath parameter
(using os.environ from python). Hopefully this would make your
command line short enough not to hit any hard limit.

os.environ[ 'CLASSPATH' ] = 'lib1.jar:...:libN.jar'
os.system ( 'java -hotspot -showversion application-name' )


Hope this helps,

Bernard.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 04-04-2011 10:00 PM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 02-27-2011 11:00 PM
FAQ 2.17 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? PerlFAQ Server Perl Misc 0 02-03-2011 11:00 AM
FAQ 1.4 What are Perl 4, Perl 5, or Perl 6? PerlFAQ Server Perl Misc 0 01-23-2011 05:00 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57