Created
February 22, 2018 12:35
-
-
Save pjankiewicz/5d1f4a142dc23f65badcf4cbe67af0d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gzip | |
import base64 | |
import os | |
import sys | |
sys.path.append('/kaggle/working') | |
# this is base64 encoded source code | |
file_data = {...} | |
os.system('mkdir mercari') | |
for fn, encoded in file_data.items(): | |
print(fn) | |
with open('mercari/' + fn, 'wb') as out: | |
out.write(gzip.decompress(base64.b64decode(encoded))) | |
with open('setup.py','wt') as out: | |
out.write(""" | |
from setuptools import setup | |
setup( | |
name='mercari', | |
packages=["mercari"], | |
) | |
""") | |
def run(command): | |
os.system('export PYTHONPATH=${PYTHONPATH}:/kaggle/working && ' + command) | |
run('python setup.py develop --install-dir /kaggle/working') | |
run('python mercari/main.py') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment