RAM=open('/root/arg2', 'r').read()
if RAM=="":
try:
if not sys.argv[2]=="":
f = open("/root/arg2","a")
f.write(sys.argv[2])
f.close()
if float(RAM) > 4096:
os.system("echo What the hell?")
What's wrong with the script above? The line after f.close() always gives error when compiling. Error from compiling:
riki137@riki137-K70IC:~/scripts$ python -m compileall *
Compiling thatscript.py ...
Sorry: IndentationError: ('unexpected unindent', ('thatscript.py', 20, 1, '\tif float(RAM) > 4096:\n'))
I have tried spaces, different commands, new blank lines. None of that solved it.
if floatis only indented 4 spaces. It is like having an extra close brace in other languages. Place the if: block at same indentation level as the try: and you will see a new error that will help you along the way.