简体   繁体   中英

My interface doesn't show my calendar with cx_freeze

I have a problem. I use cx_freeze in order to make my programm autonomous. When I execute my program on py charm no problem, but when I freeze it I can't open an interface. This interface shwo two calendar (I use the module tk.calendar) I don't understand why nothing it show inside this Windows. I have no error when I lunch the exe in the build folder.

thank you for your help

Here the code line of the topLevel

# on importe les librairies dont nous avons besoins
import sqlite3
from tkinter import messagebox
import datetime
from lxml import etree
import tkinter as tk
from tkcalendar import Calendar
import csv


# on creer la classe pour l'interface
class AffichageExtraction:
    # ligne de code qui se lance lorsque de l'initialisation
    def __init__(self, fenetre_mere):
        date_brut = datetime.datetime.now()
        self.fenetre_extraction = tk.Toplevel(fenetre_mere)
        self.fenetre_extraction.title("Module d'extraction")
        # on creer des objetrs pour chaqu'une des interractions

    # on creer le widget calendrier
    self.DateDebut = Calendar(self.fenetre_extraction, font="Arial 14", selectmode='day', locale='fr_FR',
                              cursor="hand1", year=date_brut.year, month=date_brut.month, day=date_brut.day)

    self.DateFin = Calendar(self.fenetre_extraction, font="Arial 14", selectmode='day', locale='fr_FR',
                            cursor="hand1", year=date_brut.year, month=date_brut.month, day=date_brut.day)

    # on creer les libelle
    self.libelle_date_debut = tk.Label(self.fenetre_extraction, text="Date de début")
    self.libelle_date_fin = tk.Label(self.fenetre_extraction, text="Date de fin")
    self.libelle_spaceur = tk.Label(self.fenetre_extraction, text="    ")

    # on creer le bouton
    self.boutton_validation = tk.Button(self.fenetre_extraction, text="Exctraction ACTIP", command=self.ACTIp)
    self.boutton_csv = tk.Button(self.fenetre_extraction, text="Extraction en CSV", command=self.extraction_csv)

    self.libelle_date_debut.grid(row=0, column=1)
    self.DateDebut.grid(row=1, column=1)

    self.libelle_spaceur.grid(row=0, column=2)

    self.libelle_date_fin.grid(row=0, column=3)
    self.DateFin.grid(row=1, column=3)

    self.boutton_validation.grid(row=2, column=4)
    self.boutton_csv.grid(row=2, column=3)

and here the setup.py code for cx_freeze

import sys
from cx_Freeze import setup, Executable

base = None
if sys.platform == 'win32':
    base = 'Win32GUI'

options = {
    'build_exe': {
        'includes': 'atexit'
    }
}

executables = [
    Executable('BouclePrincipale.py', base="Win32GUI")
]

setup(name='simple_Tkinter',
      version='0.1',
      description='Sample cx_Freeze Tkinter script',
      executables=executables
      )

Yes thank you Cool Cloud, with the import babel.numbers it's working

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM