Skip to content

Instantly share code, notes, and snippets.

View ZhipengHe's full-sized avatar
💯

Zhipeng He ZhipengHe

💯
View GitHub Profile
#! /usr/bin/python
import dota2api
from dota2api.src.exceptions import APIError, APITimeoutError
import csv
from multiprocessing import Pool
import time
import sys
def getMatchInfo( api, matchId ):
@JungeAlexander
JungeAlexander / import-package-from parent.py
Created November 27, 2014 17:22
Import modules from parent folder in Python
# From http://stackoverflow.com/a/11158224
# Solution A - If the script importing the module is in a package
from .. import mymodule
# Solution B - If the script importing the module is not in a package
import os,sys,inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)