Hello,
I created a QT interface with python with the module asana. This interface allows to create automatically asana tasks.
I tried to generate an exe with Pyinstaller but the problem is that the interface is reloaded automatically without stopping. After a list of verification, the problem is coming from asana and especially this command :“api_client = asana.ApiClient(configuration)”
FYI : If i remove the linecommand with connect to asana and making new tasks, the exe is functioning very well.
Do you have any solution to propose?
This is my script :
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import datetime
import asana
class MyWindow(QWidget):
def init(self):
super().init()
self.initUI()
def initUI(self):
configuration = asana.Configuration()
configuration.access_token = 'xxxxxxxxxx' # we put our key
api_client = asana.ApiClient(configuration)
mem=asana.TeamMembershipsApi(api_client)
requesters = mem.get_team_memberships_for_team('xxxxxxxxx') # we put the team gid
requester_names = [e.user.name for e in requesters.data]
first_requester_names = requester_names[0]
self.setWindowTitle(first_requester_names)
self.label = QLabel('Cliquez sur le bouton')
self.button = QPushButton('Cliquez ici')
layout = QVBoxLayout()
layout.addWidget(self.label)
layout.addWidget(self.button)
self.setLayout(layout)
self.button.clicked.connect(self.buttonClicked)
def buttonClicked(self):
self.label.setText('Bouton cliqué')
if name == ‘main’:
app = QApplication(sys.argv)
fenetre =MyWindow(()
fenetre.show()
sys.exit(app.exec_())
for generating exe i use this command :
pyinstaller --onefile --windowed myscript.py