-
Notifications
You must be signed in to change notification settings - Fork 0
/
Python Commands.txt
209 lines (150 loc) · 5.54 KB
/
Python Commands.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
###############
# Python Venv #
###############
<<---| Mac Venv |--->>
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python -m pip install --upgrade -r requirements.txt
python3 -m pip freeze > requirements.txt
$ python3 -m pip install --upgrade --force-reinstall -r requirements.txt
$ deactivate
<<---| Git Bash Venv |--->>
virtualenv venv
source venv/Scripts/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install --upgrade -r requirements.txt
python -m pip freeze > requirements.txt
$ python -m pip install --upgrade --force-reinstall -r requirements.txt
$ deactivate
##############
# Flask Venv #
##############
<<---| Mac Flask Venv |--->>
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip freeze > requirements.txt
python3 -m pip install --upgrade -r requirements.txt
export FLASK_APP=<?????>
export FLASK_ENV=development
flask init-db
flask run
$ python3 -m pip install --upgrade --force-reinstall -r requirements.txt
$ deactivate
<<---| Git Bash Flask Venv |--->>
virtualenv venv
./venv/Scripts/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install --upgrade -r requirements.txt
python -m pip freeze > requirements.txt
export FLASK_APP=<?????>
export FLASK_ENV=development
flask init-db
flask mock-db
flask run
$ python -m pip install --upgrade --force-reinstall -r requirements.txt
$ deactivate
#######
# Pip #
#######
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
pip --version
##########################
# Install/Update/Upgrade #
##########################
<<---| Mac |--->>
##### Pip install packages #####
$ pip3 install <?????>
$ python -m pip install <?????>
##### Upgrade a Pip package #####
$ pip3 install <?????> --upgrade
$ python -m pip install <?????> --upgrade
##### Upgrade requirements.txt packages #####
$ pip3 install -r requirements.txt --upgrade
$ python -m pip install -r requirements.txt --upgrade
##### Upgrade Pip #####
$ pip3 install -U pip
$ python3 -m pip install -U pip
$ python -m pip install -U pip
##### Copy pip list to clipboard #####
$ pip3 list | pbcopy
$ python -m pip list | clip
##### Paste pip list outdated to clipboard #####
$ pip3 list --outdated | pbcopy
$ python -m pip list --outdated | clip
##### Paste pip list outdated to file #####
$ pbpaste > pip-outdated.txt
$ clip > pip-outdated.txt
##### Show pip package #####
$ pip3 show <?????> <?????>
$ python -m pip show <?????> <?????>
##### Update/Upgrade all Pip in Venv #####
$ pip freeze --local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U
$ python -m pip freeze --local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U
##### Update/Upgrade all global pip packages #####
$ pip3 list -o | grep -v -i warning | cut -f1 -d’ ' | tr ” ” “\n” | awk ‘{if(NR>=3)print}’ | cut -d’ ' -f1 | xargs -n1 pip3 install -U
$ python -m pip list -o | grep -v -i warning | cut -f1 -d’ ' | tr ” ” “\n” | awk ‘{if(NR>=3)print}’ | cut -d’ ' -f1 | xargs -n1 pip3 install -U
########################
# Pip requirements.txt #
########################
##### Install pip packages in requirements.txt #####
$ pip3 install -r requirements.txt
$ python -m pip install -r requirements.txt
##### Add pip packages to requirements.txt #####
$ pip3 freeze > requirements.txt
$ python -m pip freeze > requirements.txt
##### View requirements.txt contents #####
$ cat requirements.txt
##### Copy requirements.txt contents to clipboard #####
$ pbcopy < requirements.txt
$ clip < requirements.txt
##### Uninstall system Python pip packages #####
$ pip3 uninstall -r requirements.txt
$ python -m pip uninstall -r requirements.txt
# Or to remove all at once #
$ pip3 uninstall -r requirements.txt -y
$ python -m pip uninstall -r requirements.txt -y
##############
# youtube-dl #
##############
youtube-dl -cit --extract-audio --audio-format mp3 'bestaudio[ext=mp3]/best[ext=mp3]/best' '<video url>'
youtube-dl -f mp4'bestvideo[ext=mp4]+bestaudio[ext=mp4]/best[ext=mp4]/best' '<video url>'
youtube-dl --playlist-items 2,3,7,10 '<playlist_url>'
youtube-dl --playlist-start 1 '<playlist_url>'
youtube-dl --playlist-start 2 --playlist-end 5 '<playlist_url>'
youtube-dl --list-formats '<video_url>'
youtube-dl -f best '<video_url>'
youtube-dl -f bestvideo+bestaudio '<video_url>'
youtube-dl -f mp4 '<video_url>'
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' '<video_url>'
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best' -o "%(title)s-%(id)s.%(ext)s" '<video_url>'
youtube-dl -o '%(title)s.%(ext)s' '<video_url>'
##########
# Pygame #
##########
python -m pip install setuptools requests -U
python -m pip install --upgrade pip
python -m pip install --upgrade -r requirements.txt
python -m pip install https://github.com/pygame/pygame/archive/master.zip
python -m pip install https://github.com/pygame/pygame/archive/1.9.4.zip
python -m pip install git+https://github.com/pygame/pygame.git
python -m pygame.tests
python -m buildconfig -sdl2 --download
python -m pip install .
python -m pygame.examples.aliens
python -m pip install --upgrade -r requirements.txt
python -m pip freeze > requirements.txt
python -m pip install --upgrade --force-reinstall -r requirements.txt
python -m pip freeze > requirements.txt
#################
# Shebang Lines #
#################
#! /usr/bin/env python
#! /usr/bin/python
#! /usr/local/bin/python
#! python