Пример #1
0
def main():
  command_configs = {
    '-t': {
      'longInputForm': '--target',
      'field': 'target',
    },
    '-i': {
      'longInputForm': '--input-file-label',
      'field': 'input_file_label',
    },
  }
  commands = parse_commands(sys.argv[1:], command_configs)
  if commands.target == 'hw5':
    hw5.run_all(commands)
  elif commands.target == 'project':
    project.run(commands)
  else:
    target_list = ['hw5', 'project']
    raise RuntimeError(
      'Please select "target" among these list: ' + target_list)
Пример #2
0
async def handle_project(request):
    json = request.json
    res = {"x": '0.5', "y": '0.5'}
    try:
        res = project.run(json['view'])
        res['x'] = str(res['x'])
        res['y'] = str(res['y'])
    except:
        print("-")
    # sanic的json dumps int有bug,需提前转为str
    return response.json(res)
Пример #3
0
import project

if __name__ == "__main__":
    project.run()
Пример #4
0
from flask import Flask
import project
project = Flask(project)
project.run(port=5000, debug=True)