floydwch / kaggle-cli

(Deprecated, use https://github.com/Kaggle/kaggle-api instead) An unofficial Kaggle command line tool.
MIT License
674 stars 91 forks source link

Send submission and get score from python code directly #54

Closed miguelgfierro closed 6 years ago

miguelgfierro commented 6 years ago

Hi,

The command line program works for me to do a submission to kaggle. However, I would like to get the result this submission made on the leaderboard.

Is there an easy way to do this?

floydwch commented 6 years ago

Splitting the functionality to a core API is cool, but in the meanwhile you can use subprocess to execute Kaggle-cli from your Python code and get the result.

miguelgfierro commented 6 years ago

Thanks

AwasthiMaddy commented 6 years ago

An easy/naive way to do this -

# Submit the submission on Kaggle
# subPath is submission file path
import os
cmd = 'kg submit '+subPath+' -u <your kaggle account username> -p <your kaggle passwd> -c <competition name>' #-m+msg
os.system(cmd)