Afficher la version installé de python avec python
xunil2003
Messages postés
765
Date d'inscription
Statut
Membre
Dernière intervention
-
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23541 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
J'utilise python version 2.7.17.
J'ai besoin d'afficher la version de python installer
la version de python ne s'affiche pas mais dans la console oui ?
Avec textbox.insert() ça ne fonctionne pas ?
Retour
Comment puis-je faire ?
Merci d'avance pour vos conseils et aides.
J'utilise python version 2.7.17.
J'ai besoin d'afficher la version de python installer
def versions():
fs_versions = Toplevel(Frame2)
Framex0 = Frame(fs_versions, borderwidth=2, relief=FLAT)
Framex0.pack(padx=10,pady=10)
Framex1 = Frame(Framex0,borderwidth=2,relief=FLAT)
Framex1.pack(padx=10,pady=10)
Framex2 = Frame(Framex0,borderwidth=2,relief=FLAT)
Framex2.pack(padx=10,pady=10)
Framex3 = Frame(Framex0,borderwidth=2,relief=FLAT)
Framex3.pack(padx=10,pady=10)
CMD1 = "python --version"
b = os.popen(CMD1).read()
print "b :", b
scrollbar = Scrollbar(Framex2)
scrollbar.pack(side=RIGHT, fill=Y)
textbox = Text(Framex2, height=30, width=100)
textbox.tag_configure('normal', font=("Times New Roman", 14, "italic"))
textbox.tag_configure('titre', font=("Times New Roman", 22, "roman", "bold", "italic"))
textbox.tag_configure('chapitre', font=("Times New Roman", 18, "roman", "bold", "underline"))
textbox.tag_configure('texte', font=("Times New Roman", 14, "roman"))
textbox.tag_configure('gras', font=("Times New Roman", 18, "roman", "bold"))
textbox.insert(INSERT, "Versions", "titre")
textbox.insert(INSERT, "\n")
textbox.insert(INSERT, "\nVersion du système", "chapitre")
textbox.insert(INSERT, "\n"+a, "texte")
textbox.insert(INSERT, "\n")
textbox.insert(INSERT, "\nVersion de Python", "chapitre")
textbox.insert(INSERT, "\n"+b, "texte")
textbox.insert(INSERT, "\n")
textbox.pack()
textbox.config(yscrollcommand=scrollbar.set)
scrollbar.config(command=textbox.yview)
Button(Framex3, text=" Ok ", command=fs.destroy).grid(row=1) #.pack(padx=10,pady=10)
fs.mainloop()
la version de python ne s'affiche pas mais dans la console oui ?
Avec textbox.insert() ça ne fonctionne pas ?
Retour
a : Linux Laurent-I7-9900K 5.4.0-65-generic #73~18.04.1-Ubuntu SMP Tue Jan 19 09:02:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.17
b :
Comment puis-je faire ?
Merci d'avance pour vos conseils et aides.
Configuration: Linux / Firefox 85.0
A voir également:
- Afficher la version installé de python avec python
- Citizen code python avis - Accueil - Outils
- Dernière version ccleaner gratuit français - Télécharger - Nettoyage
- Splitcam ancienne version - Télécharger - Messagerie
- Version gratuite de word - Guide
- Ancienne version autocad gratuite - Télécharger - CAO-DAO
1 réponse
yg_be
Messages postés
23541
Date d'inscription
Statut
Contributeur
Dernière intervention
Ambassadeur
1 584
bonjour,
exemple:
exemple:
import sys versionpython=sys.version print(versionpython)