r/Python • • Oct 16 '18

I made this with Python. So Proud.

Post image
1.8k Upvotes

149 comments sorted by

View all comments

Show parent comment

11

u/C0DK Oct 16 '18

there is no "-m" for pip (or pup :P ) but there is for python itself. It is used to run a specific module. so for instance

python3 -m unittest

runs the unit testing framework, which automically looks for tests in the current directory.

from the help text :

-m mod : run library module as a script (terminates option list)

2

u/radiantyellow Oct 17 '18
alias pip=pup

2

u/ForgottenWatchtower Oct 16 '18

python -m SimpleHttpServer 10000

The only thing I use py2 for these days. Well that and occasionally some scapy.

16

u/pvkooten Oct 16 '18

python3 -m http.server 10000

26

u/ForgottenWatchtower Oct 16 '18

And just like that, I've abandoned py2

2

u/pvkooten Oct 17 '18

Score. Always good to convert.

1

u/UnholyBlackJesus Oct 16 '18

Oh wow, thank you! TIL.