Script Editor V 3
Script Editor V 3
Script Editor V 3
Python Application
filemenu.add_command(label="Run
Python File",command=self.callback)
Python Method to
GUI
filemenu.add_command(label="Run
Python File",command=self.callback)
Python Method
to GUI
#Method that when called
allows execution (run) of a file
def callback(self):
self.file =
tkFileDialog.askopenfilename()
if self.file:
execfile(self.file)
filemenu.add_command(label="
Run Python
File",command=self.callback)
ScriptEditorV3 with Python IDE
Python Script to Executable
Standalone Application
➢ Reviewed documentation for ‘PyInstaller’
➢ Found Python installation folder on my ‘C’ drive and
navigated to the ‘Scripts’ folder (e.g.,
C:\Python27\ArcGIS10.4\Scripts).
➢ Opened my command prompt in computers with Windows
10 OS and right clicked on windows icon, selected Run,
and entered ‘cmd’ into open textbox.
Python Script to Executable
Standalone Application
➢ In command line, entered ‘cd’ to change directory then copied and
pasted (e.g., <control> C, <control> V) the directory path to the
‘Scripts’ folder after ‘cd’ and selected ‘Enter’ (e.g., cd
C:\Python27\ArcGIS10.4\ Scripts <Enter>).
➢ In new directory, I entered ‘pip install pyinstaller’ (e.g.,
C:\Python27\ ArcGIS10.4\Scripts> pip install pyinstaller<Enter>). I
made sure I was connected to the internet to enable pip to find and
install pyinstaller. It took a few seconds for the installation to
complete. Once completed I observed the installed new files in my
‘Scripts’ folder.
Python Script to Executable
Standalone Application
➢ I navigated back to my command window and made sure it was still
using the ‘Scripts’ directory (e.g., ‘C:\Python27\ArcGIS10.4\
Scripts>’). Then I entered: pyinstaller.exe - -onefile and the
directory path to my Python script (ScriptEditorV3.py) to create a
standalone executable application (e.g., C:\Python27\ ArcGIS10.4\
Scripts> pyinstaller.exe –onefile C:\EsriPress\Python\ Data\
Exercise13\ ScriptEditorV3.py<Enter>).
➢ Once the procedure completed running, the last line of the run
output indicated where my execution file had been placed (e.g.,
C:\Python27\ArcGIS10.4 \ Scripts\dist\ScriptEditorV3.exe).
ScriptEditorV3.exec
DESKTOP SHORTCUT
ScriptEditorV3.exec
DESKTOP SHORTCUT
ScriptEditorV3.py Script, Standalone
Execution File, and Documentation
https://drive.google.com/open?id=0B4B9I8GgTZdeODA0eUdrdDJqRkU
https://docs.python.org/2/library/tkinter.html