-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPython_tips.txt
More file actions
45 lines (34 loc) · 1.24 KB
/
Python_tips.txt
File metadata and controls
45 lines (34 loc) · 1.24 KB
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
Naming Convention :
| Thing | Case |
| --------- | ------------- |
| Folders | snake_case |
| Files | snake_case.py |
| Variables | snake_case |
| Private | _snake_case |
| Constants | UPPER_CASE |
| Functions | snake_case |
| Classes | PascalCase |
html attributes
name = backend, id = frontend, value = data
| Attribute | Used by | Purpose |
| --------- | ------- | --------------------- |
| `name` | Flask | Key in `request.form` |
| `id` | Browser | Link label, CSS, JS |
| `value` | Flask | Actual data sent |
Docker - useful commands
build an image : docker build -t <IMAGE NAME> .
spin a container : docker run -p <your pc'S port>:<docker'S port> <IMAGE NAME>
see what's using space : docker system df
Remove EVERYTHING unused : docker system prune -a --volumes
view images : docker images
view containers : docker container ls
push image to dockerhub :
docker login
docker push <IMAGE NAME>:<tag>
wsl commands
WSL Management (Run in PowerShell)
wsl -l -v # List installed distros
wsl --shutdown # Stop all WSL instances
wsl --status # Show WSL info
wsl --update # Update WSL
wsl --unregister Ubuntu # Delete a distro