Lesson - 30 : Python3 - Python Modules : Using from with import

Veröffentlicht am: 28 Dezember 2017
auf dem Kanal: Sada Learning Hub
38
2

**************************************************
Python Core PlayList :    • Lesson - 01 : Python3 - What is python  
Python Advanced PlayList :    • Lesson - 46 : Python Advanced - Pytho...  
**************************************************
Python Modules : Using from with import:
Python module is a normal python file which can store function, variable, classes, constants etc. Module helps us to organize related codes . For e.g math module in python has mathematical related functions.

Using import statements imports everything in the module, what if you want to access only specific function or variable ? This is where from  statement comes, here is how to use it.

Example :
from mymodule import foo # this statement import only foo variable from mymodule
print(foo)

Expected output:
100

Note: In this case you don’t need to specify module name to access variables and function.

Sample Projects : https://github.com/SadaLearningHub1/P...


Auf dieser Seite können Sie das Online-Video Lesson - 30 : Python3 - Python Modules : Using from with import mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sada Learning Hub 28 Dezember 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 38 Mal angesehen und es wurde von 2 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!