problem work py from cmd #126217
Replies: 3 comments
-
i have this problem in CMD PS C:\Users\Administrator\PycharmProjects\test> python ./test2.py |
Beta Was this translation helpful? Give feedback.
-
i have this problem in CMD PS C:\Users\Administrator\PycharmProjects\test> python ./test2.py |
Beta Was this translation helpful? Give feedback.
-
Body
i have a problem with this code
it is working good in pycharm but cannot convert it to exe
when i convert it not open or have a problem
can you help me please
this is my code
#########
{
import openpyxl
from barcode import Code128
from barcode.writer import ImageWriter
from PIL import Image, ImageDraw, ImageFont
from arabic_reshaper import arabic_reshaper
from bidi.algorithm import get_display
import textwrap
import subprocess
import win32print
import os
Determine the main file path
main_file_path = os.path.join(os.path.expanduser(“~”), “PycharmProjects”, “BarCode”, “testbarcode1.xlsx”)
while True:
Receive data from the user
data = input(" S c a n : ")
if data.lower() == “exit”:
print(“Exiting program…”)
break
try:
number = int(input(" Quantity : "))
except ValueError:
print("Invalid input. Please try again.")
continue
Read the main file
main_workbook = openpyxl.load_workbook(main_file_path)
main_sheet = main_workbook.active
Search for the data in the main file and copy it to the print file
found = False
for row in main_sheet.iter_rows(values_only=True):
if str(data) in map(str, row):
print(row)
found = True
Check if the data is not found
if not found:
print("Data not found in the main file.")
}
##########
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions