Ger Cas
Ger Cas

Reputation: 2298

Python script converted to exe doesn´t do anything

I have a python3 script that I want to convert to exe file. It has 2 command line arguments and when I convert it to exe using pyinstaller and run it as exe doesn´t print anything.

The script is like this:

import glob
import os
import time
import re
import sys
from collections import defaultdict
import collections

start_time = time.time()
argument1 = sys.argv[1]
argument2 = sys.argv[2:]
argument2 = [w + "f" for w in argument2]

print(argument1)
print("================================================")
print(argument2)

### Some other commands ..

I run the script successfully in python doing like this:

python3 myscript.py abc 1234 8837 828

but after converting to exe sending these commands

pyinstaller --onefile -w -F tst.py
pyinstaller --onefile -w tst.py

and run it like this:

myscript.exe abc 1234 8837 828

doesn´t print anything.

How to fix this? Thanks

Upvotes: 1

Views: 1226

Answers (1)

Nicolescu Ionut Lucian
Nicolescu Ionut Lucian

Reputation: 219

Try to use --console instead of -w.

pyinstaller --onefile --console tst.py

Upvotes: 1

Related Questions