Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedding a executable inside Python Script

Reply
Thread Tools

Embedding a executable inside Python Script

 
 
Shankarjee Krishnamoorthi
Guest
Posts: n/a
 
      09-19-2007
Hi
I have a python routine which calls an executable file created by
someone else (I dont have the source code. All I have is an exe file).
I do

# My Python Code
output = os.system('other_executable.exe')
# Rest of my program.

I need to give this routine to others to use it. I have a exe made
with py2exe for my Python routine. The issue I am running into is
this. All the exes (mycode.exe and other_executable.exe) are placed in
a Network drive(Say I so that people can access it.

When the user calls this from a Local Drice(Say C The output is like this
C:> I:\mycode.exe input_file
other_executable_file.exe is not found.....

Is there any way where I can circumvent this. Thanks

Shankarjee
 
Reply With Quote
 
 
 
 
Grant Edwards
Guest
Posts: n/a
 
      09-19-2007
On 2007-09-19, Shankarjee Krishnamoorthi <> wrote:

> I have a exe made with py2exe for my Python routine. The issue
> I am running into is this. All the exes (mycode.exe and
> other_executable.exe) are placed in a Network drive(Say I so
> that people can access it.
>
> When the user calls this from a Local Drice(Say C The output is like this
> C:> I:\mycode.exe input_file other_executable_file.exe is not found.....


The problem is that 'other_executable.exe' isn't in a directory
that's on the current PATH.

> Is there any way where I can circumvent this. Thanks


Either set the PATH environment variable to include the
directory where other_executable.exe is located or specify the
complete path to other_executable.exe in your os.system() call.

--
Grant Edwards grante Yow! I hope the
at ``Eurythmics'' practice
visi.com birth control ...
 
Reply With Quote
 
 
 
 
Shankarjee Krishnamoorthi
Guest
Posts: n/a
 
      09-19-2007
I missed the obvious fact there. Thanks. I added it to the PATH and
that fixed everything.

Shankarjee

On 9/19/07, Grant Edwards <> wrote:
> On 2007-09-19, Shankarjee Krishnamoorthi <> wrote:
>
> > I have a exe made with py2exe for my Python routine. The issue
> > I am running into is this. All the exes (mycode.exe and
> > other_executable.exe) are placed in a Network drive(Say I so
> > that people can access it.
> >
> > When the user calls this from a Local Drice(Say C The output is like this
> > C:> I:\mycode.exe input_file other_executable_file.exe is not found.....

>
> The problem is that 'other_executable.exe' isn't in a directory
> that's on the current PATH.
>
> > Is there any way where I can circumvent this. Thanks

>
> Either set the PATH environment variable to include the
> directory where other_executable.exe is located or specify the
> complete path to other_executable.exe in your os.system() call.
>
> --
> Grant Edwards grante Yow! I hope the
> at ``Eurythmics'' practice
> visi.com birth control ...
> --
> http://mail.python.org/mailman/listinfo/python-list
>

 
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
Running an Executable Before Executable JAR Jason Cavett Java 8 05-16-2007 07:14 PM
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
How can I run a c executable in pwd ,while the executable is in some other directory vishsid3@gmail.com C Programming 15 08-21-2006 06:04 AM
embedding executable code in a regular expression in Python Avi Kak Python 5 07-18-2006 02:50 PM
distributing executable embedding Python nico Python 1 06-30-2004 11:56 PM



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