You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the opened issues and there are no duplicates
Describe the bug
I have this working code,
But if i use "flet build windows" to build the app return this error:
Traceback (most recent call last):
File "", line 94, in
File "", line 229, in run_module
File "", line 88, in _run_code
File "C:[path]\flet\app\main.py", line 16, in
import win32print
ModuleNotFoundError: No module named 'win32print'.
Any fix for this?.
"subprocess" library does not meet my needs in this occassion.
Code sample
Code
[
fromPILimportImageimportwin32printimportwin32uifromfletimportPage, Container, Column, ElevatedButton, appdefmain(page: Page):
defprint(e):
hprinter=win32print.OpenPrinter(printer_name)
barcode_command= (
b"\x1d\x68\x50"# Altura del código de barras (80 puntos)b"\x1d\x77\x02"# Ancho de las barras (2 puntos)b"\x1d\x6b\x49"# Comando para iniciar Code 128+bytes([len("J7PR-MOIP-TECN")]) # Longitud de los datos+b"J7PR-MOIP-TECN"# Datos del código de barras
)
text_command=b"\x1d\x21\x00\x1b\x61\x00J7PR-MOIP-TECN\n\n\x1d\x56\x00"final_barcode=barcode_command+text_command+b"\n\n\x1d\x56\x00"try:
hjob=win32print.StartDocPrinter(hprinter, 1, ("Test", None, "RAW"))
win32print.StartPagePrinter(hprinter)
win32print.WritePrinter(hprinter, final_barcode)
win32print.EndPagePrinter(hprinter)
win32print.EndDocPrinter(hprinter)
finally:
win32print.ClosePrinter(hprinter)
page.add(
Container(
Column(
[
ElevatedButton("Imprimir", on_click=print)
]
)
)
)
app(main)
]
To reproduce
later of build
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
10
Flet version
0.25.2
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response
The text was updated successfully, but these errors were encountered:
Duplicate Check
Describe the bug
I have this working code,
But if i use "flet build windows" to build the app return this error:
Traceback (most recent call last):
File "", line 94, in
File "", line 229, in run_module
File "", line 88, in _run_code
File "C:[path]\flet\app\main.py", line 16, in
import win32print
ModuleNotFoundError: No module named 'win32print'.
Any fix for this?.
"subprocess" library does not meet my needs in this occassion.
Code sample
Code
To reproduce
later of build
Expected behavior
No response
Screenshots / Videos
Captures
[Upload media here]
Operating System
Windows
Operating system details
10
Flet version
0.25.2
Regression
No, it isn't
Suggestions
No response
Logs
Logs
[Paste your logs here]
Additional details
No response
The text was updated successfully, but these errors were encountered: