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.py - Last Update: 7/10/2024 Ver. 0.13.12 RC 1 - Author: cooldude2k $
19 from __future__
import absolute_import
, division
, print_function
, unicode_literals
, generators
, with_statement
, nested_scopes
28 from pycatfile
import *
31 if(len(sys
.argv
) < 2):
34 str(sys
.version_info
[0])+"."+str(sys
.version_info
[1]
35 )+"."+str(sys
.version_info
[2])+"> "
37 print("PyShell "+sys
.version
+" on "+sys
.platform
+os
.linesep
+"Loaded Python module " +
38 pycatfile
.__program
_name
__+" "+pycatfile
.__version
__+os
.linesep
)
41 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
42 except KeyboardInterrupt:
43 print("\nKeyboardInterrupt")
49 # exec(str(cmdinput));
51 exec(code
.compile_command(str(cmdinput
)))
56 if(sys
.argv
[1] == "sh" or sys
.argv
[1] == "shell" or sys
.argv
[1] == "pysh" or sys
.argv
[1] == "pyshell" or sys
.argv
[1] == "python"):
59 str(sys
.version_info
[0])+"."+str(sys
.version_info
[1]
60 )+"."+str(sys
.version_info
[2])+"> "
62 print("PyShell "+sys
.version
+" on "+sys
.platform
+os
.linesep
+"Loaded Python module " +
63 pycatfile
.__program
_name
__+" "+pycatfile
.__version
__+os
.linesep
)
66 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
67 except KeyboardInterrupt:
68 print("\nKeyboardInterrupt")
74 # exec(str(cmdinput));
76 exec(code
.compile_command(str(cmdinput
)))
81 if(sys
.argv
[1] == "shebang" or sys
.argv
[1] == "shabang" or sys
.argv
[1] == "hashbang" or sys
.argv
[1] == "poundbang" or sys
.argv
[1] == "hashexclam" or sys
.argv
[1] == "hashpling"):
83 if(len(sys
.argv
) < 3):
84 print(str("command: "+sys
.argv
[0]+os
.linesep
+"arguments: " +
85 sys
.argv
[1]+os
.linesep
+"error: syntax error missing arguments"))
87 shebang
= "".join(open(sys
.argv
[2], "r").readlines())
88 exec(compile(str(shebang
), "", "exec"))
91 if(sys
.argv
[1] == "version" or sys
.argv
[1] == "ver" or sys
.argv
[1] == "getversion" or sys
.argv
[1] == "getver"):
93 print(pycatfile
.__version
__)
96 if(sys
.argv
[1] == "exec" or sys
.argv
[1] == "run" or sys
.argv
[1] == "execute"):
98 argcmd
= list(sys
.argv
)
100 argcmd
= list(argcmd
)
102 argcmd
= list(argcmd
)
103 argcmd
= " ".join(argcmd
)
107 print(str("command: "+sys
.argv
[0]+os
.linesep
+"arguments: " +
108 sys
.argv
[1]+os
.linesep
+"error: syntax error missing arguments"))