MCPcopy Index your code
hub / github.com/bpython/bpython / startup

Method startup

bpython/repl.py:550–560  ·  view source on GitHub ↗

Execute PYTHONSTARTUP file if it exits. Call this after front end-specific initialisation.

(self)

Source from the content-addressed store, hash-verified

548 return "... "
549
550 def startup(self) -> None:
551 """
552 Execute PYTHONSTARTUP file if it exits. Call this after front
553 end-specific initialisation.
554 """
555 filename = os.environ.get("PYTHONSTARTUP")
556 if filename:
557 encoding = inspection.get_encoding_file(filename)
558 with open(filename, encoding=encoding) as f:
559 source = f.read()
560 self.interp.runsource(source, filename, "exec")
561
562 def current_string(self, concatenate=False):
563 """If the line ends in a string get it, otherwise return ''"""

Callers 1

process_control_eventMethod · 0.80

Calls 1

runsourceMethod · 0.80

Tested by

no test coverage detected