MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Lib/idlelib/pyshell.py:1518–1692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1516"""
1517
1518def main():
1519 import getopt
1520 from platform import system
1521 from idlelib import testing # bool value
1522 from idlelib import macosx
1523
1524 global flist, root, use_subprocess
1525
1526 capture_warnings(True)
1527 use_subprocess = True
1528 enable_shell = False
1529 enable_edit = False
1530 debug = False
1531 cmd = None
1532 script = None
1533 startup = False
1534 try:
1535 opts, args = getopt.getopt(sys.argv[1:], "c:deihnr:st:")
1536 except getopt.error as msg:
1537 print(f"Error: {msg}\n{usage_msg}", file=sys.stderr)
1538 sys.exit(2)
1539 for o, a in opts:
1540 if o == '-c':
1541 cmd = a
1542 enable_shell = True
1543 if o == '-d':
1544 debug = True
1545 enable_shell = True
1546 if o == '-e':
1547 enable_edit = True
1548 if o == '-h':
1549 sys.stdout.write(usage_msg)
1550 sys.exit()
1551 if o == '-i':
1552 enable_shell = True
1553 if o == '-n':
1554 print(" Warning: running IDLE without a subprocess is deprecated.",
1555 file=sys.stderr)
1556 use_subprocess = False
1557 if o == '-r':
1558 script = a
1559 if os.path.isfile(script):
1560 pass
1561 else:
1562 print("No script file: ", script)
1563 sys.exit()
1564 enable_shell = True
1565 if o == '-s':
1566 startup = True
1567 enable_shell = True
1568 if o == '-t':
1569 PyShell.shell_title = a
1570 enable_shell = True
1571 if args and args[0] == '-':
1572 cmd = sys.stdin.read()
1573 enable_shell = True
1574 # process sys.argv and sys.path:
1575 for i in range(len(sys.path)):

Callers 3

idle.pyFile · 0.90
idlemain.pyFile · 0.90
pyshell.pyFile · 0.70

Calls 15

open_shellMethod · 0.95
destroyMethod · 0.95
fix_scalingFunction · 0.90
systemFunction · 0.90
fixwordbreaksFunction · 0.90
NoDefaultRootFunction · 0.85
TkClass · 0.85
PhotoImageClass · 0.85
fix_x11_pasteFunction · 0.85
PyShellFileListClass · 0.85
GetOptionMethod · 0.80
wm_iconbitmapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…