-3

If suppose I use the function execfile in my python script and then I use pyinstaller to convert that python script into an executable file then will that executable file work?What pyisntaller does is look for import statement and then include those modules which are mentioned in the import statement of my script.The images that I include in my script can be dealt with by copying them into the dist folder which pyinstaller creates but how to deal with the script that I mention in the execfile function.

I just want to know a method of converting a python script that contains execfile (which calls another script from within the original script) into an executable file

timgeb
  • 76,762
  • 20
  • 123
  • 145
Akshay
  • 463
  • 6
  • 15
  • 1
    *will that executable file work?* I don't understand, why are not you trying to figure out yourself? – hola Jul 05 '14 at 12:44

2 Answers2

1

You can tell PyInstaller which files to include in the dist folder. Include all .py files you need. When calling execfile, specify the correct directory name (you have to figure this one out).

pts
  • 80,836
  • 20
  • 110
  • 183
  • Actually I wanted a way to make it work without including the .py files in the dist folder.I was somewhat confused with how pyinstaller works.But I have figured it out now.Anyways thanks for valuable comments. – Akshay Jul 08 '14 at 19:01
0

I could not understand what this

a python script that contains execfile (which calls another script from within the original script)

is supposed to mean. Anyways if the .py script works then an executable created by pyinstaller will also work, most of the time.

user2963623
  • 2,267
  • 1
  • 14
  • 25