MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / viewSourceClick

Function viewSourceClick

src/gamesbyexample/__init__.py:120–133  ·  view source on GitHub ↗
(*args)

Source from the content-addressed store, hash-verified

118
119
120def viewSourceClick(*args):
121 i = CURRENT_SELECTED_INDEX
122 filename = os.path.join(FOLDER_OF_THIS_FILE, PROGRAMS[i]['filename'])
123
124 # Figure out which program to run to open the .py file:
125 if sys.platform == 'win32':
126 os.system('start ' + filename)
127 elif sys.platform == 'darwin':
128 os.system('open ' + filename)
129 elif _executable_exists('xdg-open'):
130 # LXTerminal is used on Raspberry Pis, though this closes the window as soon as the Python program quits:
131 os.system('xdg-open ' + filename)
132 elif _executable_exists('see'):
133 os.system('see ' + filename)
134
135
136def undoChangesClick(*args):

Callers

nothing calls this directly

Calls 1

_executable_existsFunction · 0.85

Tested by

no test coverage detected