Hello,

With the below code I was able to compile and run my c programs that were
uploaded, where rfile and ofile are input and output files.

for submission in submissions:
subprocess.call(["gcc","C:\\web2py\\applications\\dropbox1\\uploads\\"+submission.file,"-o","x"])
subprocess.call(["./x"], stdin=rfile,stdout=ofile)

In the similar way I want to compile and run the Java programs with
subprocess.call.

On Wed, Jul 8, 2015 at 2:39 PM, Dave S <[email protected]> wrote:

>
>
> On Wednesday, July 8, 2015 at 5:53:40 AM UTC-7, reddyreddy wrote:
>>
>> hello all,
>>
>> I want to write a script to compile and run java programs that were
>> uploaded.
>> Iam trying to do it with subprocess.call.
>> Can anyone please help.?
>>
>
> What exactly are you having problem with?   Your question could be a
> little more detailed.
>
> Is the Python documentation unclear?
> <URL:https://docs.python.org/2/library/subprocess.html#module-subprocess>
>
> I think you said before that you were working on Windows, so perhaps this
> example will give you a leg up:
>
>     try:
>       addrs_verbose = subprocess.check_output( \
>         ["wmic", "nicconfig", "list", "brief"])
>     except subprocess.CalledProcessError as e:
>       print e.returncode
>       print e.output
>       addrs_verbose = ""
>     print addrs_verbose
>
>
> If you still can't get where you're going, show us what you've tried, or
> ask about the specific issue you can't figure out.
>
> /dps
>
>
>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Chaitanya Pochampally

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to