Skip to content

Instantly share code, notes, and snippets.

@apzentral
Last active February 2, 2024 16:41
Show Gist options
  • Save apzentral/6663123689e2ed75a987979b7a4b30ea to your computer and use it in GitHub Desktop.
Save apzentral/6663123689e2ed75a987979b7a4b30ea to your computer and use it in GitHub Desktop.
Python: starting script for Jupyter
# -*- coding: utf-8 -*-
"""
Summary:
"""
from IPython.display import display, HTML
import inspect
import logging
import os
import pandas as pd
import pathlib
import sys
logging.basicConfig(
format="[%(asctime)s.%(msecs)03d] [%(levelname)s] %(module)s:%(lineno)d - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
CURRENT_FILE_NAME = inspect.getfile(inspect.currentframe())
CURRENT_DIR = os.path.dirname(os.path.abspath(CURRENT_FILE_NAME))
CURRENT_FILE_DIR = pathlib.Path(os.path.abspath("")).parent.resolve()
PARENTDIR = os.path.dirname(CURRENT_DIR)
sys.path.insert(0, PARENTDIR)
sys.path.insert(0, CURRENT_FILE_DIR)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
pd.options.display.max_columns = None
pd.set_option("display.max_rows", None)
logger.info("loaded packages successfully")
@apzentral
Copy link
Author

If you are using VSCode and Jupyter Notebook not working right. Please check this plug in, Dependency Analytics if it is enabled. This might cause the issue.

https://stackoverflow.com/questions/69791612/vscode-jupyter-notebook-syntax-highlighting-and-autocompletion-stopped-working

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