Skip to content

Commit

Permalink
automatic language detection
Browse files Browse the repository at this point in the history
  • Loading branch information
96-LB committed Dec 19, 2020
1 parent c120bd9 commit 1c4b616
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py → judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

file = sys.argv[1] if len(sys.argv) > 1 else input('Filename?')
problem = input('Problem?')
language = input('Language?').lower()
extension = file.split('.')[-1] if '.' in file else ''
language = extension if extension in ['py', 'java', 'class'] else input('Language?').lower()

def get_args():
if language in ['python', 'py', 'python3', 'py3']:
Expand Down

0 comments on commit 1c4b616

Please sign in to comment.