MCPcopy Index your code
hub / github.com/RetiredWizard/PyDOS / exCmd

Function exCmd

PyDOS.py:139–154  ·  view source on GitHub ↗
(cFile,passedIn)

Source from the content-addressed store, hash-verified

137 return (quit,nLines)
138
139 def exCmd(cFile,passedIn):
140 try:
141 with open(cFile) as cf:
142 if passedIn.find("'") > -1:
143 exec(f'passedIn = "{passedIn}"\n{cf.read()}')
144 else:
145 exec(f"passedIn = '{passedIn}'\n{cf.read()}")
146 except Exception as err:
147 print_exception(err,err, \
148 err.__traceback__ if hasattr(err,'__traceback__') else None)
149 envVars['lasterror'] = format_exception(err,err, \
150 err.__traceback__ if hasattr(err,'__traceback__') else None)
151 except KeyboardInterrupt:
152 print("^C")
153
154 return
155
156 def chkPath(tstPath):
157 validPath = True

Callers 1

PyDOSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected