Was looking at this link
https://www.geeksforgeeks.org/python-subprocess-module-to-execute-programs-written-in-different-languages/
and
am trying to translate it into Django.
Upon form submission from index.html in templates, I want to call the view
function to run HelloWorld.java (in same
t the CELERY_RESULT_BACKEND
Avraham
On Fri, Jan 13, 2017 at 10:44 AM, Patricia Infante
wrote:
> Hi everyone! I put Celery in my Django app so that the two other python
> programs can process the input from my Django app via doing subprocess
> method.
> My question is how do I access the output fr
Hi everyone! I put Celery in my Django app so that the two other python
programs can process the input from my Django app via doing subprocess
method.
My question is how do I access the output from the subprocess? Back then
when I made just a python program, I access the log files (output from
ine.sh'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
Then pass in the input and read the output
(stdoutdata, stderrdata) = p.communicate()
Then save the data, e.g. in a field of your instance
instance.processed_data = stdoutdata
I suggest you first make sure to get the call to the subprocess
On 26/03/2016 1:05 AM, Joshua Valdez wrote:
I'm very new to django
Sorry I didn't pay attention to this part of your question ...
To amplfy my response, this is the sort of thing I would do in the save
method of the model:
from wherever import run_pipeline
class Query(models.Model):
..
On 26/03/2016 1:05 AM, Joshua Valdez wrote:
Okay, so I have figured out that the subprocess is the module that I
want to use in this context and I have tried implementing some simple
code based on the documentation but I am getting an
|ExceptionType:OSErrorExceptionValue:[Errno2]Nosuch file or
Okay, so I have figured out that the subprocess is the module that I want
to use in this context and I have tried implementing some simple code based
on the documentation but I am getting an
Exception Type: OSErrorException Value: [Errno 2] No such file or
directoryException Location
some one put in contab -e
** * * * * systemctl resetart httpd*
means that every minute the apache server is restarting and killing
everything. that's why non of the script where working =(
now that I commented that line from cron tab its working =).
--
You received this message b
> On Jun 5, 2015, at 8:44 AM, dk wrote:
>
> I created a website that can reboot a machine. basically subprocess a script
> that lunch the reboot command in Linux.
> after that I need to run some other operations. after that I wait 1 minute
> before start pinging the mac
31:02.046665 2015] [:error] [pid 33304] sleeped for 60secs[Fri Jun 05
> 16:31:02.046702 2015] [:error] [pid 33304] 6*
>
> why is shutting down gracefully, what does it mean? that killed to
> process? why?can this be happening to my subprocess?
>
> --
> You received this
Fri Jun 05
16:31:02.046665 2015] [:error] [pid 33304] sleeped for 60secs[Fri Jun 05
16:31:02.046702 2015] [:error] [pid 33304] 6*
why is shutting down gracefully, what does it mean? that killed to
process? why?can this be happening to my subprocess?
--
You received this message becau
I created a website that can reboot a machine. basically subprocess a
script that lunch the reboot command in Linux.
after that I need to run some other operations. after that I wait 1 minute
before start pinging the machine to see if its back online.
the funny thing my script doesn't
found 2 things happening, some one move the file, second of all the
subprocess stdout spits a tuple of tuples =( (that was trick thing to find.)
thanks guys.
On Tuesday, March 31, 2015 at 2:03:08 PM UTC-5, JirkaV wrote:
> It's very likely that the actual user running the webserver pr
ooglegroups.com
Subject: Re: subprocess behave diferent in the server than in the client.
playing a littlie bit more, I found out that does work if I am using the
manage.py runserver.
but doesn't work using the production django =(.
On Monday, March 30, 2015 at 5:53:59 PM UTC-5, dk wrote:
>
g the production django =(.
On Monday, March 30, 2015 at 5:53:59 PM UTC-5, dk wrote:
hi, I have a button in my webpage that lunch a subprocess and
check the ping of the computer and save the information in a text
file. that's it, very basic stuff.
If I am doing my click in
playing a littlie bit more, I found out that does work if I am using the
manage.py runserver.
but doesn't work using the production django =(.
On Monday, March 30, 2015 at 5:53:59 PM UTC-5, dk wrote:
> hi, I have a button in my webpage that lunch a subprocess and check the
>
hi, I have a button in my webpage that lunch a subprocess and check the
ping of the computer and save the information in a text file. that's it,
very basic stuff.
If I am doing my click in the server computer everything works,
the subprocess will ping the computer, make the file and sav
On Tue, Mar 11, 2014 at 8:07 PM, Shawn Milochik wrote:
>
> I tried to circumvent the entire problem by adding an "if __name__ ==
> '__main__'" block to the script and having it take a command-line argument
> via argparse and print the desired output. Then I did a
> subprocess.check_output call on
amount of memory required, but I'm
pretty sure this script isn't consuming much memory. Even when it's not
running ls, it's just doing a subprocess call to gpg to sign and encrypt a
file. It takes well under one second.
Thanks for looking at it.
Shawn
--
You received this message
On Wed, Mar 12, 2014 at 2:06 AM, Shawn Milochik wrote:
> Hi everybody. I have a weird problem. I have a small script that does a
> subprocess call. It works. It works when run via iPython. It blows up when
> run in manage.py shell or under Django with OSError: [Errno 12] Cannot
> all
On Tue, Mar 11, 2014 at 9:24 PM, Nick Santos wrote:
> Hey Shawn,
>
> What does your web stack and environment look like? If it's failing during
> a fork with an out of memory, that makes me wonder if the host process for
> django is consuming a chunk of memory for some reason, and when it gets
>
On Tue, Mar 11, 2014 at 9:06 PM, Drew Ferguson wrote:
> Hi
>
> Could your problem be some SELINUX issue?
>
> Perhaps disable SELINUX temporarily and see if the problem persists.
>
>
How would selinux cause the problem to only happen under certain
conditions? I don't think it's running. Based on th
of memory required,
> but I'm pretty sure this script isn't consuming much memory. Even when
> it's not running ls, it's just doing a subprocess call to gpg to sign
> and encrypt a file. It takes well under one second.
>
> Thanks for looking at it.
> Shawn
>
-
e were no answers
> other than directly addressing the amount of memory required, but I'm
> pretty sure this script isn't consuming much memory. Even when it's not
> running ls, it's just doing a subprocess call to gpg to sign and encrypt a
> file. It takes well under one
Hi everybody. I have a weird problem. I have a small script that does a
subprocess call. It works. It works when run via iPython. It blows up when
run in manage.py shell or under Django with OSError: [Errno 12] Cannot
allocate memory. Does anyone have any idea on how to fix this?
It'
ate import RequestContext
from subprocess import Popen, PIPE, sys
import subprocess
def ex(request):
myName = 'Pervez'
if 'firstname' in request.POST:
myName = (request.POST['firstname'])
p =
Popen(['/home/pervez/Desktop/simplepage/simpl
Hi all, please, i need your help.
I use suprocess module, executing 'stockfish' uci engine, like: engine =
subprocess.Popen('stockfish', stdin=subprocess.PIPE, stdout=subprocess.PIPE)
My module use opened subprocess receiving some information from Django's
form, for
> > p = subprocess.Popen(args=[("%s %s") % (script_name,command_args1)],
>
> Sorry to pick on something seemingly inconsequential, but this really
> riles me. If you launch a subprocess using a string like "command arg1
> arg2 arg3", then you force the OS to do
On Thu, Mar 1, 2012 at 11:42 AM, Sébastien Billion
wrote:
> Hi,
>
> You can try something like that:
>
> p = subprocess.Popen(args=[("%s %s") % (script_name,command_args1)],
Sorry to pick on something seemingly inconsequential, but this really
riles me. If you launch a
Hi,
You can try something like that:
p = subprocess.Popen(args=[("%s %s") % (script_name,command_args1)],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
output = p.stdout.readlines()
p.wait()
2012/3/1 dummyman dummyman
> Hi ,
>
> i am using django s view function to invoke py*t
Hi ,
i am using django s view function to invoke py*thon script* to run in
background.
now i want to pass command line args to the script
here is wat i did
subprocess.Popen([sys.executable,"script_name","command_args1"])
i got the error
execv requires arg 2 to be a string
please help me
--
On Sat, Jan 28, 2012 at 12:05 AM, Mark Lancaster
wrote:
> I'm having problems running subprocess inside a django view using:
>
> result = subprocess.Popen([ , ],
> stdout=subprocess.PIPE).communicate()[0]
>
> exactly the same method works perfectly inside a regular python
As the same user? Are you running with manage.py runserver? Generally it is a
bad idea to call subprocess from a web process context. A blocking call you
don't expect might time out the client and/or hang your server.
Check out Django-celery. Create a tasks.py and have your view call a
On 27 янв, 20:05, Mark Lancaster wrote:
> I'm having problems running subprocess inside a django view using:
>
> result = subprocess.Popen([ , ],
> stdout=subprocess.PIPE).communicate()[0]
>
> exactly the same method works perfectly inside a regular python
> script.
&g
I'm having problems running subprocess inside a django view using:
result = subprocess.Popen([ , ],
stdout=subprocess.PIPE).communicate()[0]
exactly the same method works perfectly inside a regular python
script.
Should I be using a different method to initiate a script?
Thanks
--
r switching Apache from mpm-prefork to mpm-worker, using
subprocess in my (Django) Python WSGI application raises the following
exception after hanging for a couple of time:
IOError at /
[Errno 4] Interrupted system call
The call in question is:
out = check_output(['sudo', 'quot
Hello,
I have a problem calling subprocess.Popen from a view:
The view that calls subprocess.Popen is not displayed until the
subprocess finishes.
The server send "200 OK" immediately, but not the content of the page.
My question is: Is this a limitation of Django's development
Hello Kenneth,
Thank you for your suggestion. This was helpful to remove a sort of
redundancy in my program but removal of '\' still does not solve my
problem as the Error displayed remains exactly the same.
Any other suggestions?
Once again thank you so much for your valuable time.
Regards.
On Monday 22 Dec 2008 4:21:31 pm Anurag wrote:
> comd = [\
> "tar -xf x.tar.gz", \
nothing to do with python:
[law...@localhost programs]$ tar -xf x.tar.gz
tar: x.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
btw, there is no need to put '\' wh
a few command line in a pipe and I have written the script (a
> short
> one) as follows. I would later also like to import this application to
> Django.
>
> #!/usr/bin/python
>
> import cgi, string, os, sys, cgitb, commands, subprocess
> import posixpath, macpath
>
the script (a
short
one) as follows. I would later also like to import this application to
Django.
#!/usr/bin/python
import cgi, string, os, sys, cgitb, commands, subprocess
import posixpath, macpath
#file = "x.tar.gz"
#comd = "tar -xf %s" % (file)
#os.system(comd)
#command
Hello,
I don't know much about networking. I keep getting a connection
interrupted error page when I start a thread which runs the python
subprocess popen method: "proc = subprocess.Popen(command, shell=True,
stdout=subprocess.PIPE)".
After starting this thread my function retu
42 matches
Mail list logo