Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » to execute executable.py from view.py [RSS Feed]

#1 Dec. 29, 2010 19:25:46

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

to execute executable.py from view.py


I would like by using

#in views.py

<code>
def myfnc():
subprocess.Popen( '/polls/executable.py', executable='/usr/lib/
python')
<code>


execute executable.py from views.py function.

I am getting error that terminal is already taken. This is true -
django manage.py runserver keeps django webpages ON.

Is it possible to run paralelly python subprocess.Popen(....) ?

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 3, 2011 23:12:13

g.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

to execute executable.py from view.py


One more related question.

Is it possible to use string in views.py as a function ( string from
textarea (in search.html ))

i.e.
# search.html
<form>
<texarea name=''q" value={{query.0 | escape }}> input function name </
textarea>
<input type="submit", value="press", name="button1">
</form>

this search.html after being registered in urls.py shows input text
area.
I prompt to write the name of function.

I get this name as string in views.py in function def
search2(request):
query=request.GET.get('q',' ' )
i would like now to run this function, which was written in textarea,
i.e to run function Word.objects.all()

One of ways is to use Sqlite cursor and execute strings.
Another way is to use case type structure, which match function name
in string with function name in cases.

How to run this function, which was written in textarea as string,
without sqlite and case structures?

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » to execute executable.py from view.py [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support