-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathPython.language.txt
66 lines (46 loc) · 2.56 KB
/
Python.language.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
┏━━━━━━━━━━━━┓
┃ PYTHON ┃
┗━━━━━━━━━━━━┛
VERSION ==> #3.5.0
#!/usr/bin/env python #Shebang
# -*- coding: ENCODING -*- #Extra line after sheband to specify encoding (def: UTF8)
python #Command line interpreter (interactive mode)
python FILE ARG... #Input as file
-m MODULE ARG... #Same but using MODULE main file
-c COMMAND ARG... #Input as a string
-i #Forces interactive mode
┌────────────┐
│ SYNTAX │
└────────────┘
#COMMENT #
... #COMMENT #
(EXPR) #
VAR = VAL #Returns VAL
┌───────────┐
│ TYPES │
└───────────┘
SYSTEM ==> # - strongly typed
# - dynamic type checking
# -
┌────────────┐
│ NUMBER │
└────────────┘
int #
float #
NUM + NUM2 #
NUM - NUM2 #
NUM * NUM2 #
NUM / NUM2 #
NUM // NUM2 #Floor division
NUM % NUM2 #
NUM ** NUM2 #
┌──────────────────────┐
│ INTERACTIVE MODE │
└──────────────────────┘
quit()
CTRL-D #
┌─────────┐
│ SYS │
└─────────┘
SYS.argv #ARGS... (including FILE or switches) as STR_ARR
#-m MODULE is replaced by FILE