I was able to write a script which can compile and run c programs with simple name like hello.c. But the problem is Iam not sure how can I refer the files that were saved with random names in uploads folder, for execution.
Here is my code.
import time
import subprocess
while True:
rows = db(db.student.status=='pending').select()
ofile = open('C:\\web2py\\applications\\newdropboxmultiupload\\cache\\temp\\hellonewtest.out', 'w')
for row in rows:
#subprocess.call(["gcc","C:\web2py\hello.c","-o","x"])
subprocess.call(["./x"], stdout=ofile)
row.update_record(status='executed')
db.commit()
time.sleep(60) # check every minute
ofile.close()