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 56ad072 commit baa63f1Copy full SHA for baa63f1
main.py
@@ -10,11 +10,11 @@ def main():
10
filename = args[0].split("/")[-1].split(".")[0]
11
12
with open(f"{filename}.tmpbash", 'w') as f:
13
- f.write("#!/bin/bash\n\npython3 -c \"\nimport os\n__file__ = f\\\"{os.getcwd()}/"+args[0].split("/")[-1]+"\\\"\n\n")
+ f.write("#!/bin/bash\n\npython3 -c '\nimport os, sys\n__file__ = sys.argv[0] = f\"{os.getcwd()}/"+args[0].split("/")[-1]+"\"\n\n")
14
for line in code:
15
- line = line.replace("\\", "\\\\").replace("\"", "\\\"")
+ line = line.replace("'", "'\"'\"'")
16
f.write(f"{line}\n")
17
- f.write("\" \\$\\@")
+ f.write("' $@")
18
19
os.system(f"shc -f {filename}.tmpbash")
20
os.remove(f"{filename}.tmpbash")
0 commit comments