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 - ast Update: 10/22/2024 Ver. 0.14.2 RC 1 - Author: cooldude2k $
19 from __future__
import absolute_import
, division
, print_function
, unicode_literals
, generators
, with_statement
, nested_scopes
27 from pycatfile
import *
30 if(len(sys
.argv
) < 2):
33 str(sys
.version_info
[0])+"."+str(sys
.version_info
[1]
34 )+"."+str(sys
.version_info
[2])+"> "
36 print("PyShell "+sys
.version
+" on "+sys
.platform
+
37 "\nLoaded Python module PyCatFile "+pycatfile
.__version
__+"\n")
40 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
41 except KeyboardInterrupt:
42 print("\nKeyboardInterrupt")
48 # exec(str(cmdinput));
50 exec(code
.compile_command(str(cmdinput
)))
55 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"):
58 str(sys
.version_info
[0])+"."+str(sys
.version_info
[1]
59 )+"."+str(sys
.version_info
[2])+"> "
61 print("PyShell "+sys
.version
+" on "+sys
.platform
+
62 "\nLoaded Python module PyCatFile "+pycatfile
.__version
__+"\n")
65 cmdinput
= code
.InteractiveConsole().raw_input(ps1
)
66 except KeyboardInterrupt:
67 print("\nKeyboardInterrupt")
73 # exec(str(cmdinput));
75 exec(code
.compile_command(str(cmdinput
)))
80 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"):
82 if(len(sys
.argv
) < 3):
83 print(str("command: "+sys
.argv
[0]+"\narguments: " +
84 sys
.argv
[1]+"\nerror: syntax error missing arguments"))
86 shebang
= "".join(open(sys
.argv
[2], "r").readlines())
87 exec(compile(str(shebang
), "", "exec"))
90 if(sys
.argv
[1] == "exec" or sys
.argv
[1] == "run" or sys
.argv
[1] == "execute"):
92 argcmd
= list(sys
.argv
)
97 argcmd
= " ".join(argcmd
)
101 print(str("command: "+sys
.argv
[0]+"\narguments: " +
102 sys
.argv
[1]+"\nerror: syntax error missing arguments"))