We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de080f8 commit bdd6977Copy full SHA for bdd6977
ptpython/entry_points/run_ptipython.py
@@ -57,11 +57,18 @@ def run():
57
# the IPython shell.)
58
user_ns = {}
59
60
+ # Startup path
61
+ startup_paths = []
62
+ if 'PYTHONSTARTUP' in os.environ:
63
+ startup_paths.append(os.environ['PYTHONSTARTUP'])
64
+
65
# --interactive
66
if a['--interactive']:
- path = a['--interactive']
67
+ startup_paths.append(a['--interactive'])
68
sys.argv = [a['--interactive']] + a['<arg>']
69
70
+ # exec scripts from startup paths
71
+ for path in startup_paths:
72
if os.path.exists(path):
73
with open(path, 'r') as f:
74
code = compile(f.read(), path, 'exec')
0 commit comments