-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy path14. modules.py
More file actions
58 lines (33 loc) · 1.86 KB
/
14. modules.py
File metadata and controls
58 lines (33 loc) · 1.86 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
46
47
48
49
50
51
52
53
'''
At this point, you've got all the basics necessary to start employing modules.
We still have to teach classes, among a few other necessary basics, but now
would be a good time to talk about modules.
IF you are using linux, installing python modules is incredibly stupid easy.
For programming, linux is just lovely when it comes to installing packages
for just about whatever. I believe mac allows similar treatment, though I've
not done it myself.
When I was first starting out with python, installing modules was one of the
most difficult things, for a few reasons.
mainly, with windows, there are quite a few methods for installation of modules.
you've got pip install setuptools, download and click'n'drag, or setup.py
At the time of starting python, a large part of my troubles was that I didn't
actually understand the process of getting a module, and this is obviously very
frustrating.
Python is going to look in a few places for modules.
That's going to be site-packages and the script's directory for the most part.
There are some other places you can use, but let's leave them out of it. Knowing
this allows you yourself to make your own modules, in the form of just a script
if you want, putting that in the same directory as your main script, and then
using import to bring it on board, you can also place multiple scripts in a dir
and use that. Once you begin to familiarize yourself with this, and understand
how and why things work, it will help you a lot.
Enough on that though, let's install stuff.
So I will show linux installation first, because it takes about 10 seconds to
show
now for python, the accepted method these days is setup.py
So when you download a python module,
http://www.pyqtgraph.org/
... now finally, you can use downloaders, here is a large stash
of easy to use python installers for windows:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
'''