Cheatsheet Python

Cheatsheat for Python

Comment # This is a comment in a Python file
print print ("Hello World!")
Arguments call the script like myscript.py arg1 arg2 arg3

print sys.argv[1]
print sys.argv[2]
print sys.argv[3]
If
if (condition):
    # indented four spaces
    # Do stuff
else:
    # Do other stuff
For for x in range(6):
    # Do stuff
Exit sys.exit(0)

cheatsheet dos

Cheatsheat for DOS batches

Comment REM This is a comment in a DOS batch file
print ECHO Hello World!
Arguments %1 %2 %3
if IF (condition) (
REM Do stuff
) ELSE (
REM Do other stuff
)
for for /l %%x in (1, 1, 5) do ( REM Do stuff)
Exit EXIT
Get return code ECHO %errorlevel%