Am 21.05.2012 20:27, schrieb Jean Manu:
> I have tried with pyinstaller1.5 and 1.6.

Please use the current development version. It makes accessing files
easier, using *sys._meipass*. See
<http://groups.google.com/group/pyinstaller/browse_thread/thread/8964aeb8a16adb64/bd206d7f0bf80b66?lnk=gst&q=sys._meipass#bd206d7f0bf80b66>
for more.

> print sys.path[0]+"\\test2.py"

This is uggly code. You should train to use os.path.join.

> I have also tried to include the specified file (test2.py) on the spec
> file, or to copy the test2.py on my dist directory.

There are two separate topics: a) Binging data-files to the
dist-directory and b) bringing python-scripts to the dist-directory.

You need to put something like this into your .spec file:

a = Analysis(['test1.py'])
b= Analysis(['tes21.py'])

pyzA = PYZ(a.pure)
exeA = EXE(pyzA,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          a.dependencies,
          name=os.path.join('dist', 'test2.exe'),
          debug=False,
          strip=False,
          upx=True,
          console=1 )

pyzB = PYZ(b.pure)
exeB = EXE(pyzB,
          b.scripts,
          b.binaries,
          b.zipfiles,
          b.datas,
          b.dependencies,
          name=os.path.join('dist', 'test2.exe'),
    ....)

coll = COLLECT(exeA, exeB,
               a.binaries,
               a.zipfiles,
               a.datas,
               b.binaries,
               b.zipfiles,
               b.datas,
    ...)

This makes test2 a separete, forzen executable. In test1 you are running
it with:

subprocess.Popen([ os.path.join(sys._meipass, "test2..exe"])



-- 
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP

Goebel Consult
http://www.goebel-consult.de

Monatliche Kolumne:
http://www.cissp-gefluester.de/2012-04-compliance-bringt-keine-sicherheit
Blog: http://www.goebel-consult.de/blog/prefering-git-over-mercurial

Goebel Consult ist Mitglied bei http://www.7-it.de/

Attachment: smime.p7s
Description: S/MIME Kryptografische Unterschrift

Reply via email to