This commit is contained in:
DingZQ
2023-10-27 21:10:15 +08:00
parent 0151fb3424
commit f29047f535

View File

@@ -153,10 +153,12 @@ async def fastapi_dump_inp(network: str, inp: str) -> bool:
# 必须用这个PlainTextResponse不然每个key都有引号
@app.get("/runproject/", response_class = PlainTextResponse)
async def fastapi_run_project(network: str) -> str:
filename = 'lock.simulation'
filename = 'c:/lock.simulation'
if os.path.exists(filename):
print('file exists')
raise HTTPException(status_code=409, detail="is in simulation")
else:
print('file doesnt exists')
f = open(filename, "w")
f.write("locksimulaiton")
f.close()