Skip to content

Instantly share code, notes, and snippets.

@QuantVI
Created May 5, 2020 10:19
Show Gist options
  • Save QuantVI/6f1319a7f0955091a202b2ce99119efd to your computer and use it in GitHub Desktop.
Save QuantVI/6f1319a7f0955091a202b2ce99119efd to your computer and use it in GitHub Desktop.
Python commads that either came in handy or I really like
# Within a Jupyter Notebook
import sys
sys.path.append("C:/somewhere/else/not/in/the/tree/of/this/jpfile")
# Now we can import Windows directories as packages, and refer to Python files within them
# the folder jpyfile need not have an __init__.py file in it
# folders that we import from within jpfile should
from folder_w_in_jpfile import my_modular_code
# folder_w_in_jpfile contains an __init__.py file whihc can be empty
# my_modular_code is a file my_modular_code.py with any other Python code you've written.
# This snippet is for when there are issues with
# adding Jupyter to the Windows PATH variable
# launching Jupyter from a specific folder
# such as when the Jupyter command (in CMD.EXE) is linked to the different version of Python
@QuantVI
Copy link
Author

QuantVI commented May 5, 2020

Trick to remember that I had to use on a virtual machine within scattered permissions.

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