MCPcopy Create free account
hub / github.com/mhammond/pywin32 / Init

Method Init

Pythonwin/pywin/framework/interact.py:279–303  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

277 self.banner = banner
278# LoadFontPreferences()
279 def Init(self):
280 self.oldStdOut = self.oldStdErr = None
281
282# self.SetWordWrap(win32ui.CRichEditView_WrapNone)
283 self.interp = PythonwinInteractiveInterpreter()
284
285 self.OutputGrab() # Release at cleanup.
286
287 if self.GetTextLength()==0:
288 if self.banner is None:
289 suffix = ""
290 if win32ui.debug: suffix = ", debug build"
291 sys.stderr.write("PythonWin %s on %s%s.\n" % (sys.version, sys.platform, suffix) )
292 sys.stderr.write("Portions %s - see 'Help/About PythonWin' for further copyright information.\n" % (win32ui.copyright,) )
293 else:
294 sys.stderr.write(banner)
295 rcfile = os.environ.get('PYTHONSTARTUP')
296 if rcfile:
297 import __main__
298 try:
299 execfile(rcfile, __main__.__dict__, __main__.__dict__)
300 except:
301 sys.stderr.write(">>> \nError executing PYTHONSTARTUP script %r\n" % (rcfile))
302 traceback.print_exc(file=sys.stderr)
303 self.AppendToPrompt([])
304
305 def SetContext(self, globals, locals, name = "Dbg"):
306 oldPrompt = sys.ps1

Callers 1

OnInitialUpdateMethod · 0.45

Calls 6

OutputGrabMethod · 0.95
AppendToPromptMethod · 0.95
GetTextLengthMethod · 0.80
writeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected