File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,23 @@ def hey(name):
31
31
import file1 as fn
32
32
fn.hello()
33
33
fn.hey(' Jake' )
34
- ```
34
+ ```
35
+
36
+ ## External Modules
37
+ External modules can be found here [ PyPi] ( https://pypi.org/ )
38
+ - We can install modules using ` pip ` , ` pip install <package-name> ` .
39
+ - Pip comes default in ` Python 3.4 ` we can run using ` python3 -m pip install <package-name> ` .
40
+ - ` print(dir(<package_name>)) ` This tells us about the attributes.
41
+ - ` print(help(package_name)) ` This tells us everything about the package
42
+
43
+ ## Using PEP8 to cleanup Code
44
+
45
+ - We can use ` autopep8 ` to fix whitespaces and ident our code
46
+ - We can use ` autopep8 --in-place <file_name> `
47
+
48
+
49
+ ## The ` __name__ ` variable
50
+ - The ` __name__ ` variable usually refers to the file name if its the file then it will interpreted as ` __main__ `
51
+ - If it's a module then ` __name__ ` will be interpreted as the ` __file_name__ ` .
52
+
53
+ ** Note** : use ` if __name__ = '__main__' `
You can’t perform that action at this time.
0 commit comments