- Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

In this Python Beginner Tutorial, we will begin learning how to import modules in Python. We will learn how to import modules we have written, as well as modules from the Standard Library. We will also explore sys.path and how imported modules are found. Let's get started.

The code from this vid...
In this Python Beginner Tutorial, we will begin learning how to import modules in Python. We will learn how to import modules we have written, as well as modules from the Standard Library. We will also explore sys.path and how imported modules are found. Let's get started.

The code from this video can be found at:
https://github.com/CoreyMSchafer/code_snippets/tree/master/Python-Imports

Watch the full Python Beginner Series here:
https://www.youtube.com/playlist?list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7


✅ Support My Channel Through Patreon:
https://www.patreon.com/coreyms

✅ Become a Channel Member:
https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

✅ One-Time Contribution Through PayPal:
https://goo.gl/649HFY

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist
http://a.co/inIyro1

✅ Equipment I Use and Books I Recommend:
https://www.amazon.com/shop/coreyschafer

▶️ You Can Find Me On:
My Website - http://coreyms.com/
My Second Channel - https://www.youtube.com/c/coreymschafer
Facebook - https://www.facebook.com/CoreyMSchafer
Twitter -
Instagram - https://www.instagram.com/coreymschafer/

#Python

#Python #Python Import #sys.path #Standard Library #Python Standard Library #Python sys.path #ModuleNotFoundError #Python Import Module #Import Module #Module Import #Python for Beginners #Absolute Beginners #Python for Absolute Beginners #Python Basics #Getting Started with Python #Python 3.6 #Python 36 #Python 3 #python #python tutorial #python import #python tutorial for beginners #python modules #PYTHONPATH #pythonpath
Hi Corey! Thanks for the videos. I have a problem, in min  when I print(index), it gives me -1 instead of 1. I have the same code as your github too. Thanks! - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Hi Corey! Thanks for the videos. I have a problem, in min when I print(index), it gives me -1 instead of 1. I have the same code as your github too. Thanks!

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:03:25 - 00:21:57
I do have a question. When you use “from X import Y” it only imports a specific chunk of the module.  But when you run the code around  computer still printed the first string. Why it did so? Considering you only imported the function, not the print(which is outside of said function). - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

I do have a question. When you use “from X import Y” it only imports a specific chunk of the module. But when you run the code around computer still printed the first string. Why it did so? Considering you only imported the function, not the print(which is outside of said function).

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:04:00 - 00:21:57
- Problem - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

- Problem

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:08:22 - 00:21:57
# importing modules even if they are not in the same path - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

# importing modules even if they are not in the same path

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:08:33 - 00:21:57
A. in ,I move the file location, yet the code still works properly - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

A. in ,I move the file location, yet the code still works properly

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:08:33 - 00:21:57
I move the file location, yet the code still works properly, anyone has some idea why? - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

I move the file location, yet the code still works properly, anyone has some idea why?

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:08:33 - 00:21:57
Hey Corey  I have a doubt at  you said that location differs for every system , I couldn't figure out mine. How to find the unique location for my system - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Hey Corey I have a doubt at you said that location differs for every system , I couldn't figure out mine. How to find the unique location for my system

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:09:03 - 00:21:57
sys.path.append - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

sys.path.append

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:09:17 - 00:18:00
I know it's been a long time since this video was created, but I have a problem. In  you have showed that how to import  file from different location. Every time when I am tryin to do this my program is moving line 'from my_module import find_index, test' at the top of the code. So it is apper than import.sys etc.Couldn't find a answer for this. Maybe somen can help me with this? :( - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

I know it's been a long time since this video was created, but I have a problem. In you have showed that how to import file from different location. Every time when I am tryin to do this my program is moving line 'from my_module import find_index, test' at the top of the code. So it is apper than import.sys etc.Couldn't find a answer for this. Maybe somen can help me with this? :(

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:09:18 - 00:21:57
Corey - Making progress with your tutoring.  I'm following this video to import local modules.  The first way using sys.path.append works.  But the second way adding "export PYTHONPATH=..." in bash_profile (as your video ) gives me problems.  As you shown (11:20), import sys, sys.path from Terminal shows an added path.  But the added path doesn't show up in when I run import sys, sys.path from Sublime Text.  Thanks in advance for your help. - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Corey - Making progress with your tutoring. I'm following this video to import local modules. The first way using sys.path.append works. But the second way adding "export PYTHONPATH=..." in bash_profile (as your video ) gives me problems. As you shown (11:20), import sys, sys.path from Terminal shows an added path. But the added path doesn't show up in when I run import sys, sys.path from Sublime Text. Thanks in advance for your help.

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:10:00 - 00:21:57
add module to environment variable (Mac) - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

add module to environment variable (Mac)

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:10:15 - 00:11:40
and I'm with you all the way until  where you use nano in your Mac Terminal.I see why you need to add the directory to the sys path but idk what to use. Windows terminal is saying that 'nano' is not recognized blahblahblah - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

and I'm with you all the way until where you use nano in your Mac Terminal.I see why you need to add the directory to the sys path but idk what to use. Windows terminal is saying that 'nano' is not recognized blahblahblah

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:10:20 - 00:21:57
at - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

at

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:10:38 - 00:21:57
add module to environment variable (window) - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

add module to environment variable (window)

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:11:40 - 00:21:57
for windows user - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

for windows user

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:11:45 - 00:21:57
Excellent video, as always. Made me laugh at around  onwards ... bottom right-hand corner of the Windows desktop ... "This copy of Windows is not genuine". 😎 - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Excellent video, as always. Made me laugh at around onwards ... bottom right-hand corner of the Windows desktop ... "This copy of Windows is not genuine". 😎

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:11:55 - 00:21:57
and timestamp  gave me a deja vu vibe.Thanks for doing this series by the way, it is probably the best series for Python beginners and intermediate programmers who want to learn Python. - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

and timestamp gave me a deja vu vibe.Thanks for doing this series by the way, it is probably the best series for Python beginners and intermediate programmers who want to learn Python.

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:17:05 - 00:21:57
I am watching now in 2020 😀😂 - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

I am watching now in 2020 😀😂

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:17:11 - 00:21:57
os.getcwd - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

os.getcwd

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:18:00 - 00:18:12
os.___file___ gives the directory of the module - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

os.___file___ gives the directory of the module

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:18:12 - 00:21:57
I can't access the standard library on my mac, the way you did at . The library folder does not have frameworks. How do I go about this haha - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

I can't access the standard library on my mac, the way you did at . The library folder does not have frameworks. How do I go about this haha

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:18:35 - 00:21:57
what's that geohash function in the antigravity.py? - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

what's that geohash function in the antigravity.py?

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:19:04 - 00:21:57
Who else read the whole comic @ ? - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Who else read the whole comic @ ?

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:19:50 - 00:21:57
Wait a minute!  At time  you have the library file, but you never show how to open it! - Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library

Wait a minute! At time you have the library file, but you never show how to open it!

Python Tutorial for Beginners 9: Import Modules and Exploring The Standard Library
2017年05月18日 
00:21:56 - 00:21:57

Corey Schafer

※本サイトに掲載されているチャンネル情報や動画情報はYouTube公式のAPIを使って取得・表示しています。

Timetable

動画タイムテーブル

動画数:236件

how to override existing environment variables. (This is new to me) - Python Tutorial: Securely Manage Passwords and API Keys with DotEnv

how to override existing environment variables. (This is new to me)

Python Tutorial: Securely Manage Passwords and API Keys with DotEnv
2024年04月18日  @JorgeEscobarMX 様 
00:10:42 - 00:16:58
the future spoken is my current present. Unless I'm completely desperate, I'm not hitting reddit or google/stack overflow for most roadblocks. - How to Use ChatGPT as a Powerful Tool for Programming

the future spoken is my current present. Unless I'm completely desperate, I'm not hitting reddit or google/stack overflow for most roadblocks.

How to Use ChatGPT as a Powerful Tool for Programming
2023年05月22日  o k t o b e r 様 
00:12:22 - 00:31:08
Good video as always😉  I remember asking that too lol - How to Use ChatGPT as a Powerful Tool for Programming

Good video as always😉 I remember asking that too lol

How to Use ChatGPT as a Powerful Tool for Programming
2023年05月22日  kami 様 
00:28:19 - 00:31:08
@ - pure gold, pure gold! <3 - How to Use ChatGPT as a Powerful Tool for Programming

@ - pure gold, pure gold! <3

How to Use ChatGPT as a Powerful Tool for Programming
2023年05月22日  ulf gjerdingen 様 
00:28:26 - 00:31:08
You almost had me there haha! ChatGPT can be wrong but it certainly wasn't wrong about those top notch resources! I massively appreciate all the uploads and I hope they keep coming supercharged with Chat GPT. Thanks to you, sentdex, techwithtim and Dennis Ivy I now know how to properly code on python, use git for version control and build a functional website. - How to Use ChatGPT as a Powerful Tool for Programming

You almost had me there haha! ChatGPT can be wrong but it certainly wasn't wrong about those top notch resources! I massively appreciate all the uploads and I hope they keep coming supercharged with Chat GPT. Thanks to you, sentdex, techwithtim and Dennis Ivy I now know how to properly code on python, use git for version control and build a functional website.

How to Use ChatGPT as a Powerful Tool for Programming
2023年05月22日  Uj Vag 様 
00:28:42 - 00:31:08
and it's  am here (south east asia), and idk why I'm watching a python tutorial rather than sleeping 😂 - Python Tutorial: Simulate the Powerball Lottery Using Python

and it's am here (south east asia), and idk why I'm watching a python tutorial rather than sleeping 😂

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  X 様 
00:02:49 - 00:38:56
… nice… 😂 - Python Tutorial: Simulate the Powerball Lottery Using Python

… nice… 😂

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  Bartosz Turkowyd 様 
00:04:50 - 00:38:56
I've seen every Python video you've made....   first innuendo. 😜 - Python Tutorial: Simulate the Powerball Lottery Using Python

I've seen every Python video you've made.... first innuendo. 😜

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  Martin Beaudry 様 
00:04:52 - 00:38:56
Man it's  am in India I am lucky to be the first one to hear your voice god bless you brother and an awesome teacher. - Python Tutorial: Simulate the Powerball Lottery Using Python

Man it's am in India I am lucky to be the first one to hear your voice god bless you brother and an awesome teacher.

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  Big Samosa 様 
00:12:15 - 00:38:56
# you can also use the built-in pprint module for pretty printing dictionaries ;) - Python Tutorial: Simulate the Powerball Lottery Using Python

# you can also use the built-in pprint module for pretty printing dictionaries ;)

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  Schoenling Wunderbar 様 
00:25:00 - 00:38:56
it would be very interesting to see if there could be a step function where this algorithm can simulate the increases in jackpot winnings. It’s going to be one in 292+ million of a chance that you hit it at all much less multiple times, but the code should be interesting to see. - Python Tutorial: Simulate the Powerball Lottery Using Python

it would be very interesting to see if there could be a step function where this algorithm can simulate the increases in jackpot winnings. It’s going to be one in 292+ million of a chance that you hit it at all much less multiple times, but the code should be interesting to see.

Python Tutorial: Simulate the Powerball Lottery Using Python
2023年01月10日  20 80 様 
00:27:43 - 00:38:56
A OAuth Django video would be awesome!(Applicable to all sorts of OAuth situations, not just the YouTube API.) - Python YouTube API Tutorial: Using OAuth to Access User Accounts

A OAuth Django video would be awesome!(Applicable to all sorts of OAuth situations, not just the YouTube API.)

Python YouTube API Tutorial: Using OAuth to Access User Accounts
2020年09月10日 
00:07:58 - 00:43:21
At  you move the file and see some blurred miniature version of your open folders in the dock. How did you enable that? - Python YouTube API Tutorial: Using OAuth to Access User Accounts

At you move the file and see some blurred miniature version of your open folders in the dock. How did you enable that?

Python YouTube API Tutorial: Using OAuth to Access User Accounts
2020年09月10日 
00:09:58 - 00:43:21
In case you are getting Error 403 ("access_denied The developer hasn’t given you access to this app") go to the OAuth consent screen and under Test Users add your email by clicking on Add Users.  You should be able to grant access after you've added User. - Python YouTube API Tutorial: Using OAuth to Access User Accounts

In case you are getting Error 403 ("access_denied The developer hasn’t given you access to this app") go to the OAuth consent screen and under Test Users add your email by clicking on Add Users. You should be able to grant access after you've added User.

Python YouTube API Tutorial: Using OAuth to Access User Accounts
2020年09月10日 
00:19:36 - 00:43:21
@corey  So why did you add the join function here, when appending the video id to the list its already a list and its working for me when I pass the vid_ids directly - Python YouTube API Tutorial: Calculating the Duration of a Playlist

@corey So why did you add the join function here, when appending the video id to the list its already a list and its working for me when I pass the vid_ids directly

Python YouTube API Tutorial: Calculating the Duration of a Playlist
2020年06月11日 
00:11:24 - 00:37:38
TypeError: expected string or bytes-like object, I am taking this error in , any idea? - Python YouTube API Tutorial: Calculating the Duration of a Playlist

TypeError: expected string or bytes-like object, I am taking this error in , any idea?

Python YouTube API Tutorial: Calculating the Duration of a Playlist
2020年06月11日 
00:18:50 - 00:37:38
(I love that "Whoops that went too well"-moment at  :D) - Python Tutorial: Real World Example - Using Patreon API and Pillow to Automate Image Creation

(I love that "Whoops that went too well"-moment at :D)

Python Tutorial: Real World Example - Using Patreon API and Pillow to Automate Image Creation
2020年05月11日 
00:35:19 - 00:52:33