MAK
MAK

Reputation: 7260

Python 2.7: Give input to python scripted EXE file

I have written a simple program in python which takes input value and display result accordingly.

Program: Test.py

a=raw_input('Enter value1:')
b=raw_input('Enter value2:')
#Do some work here based on passed inputs

I have to run the program in the different system where there will not be python installed. So I created Test.exe file using pyinstaller.

Now when I run .exe it's getting closed within seconds.

Question: How can I give a message Enter value1: to user to put some input values by running .exe file?

Upvotes: 0

Views: 295

Answers (1)

Joran Beasley
Joran Beasley

Reputation: 113988

make.bat

rem CREATE our test.py
echo a=raw_input('Enter value1:') > test.py
echo b=raw_input('Enter value2:') >> test.py

rem Install Pyinstaller
c:\python27\python -m pip install pyinstaller -U
rem Build IT!!!!!
c:\python27\scripts\pyinstaller --onefile test.py
rem RUN IT!!!!
dist\test.exe

Upvotes: 1

Related Questions