Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > executing python within perl script

Reply
Thread Tools

executing python within perl script

 
 
SS
Guest
Posts: n/a
 
      12-18-2003
I am trying to execute some python commands within a perl script and
running into problems. The following works:
python -c "import mypkg;do this; do that"
however when I try to do something like
#!/bin/perl -w
......
......
$cmd = "import mypkg; do this; do that";
$string = `python -c \"$cmd\"`;

and execute this perl script I get error:

Traceback (most recent call last):
File "<string>", line 1, in ?
File "/apps/relibase/python/reliscript/python/reliscript.py"
, line 228, in ?
__internal__ = internal_storage()
File "/apps/relibase/python/reliscript/python/reliscript.py"
, line 25, in __init__
import re; self.re = re
File "/apps/relibase/python/Python-2.1.1/Lib/re.py", line 28
, in ?
from sre import *
File "/apps/relibase/python/Python-2.1.1/Lib/sre.py", line 1
7, in ?
import sre_compile
File "/apps/relibase/python/Python-2.1.1/Lib/sre_compile.py"
, line 15, in ?
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
AssertionError: SRE module mismatch
 
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
Trouble running Perl script from within a Perl script laredotornado@zipmail.com Perl Misc 4 07-29-2011 01:44 PM
Issue in executing more than one perl script from Single perl script nilesh.sonawane@gmail.com Perl Misc 3 11-01-2007 06:19 PM
executing perl script within python amaltasb@gmail.com Python 1 04-12-2006 07:31 AM
executing a python script from another python script. sarmin kho Python 1 06-04-2004 01:12 PM
Loading and executing an arbitrary Python script from within Python TheDustbustr Python 2 08-17-2003 02:42 AM



Advertisments