Skip to content

Instantly share code, notes, and snippets.

@jonepl
Last active December 13, 2020 22:33
Show Gist options
  • Save jonepl/faa0dc854ac038df60a187753fb0a161 to your computer and use it in GitHub Desktop.
Save jonepl/faa0dc854ac038df60a187753fb0a161 to your computer and use it in GitHub Desktop.

Python Basics

Importing Modules

a.py

def func1(x):
  return x + 5

b.py

import a

def func2():
  sol = a.func1(5) + 10
  print(sol) // Returns 20

What is init.py within module

When a init.py is included within a python package, your app will recongize this as a python package for your app.

You can initial packages within your init.py

Python terminology

Modules - python files with the extension of .py Packages - namespaces which contain multiple packages and modules themselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment