subprocess.popen() in Eclipse

This is the place for queries that don't fit in any of the other categories.

subprocess.popen() in Eclipse

Postby jtpythonuser » Wed Oct 09, 2013 11:30 pm

All,

I have been using the pyDev plugin for Eclipse seamlessly for over a year... until today. I am developing a GUI using wxPython 2.6 with python 2.6 set-up as my interpreter in Eclipse. For a small portion of my code I am interfacing with an application that has a dependency of only interacting with python 2.5. I decided to start a new thread and use the subprocess.popen() method to solve this problem. Example:

Code: Select all
command = 'C:\Python25\python.exe C:/TEMP/runme.py'
p = subprocess.Popen(command)


When python 2.5 starts to execute the runme.py it tries to import the python 2.6 os module. See traceback from Eclipse:

Code: Select all
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "C:/TEMP/psse.py", line 12, in <module>
    import os
  File "C:\Python26\lib\os.py", line 757
    bs = b""
           ^
SyntaxError: invalid syntax


FYI, I do not have this trouble using WingIDE or IDLE. I suspect I need to change some configuration in Eclipse, but have not been able to find any guidance searching the web.

Thanks in advance,
Jason T
Last edited by Mekire on Wed Oct 09, 2013 11:34 pm, edited 1 time in total.
Reason: First post lock
jtpythonuser
 
Posts: 2
Joined: Fri Oct 04, 2013 1:49 pm

Re: subprocess.popen() in Eclipse

Postby micseydel » Thu Oct 10, 2013 12:44 am

I'm afraid that if you made that change to your Eclipse configuration that you'd break the rest of your program. Why can't you just import a main() function from runme.py and execute that in your program? I suspect that subprocess is not the right way to solve your problem.
Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 941
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Coding Help

Who is online

Users browsing this forum: Coder151 and 2 guests