forked from just-chillin/ImageRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
36 lines (29 loc) · 927 Bytes
/
Main.py
File metadata and controls
36 lines (29 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import json
import os
from Webserver import app
config = json.load(open('config.json'))
def prompt_user():
"""
Prompts the user for a language and an image file
:return: The path to the image file, and the language
"""
# Prompt the user for a language
print("Welcome to ImageRunner")
path = 'js_code.png'
language = 'js'
# path = input("Please enter the path to the image: ")
# language = input("Please enter the programming language: ")
return path, language
def cli_main():
"""
The entry point if you decide to run this on the command line. Currently not used
:return: None
"""
image, language = prompt_user()
settings = config[language]
extension = settings["extension"]
run_image(image, language)
os.system(settings["interpreter"] + " .tmp." + extension)
if __name__ == '__main__':
from OCR import run_image
app.run(debug=True)