the "user" for web2py depends on how you launch it... if you call:
python web2py.py then it runs as you if you: sudo su bob python web2py.py it runs a bob. if you use apache or some other server i believe by default it runs as the user that is running apache. On Thursday, March 14, 2013 8:41:25 PM UTC-7, The Organisation of Secret Shoppers wrote: > > hmm how do i check? i think running the python script has to be "root" > user? but i'm not sure what is the user type for the web2py... > > > On Thu, Mar 14, 2013 at 4:24 PM, Niphlod <nip...@gmail.com > <javascript:>>wrote: > >> did you check that the user running your "working" script is the same as >> the one running the "I'm going wrong" web2py ? >> >> >> On Thursday, March 14, 2013 8:30:38 AM UTC+1, theoffi...@gmail.com wrote: >>> >>> Hello guys, >>> >>> >>> i hope someone can help me with this! i have been stuck here for days. I >>> just created a web app using web2py and i want to use it to send some >>> serial commands to a device through Raspberry Pi. >>> >>> I have successfully sent the commands from R-Pi to the device by running >>> a Python script in the terminal. >>> >>> But i thought web2py is using python as well so i did something similar >>> but i get the error below: >>> *<class 'serial.serialutil.SerialException'> could not open port >>> /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'* >>> >>> >>> my codes are: >>> >>> in Controller: >>> >>> >>> def test(): >>> >>> import serial >>> >>> serialport= serial.Serial("/dev/ttyAMA0", 9600, timeout=0.5) >>> >>> return dict() <-- not sure what to return >>> in view/default/index.html: >>> >>> <a href = "{{=URL >>> <https://10.0.0.132/examples/global/vars/URL>(c='default', >>> f='test')}}"><img src ="/Comfort2/static/images/off.**jpg" width ="75" >>> height="75"</a> >>> >>> >>> i created a default/test.html as well. >>> >>> >>> i have no idea what's wrong! :( give me some hints please. thank you! >>> >> -- >> >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "web2py-users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/web2py/tiWZkXMoo6E/unsubscribe?hl=en. >> To unsubscribe from this group and all its topics, send an email to >> web2py+un...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.