Skip to content
 
 

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Modules and Packages Tutorial

Summary of steps to complete

  • Fork this repository so you have your own copy to work on.
  • Clone the repository on your local machine.
  • Create .py files from the tutorial in your repository.
  • Push your new files to your GitHub repository.
  • Submit a link to this GitHub repository in Canvas.

Fork & Clone this repository

  • We did this in a previous assignment. Instructions are here: https://github.com/cmcntsh/exerGitPractice
  • This can also be done directly in VSCode
    • Create a new folder on your machine where you want to put this repository if you don't already have one you want to use.
    • Copy the Clone or Download path for this repository from GitHub.
    • In VSCode from the command pallette (Ctrl-Shift-P) run Git: Clone
    • Paste the path into the path field which pops up
    • Select your new folder you created on your machine
    • A new folder for the repository with the repository files should be in the folder you selected showing in the Explorer window in VSCode on the left side.

Create Python .py files

  • Go through the tutorial at https://realpython.com/python-modules-packages/
  • Create the 2 .py files described in the tutorial in your repository.
    • mod.py (The version which generates some output when run as a script by using the dunder variable name about half way through the tutorial.)
    • fact.py
  • Create a .py file named importer.py.
    • Have importer.py import the sys module.
    • Have importer.py print sys.path.
    • Have importer.py import the mod.py module.
    • Have importer.py import the fact.py module.
    • Have importer.py print the location of mod.py.
    • Have importer.py print the location of fact.py.

Push your updated file to your GitHub repository

  • This can be done in VSCode.
    • In VSCode click on the Source Control button.
    • You should see the files that had changes. (Mine has the original file which shows an M next to it and a new file which says checkpoint in the name. You really only need to push the original file, but if you push both it shouldn't hurt anything.)
    • Hover over the changed file. Click the + sign to stage the change.
    • Enter a commit message in the message field and click the checkmark to commit the change.
    • Click on the 3 dots for more actions and select Sync. This will push the updated file to your GitHub repository.
    • Submit the link to your GitHub repository on Canvas.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages