4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the Revised BSD License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 Revised BSD License for more details.
12 Copyright 2018-2024 Cool Dude 2k - http://idb.berlios.de/
13 Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
14 Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
16 $FileInfo: pyshell-old.py - Last Update: 7/10/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
19 from __future__
import print_function
29 from pycatfile
import *
32 if (len(sys
.argv
) < 2):
35 str(sys
.version_info
[0]) + "." + str(sys
.version_info
[1]
36 ) + "." + str(sys
.version_info
[2]) + "> "
38 print("PyShell " + sys
.version
+ " on " + sys
.platform
+
39 "\nLoaded Python module PyCatFile " + pycatfile
.__version
__ + "\n")
42 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
43 except KeyboardInterrupt:
44 print("\nKeyboardInterrupt")
50 # exec(str(cmdinput));
52 exec(code
.compile_command(str(cmdinput
)))
57 if (sys
.argv
[1] == "sh" or sys
.argv
[1] == "shell" or sys
.argv
[1] ==
58 "pysh" or sys
.argv
[1] == "pyshell" or sys
.argv
[1] == "python"):
61 str(sys
.version_info
[0]) + "." + str(sys
.version_info
[1]
62 ) + "." + str(sys
.version_info
[2]) + "> "
64 print("PyShell " + sys
.version
+ " on " + sys
.platform
+
65 "\nLoaded Python module PyCatFile " + pycatfile
.__version
__ + "\n")
68 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
69 except KeyboardInterrupt:
70 print("\nKeyboardInterrupt")
76 # exec(str(cmdinput));
78 exec(code
.compile_command(str(cmdinput
)))
83 if (sys
.argv
[1] == "shebang" or sys
.argv
[1] == "shabang" or sys
.argv
[1] == "hashbang" or sys
.argv
[1]
84 == "poundbang" or sys
.argv
[1] == "hashexclam" or sys
.argv
[1] == "hashpling"):
86 if (len(sys
.argv
) < 3):
87 print(str("command: " + sys
.argv
[0] + "\narguments: " +
88 sys
.argv
[1] + "\nerror: syntax error missing arguments"))
90 shebang
= "".join(open(sys
.argv
[2], "r").readlines())
91 exec(compile(str(shebang
), "", "exec"))
94 if (sys
.argv
[1] == "exec" or sys
.argv
[1] == "run" or sys
.argv
[1] == "execute"):
96 argcmd
= list(sys
.argv
)
100 argcmd
= list(argcmd
)
101 argcmd
= " ".join(argcmd
)
105 print(str("command: " + sys
.argv
[0] + "\narguments: " +
106 sys
.argv
[1] + "\nerror: syntax error missing arguments"))