Closed vashamamasha2014 closed 6 days ago
In the original, pyinstaller does not need to specify all files, by specifying 1 main.py file it will automatically pull up all imports. Try not to add all files manually
try just pyinstaller --onefile main.py
try just pyinstaller --onefile main.py
This happens when exactly "-noconsole", I need a silent start.
try just
pyinstaller --onefile main.py
-noconsole:
I see, in that case, I can't help you.
You can try commenting out the for loop within which stdout is used, this will disable the banner display but should help if stdout is not used anywhere else.
You can try commenting out the for loop within which stdout is used, this will disable the banner display but should help if stdout is not used anywhere else.
I have solved the problem, please fix it in your main code so that users do not have problems with this in the future, thank you. There are two functions that need to be fixed:
def loading_bar(duration):
bar_length = 40
end_time = time.time() + duration
while time.time() < end_time:
for i in range(bar_length + 1):
percent = (i / bar_length) * 100
bar = "█" * i + "-" * (bar_length - i)
print(f"\r[{bar}] {percent:.2f}%", end='', flush=True)
time.sleep(duration / bar_length) # Adjust the duration for each step
# Clear the loading bar
print("\r" + " " * (bar_length + 8) + "\r", end='', flush=True)
if __name__ == "__main__":
loading_bar(4)
def loading_bar2(duration):
total_steps = 20
interval = duration / total_steps
print("Loading:", end=" ", flush=True)
for i in range(1, total_steps + 1):
print(f"\rLoading: {'█' * i}{' ' * (total_steps - i)} {int(i * 100 / total_steps)}%", end="", flush=True)
time.sleep(interval)
print(f"\rLoading: {'█' * total_steps} 100%", flush=True)
You can try commenting out the for loop within which stdout is used, this will disable the banner display but should help if stdout is not used anywhere else.
I have solved the problem, please fix it in your main code so that users do not have problems with this in the future, thank you. There are two functions that need to be fixed:
def loading_bar(duration): bar_length = 40 end_time = time.time() + duration while time.time() < end_time: for i in range(bar_length + 1): percent = (i / bar_length) * 100 bar = "█" * i + "-" * (bar_length - i) print(f"\r[{bar}] {percent:.2f}%", end='', flush=True) time.sleep(duration / bar_length) # Adjust the duration for each step # Clear the loading bar print("\r" + " " * (bar_length + 8) + "\r", end='', flush=True) if __name__ == "__main__": loading_bar(4)
def loading_bar2(duration): total_steps = 20 interval = duration / total_steps print("Loading:", end=" ", flush=True) for i in range(1, total_steps + 1): print(f"\rLoading: {'█' * i}{' ' * (total_steps - i)} {int(i * 100 / total_steps)}%", end="", flush=True) time.sleep(interval) print(f"\rLoading: {'█' * total_steps} 100%", flush=True)
I'm afraid that users who don't want to use the code provided by the author according to the instructions provided by the author will have to solve their problems themselves).
I'm afraid that users who don't want to use the code provided by the author according to the instructions provided by the author will have to solve their problems themselves).
I don't see any difficulties for you, as one of the developers who actively participates in the development of this bot, to apply this code. Moreover, it does not violate the functionality of the loading bar. Github is needed for this, to share developments, and so that each user can contribute to the common cause)
We do not support or release any executable (.exe) files, as they are not related to the project.
Раньше When compiling in .exe via PyInstaller with the parameter -noconsole