Go to advanced search

by drifterf
Thu Aug 08, 2019 4:54 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

hi, thanks thats excellent, i cant appreicate your time enough with me on this !!! thanks !!
by drifterf
Thu Aug 08, 2019 4:14 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

sorry one last thing (i promise) the main html page (localhost:port) isit possible to put a better html in this location, if i was to create a html in a web design software and then copy replace the code to the self.write("""<html> part would this show my designed website or can i ask it to read the...
by drifterf
Wed Aug 07, 2019 5:38 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

Hi, thank you so much for your help, i found the issue was actually with the script i was trying to launch. as i was launching server.py with python3 the old script was missing the brackets from the print part of the script i changed the old script from print "door released" to print ("door released...
by drifterf
Wed Aug 07, 2019 4:14 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

Hi, no luck :( all i get now is the following in the terminal when i click something MyOpenDoor_2_Handler.get() WARNING:tornado.access:404 GET /favicon.ico (::1) 3.04ms MyOpenDoor_2_Handler.get() call script opendoor_2.py ERROR:tornado.access:500 GET /opendoor_2 (::1) 3.56ms MyOpenDoor_1_Handler.get...
by drifterf
Tue Aug 06, 2019 6:15 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

- the last line of code is missing tornado.ioloop.IOLoop.current().start() - html code usually has links inside <body>... here goes the page ...</body>. Your page works unexpectedly. - in the Popen, add ", shell=True". Or try using /usr/bin/python which is more precise. - the url mappings contain r...
by drifterf
Tue Aug 06, 2019 5:51 pm
Forum: General discussion
Topic: Large Raspberry Pi Case
Replies: 2
Views: 314

Re: Large Raspberry Pi Case

hi mate, thanks i shall continue custom building. might come up with a set design and see if someone can 3d print i suppose, thanks
by drifterf
Tue Aug 06, 2019 5:49 pm
Forum: General discussion
Topic: Seamonkey Browser
Replies: 1
Views: 228

Seamonkey Browser

Hi, i have done a search on the forum and turned up nothing with regards to installing seamonkey browser on the pi i would like seamonkey on raspbian but i also run ubuntu mate so either would be great. the work devices we use are web based and seamonkey runs its exactly how we cant it. any help ple...
by drifterf
Mon Aug 05, 2019 4:35 pm
Forum: General discussion
Topic: Large Raspberry Pi Case
Replies: 2
Views: 314

Large Raspberry Pi Case

Hi, hope this is in the right section. im looking for a case for a pi 3 thats bigger than the normal one, i want to house some of the relay modules etc inside it. i have been just ordering a containment box and building it with pcb stand off etcs. didnt know if anyone knew of a case that has mounts ...
by drifterf
Sun Aug 04, 2019 3:16 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

no one help with this ? so close but stuck at moment, been trying all day for something im sure is simple :(
by drifterf
Sun Aug 04, 2019 12:43 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

Brackets come in pairs. thank you, im such a dumbass (should of put me contact lenses in lol) this works great now except it dosent launch my .py script in the handler ? it redirects to the page i require but dosent actually launch the .py script (opendoor2.py) import tornado.ioloop import tornado....
by drifterf
Sun Aug 04, 2019 8:45 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

thank you, i now get this error for some reason. have i done something wrong ? File "server.py", line 19 pid = subprocess.Popen["python", "opendoor2.py"]).pid ^ SyntaxError: invalid syntax import tornado.ioloop import tornado.web import subprocess class MainHandler(tornado.web.RequestHandler): def g...
by drifterf
Sun Aug 04, 2019 7:53 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

Hi everyone, sorry to bring my head back up after all your help lol i am getting into the tornado stuff now and starting to understand it a bit more. how would it be possible to open a .html file i have already created when the "Release Door" link is pressed? the current code is below import tornado...
by drifterf
Sun Aug 04, 2019 6:24 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

ok,, i have been messing around and not can get a gpio to trigger from a web button so i will continue to mess around

i would like to thank everyone for the help !
by drifterf
Sat Aug 03, 2019 5:51 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

ok so i forgot to add import subprocess lol but now i get this pi@raspberrypi:~ $ sudo python html.py WARNING:tornado.access:404 GET /favicon.ico (::1) 2.13ms ERROR:tornado.application:Uncaught exception GET /sample (::1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/...
by drifterf
Sat Aug 03, 2019 5:19 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

once again im sorry, i currently now get this when i click the web button with the code i have attached. pi@raspberrypi:~ $ sudo python html.py WARNING:tornado.access:404 GET /favicon.ico (::1) 1.80ms ERROR:tornado.application:Uncaught exception GET /sample (::1) HTTPServerRequest(protocol='http', h...
by drifterf
Sat Aug 03, 2019 4:13 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

thank you once again for helping but im new to this and still confused. could you show me a modified code that would launch a .py on clicking the link. hopefully then i can see what to change and why, thank you again
by drifterf
Sat Aug 03, 2019 11:14 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

thank you for your help again, something like i done below ? i changed this part def post(self): import subprocess self.set_header("Content-Type", "text/plain") self.write("You wrote " + self.get_body_argument("message")) subprocess.run("python3 test1.py", shell=True) import tornado.ioloop import to...
by drifterf
Sat Aug 03, 2019 10:41 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

unfortunately there is the python2-python3 confusion. For python3, install and run with # recommended, as Tornado 6.0 requires Python 3.5.2 sudo pip3 install tornado python3 tornado1.py should of known that lol, much appreciated !! how would i link the "a sample link" button to launch a .py script ...
by drifterf
Sat Aug 03, 2019 10:09 am
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

i get the following error, i have used pip install tornado

sudo python tornado1.py
Traceback (most recent call last):
File "tornado1.py", line 1, in <module>
import tornado.ioloop
File "/home/pi/tornado.py", line 1, in <module>
ImportError: No module named ioloop
by drifterf
Fri Aug 02, 2019 6:09 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Re: Running Python Scripts From A Html

so with the above i can create a html with a link to the .py and it will launch it ?
by drifterf
Fri Aug 02, 2019 4:13 pm
Forum: Python
Topic: Running Python Scripts From A Html
Replies: 36
Views: 1835

Running Python Scripts From A Html

Hi everyone, suppose its a simple enough question, i hope the answer is just as simple lol. so i have a few python scripts on the pi which do differnt things. i want to create a webpage local on the pi (with apache i suppose) that when a simple link is clicked it launchs and runs the script as if yo...
by drifterf
Tue Jul 23, 2019 3:27 pm
Forum: Python
Topic: Update a file from usb with a GPIO button
Replies: 5
Views: 395

Re: Update a file from usb with a GPIO button

this is great, i will have a read through and let you know my results. doing away with the button is even better !
by drifterf
Tue Jul 23, 2019 11:58 am
Forum: Python
Topic: Update a file from usb with a GPIO button
Replies: 5
Views: 395

Re: Update a file from usb with a GPIO button

Hi, this is not a option for this project. i need to put a csv file on a memory stick, take it to the pi, plug in, press a physical button so it copys and overwrites the old file
by drifterf
Mon Jul 22, 2019 5:01 pm
Forum: Python
Topic: Update a file from usb with a GPIO button
Replies: 5
Views: 395

Update a file from usb with a GPIO button

Hi guys. so i have a project which works fine and trying to adapt it a bit. current the pi is running a access control proximity reader through reading a CSV file. accepted codes trigger a pin which fires a relay and opens the automatic gate. we currently goto the pi locally and update the csv file ...
by drifterf
Wed Jul 17, 2019 4:30 pm
Forum: Python
Topic: only read a certain length of a output
Replies: 9
Views: 537

Re: only read a certain length of a output

thank you for the advise :)

Go to advanced search