J'ai deux fichiers .py : hello.py qui importe dispmsg.py
dispmsg.py
hello.py
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 import tkinter as tk def displaymessage(msg): w=tk.Tk() tk.Label(w,text=msg).pack() tk.mainloop() if __name__ == "__main__": displaymessage('TEST')
Pour faire une distribution j'ai le setup.py suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 import dispmsg dispmsg.displaymessage('HELLO !')
En lançant la ligne de commande "python setup.py sdist" j'obtiens:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 from distutils.core import setup setup(name='hello', version='1.0', py_modules=['dispmsg'], scripts=['hello'], )
Pourquoi ai-je le message "'hello' not a regular file -- skipping" ?writing manifest file 'MANIFEST'
creating hello-1.0
making hard links in hello-1.0...
hard linking dispmsg.py -> hello-1.0
'hello' not a regular file -- skipping
hard linking setup.py -> hello-1.0
creating dist
creating 'dist\hello-1.0.zip' and adding 'hello-1.0' to it
adding 'hello-1.0\dispmsg.py'
adding 'hello-1.0\PKG-INFO'
adding 'hello-1.0\setup.py'
removing 'hello-1.0' (and everything under it)
Partager