py2exe bei import?

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
hannes99

Hallo,
ich habe eine python datei 123.py in der 456.py importiert wird. Wie mache ich es nun mit py2exe, dass 123.exe auch auf die Datei 456 zurückgreift?

Wenn ich es ganz normal mit py2exe mache klappt es nicht.

Vielen Dank!
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Ich seh grad dein Problem nicht:
first.py:

Code: Alles auswählen

#!/usr/bin/env python
# -*- encoding: latin-1 -*-
import second
second.isthere()
second.py:

Code: Alles auswählen

#!/usr/bin/env python
# -*- encoding: latin-1 -*-

def isthere():
    print "Yep, I'm here"
$ python first.py
Yep, I'm here
setup.py

Code: Alles auswählen

from distutils.core import setup
import py2exe

setup(
  console=['first.py'],
) 
$ python setup.py py2exe
$ cd dist
$ ./first
Yep, I'm here
(Wobei $ dein Shellprompt ist und du das ./ weglassen kannst)
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Antworten