Cheatsheet Python
Cheatsheat for Python
| Comment | # This is a comment in a Python file |
print ("Hello World!") |
|
| Arguments |
call the script like myscript.py arg1 arg2 arg3print sys.argv[1] |
| If | |
| For | for x in range(6): |
| Exit | sys.exit(0) |
Cheatsheat for Python
| Comment | # This is a comment in a Python file |
print ("Hello World!") |
|
| Arguments |
call the script like myscript.py arg1 arg2 arg3print sys.argv[1] |
| If | |
| For | for x in range(6): |
| Exit | sys.exit(0) |
Cheatsheat for DOS batches
| Comment | REM This is a comment in a DOS batch file |
ECHO Hello World! |
|
| Arguments | %1 %2 %3 |
| if | IF (condition) ( |
| for | for /l %%x in (1, 1, 5) do ( REM Do stuff) |
| Exit | EXIT |
| Get return code | ECHO %errorlevel% |