Go to advanced search

by timhoffman
Fri Jul 26, 2013 7:13 am
Forum: Python
Topic: Multiple GPIO.add_event_detect, one callback function
Replies: 18
Views: 31481

Re: Multiple GPIO.add_event_detect, one callback function

And remember to substitute those '=' for '==' in the comparison.
by timhoffman
Wed Jul 24, 2013 8:36 am
Forum: Python
Topic: 'Live' display of file
Replies: 5
Views: 1047

Re: 'Live' display of file

Most USB Barcode scanners can be configured for a couple of different modes of operation. One mode is keyboard or HID mode, it just looks like a keyboard I assume thats the mode your currently using. another way is USB serial mode. If you can switch it to that mode then a background process can just...
by timhoffman
Fri Jul 12, 2013 1:42 pm
Forum: Gaming
Topic: STICKY: MAME4ALL for Pi
Replies: 435
Views: 198378

Re: MAME4ALL for Pi

Hi

I tried pressing tab, and changing settings by mashing everything on the joystick and never got anything recorded. I will have another look at this.

Thanks for the reply

Cheers

Tim
by timhoffman
Fri Jul 12, 2013 10:04 am
Forum: Gaming
Topic: STICKY: MAME4ALL for Pi
Replies: 435
Views: 198378

Re: MAME4ALL for Pi

Hi

Trying out mame4all. Should a PS3 (sixaxis) work via USB with mame4all.

The device is created /dev/input/js0
jstest works.
I can read the joystick via pygame.

However no matter what I do I can't seem to get any response when running mame4all.

Any one done it ?

Cheers

Tim
by timhoffman
Tue Jul 09, 2013 3:39 pm
Forum: Python
Topic: UnicodeDecodeError
Replies: 3
Views: 1393

Re: UnicodeDecodeError

Hi

I think you will get a lot of value out of reading this article on handling unicode

http://blog.notdot.net/2010/07/Getting- ... -in-Python
by timhoffman
Mon Jun 24, 2013 8:38 am
Forum: Python
Topic: urllib2
Replies: 26
Views: 7230

Re: urllib2

You should always include the error, then we are more likely to be able to answer.,
by timhoffman
Thu Jun 13, 2013 11:31 am
Forum: Python
Topic: problems setting up socket communication
Replies: 6
Views: 1846

Re: problems setting up socket communication

Actually 0.0.0.0 is perfectly valid. It means listen on all IPv4 interfaces. Though it may not be valid with tornado for some reason. Given your starting out, any particular reason you chose tornado rather than just using HTTPServer (I know in the long run you wouldn't use it.) You might find it as ...
by timhoffman
Wed Jun 12, 2013 12:22 am
Forum: Python
Topic: Python/SSL problems
Replies: 2
Views: 1801

Re: Python/SSL problems

What os/version have you installed?

Current/recent raspbian all have 2.7.3 installed by default
by timhoffman
Tue Jun 11, 2013 11:02 am
Forum: Python
Topic: how to run a subprocess as another user?
Replies: 11
Views: 4034

Re: how to run a subprocess as another user?

Have a look at the error VLC is giving. Its says it can't find a DBus session as it has no $DISPLAY variable set. You need to set up your environment so that DISPLAY is set, when you invoke vlc. when you run the initial task under sudo DISPLAY won't be set. So set DISPLAY in os.environ before runnin...
by timhoffman
Tue Jun 11, 2013 1:06 am
Forum: Python
Topic: how to run a subprocess as another user?
Replies: 11
Views: 4034

Re: how to run a subprocess as another user?

Ok, I got it wrong you should have been using setreuid. Here is an example First the toplevel - this would do the GPIO run with sudo t1.py import os import subprocess print "Parent UID",os.getuid() subprocess.call(["python","t2.py"]) print "Done" The second subprocess, this would run vlc t2.py impor...
by timhoffman
Mon Jun 10, 2013 11:07 am
Forum: Python
Topic: how to run a subprocess as another user?
Replies: 11
Views: 4034

Re: how to run a subprocess as another user?

Hi I would try a couple of approaches both use os.seteuid(euid) or a varient 1. Try calling seteuid just before launching vlc via subprocess, then set the effective id back to the original (;ast step may bot be necessary) 2 Use subprocess to run another python script which then uses os.seteuid(euid)...
by timhoffman
Sun Jun 09, 2013 9:51 am
Forum: Python
Topic: Python Loop
Replies: 3
Views: 800

Re: Python Loop

I would consider using interrupts rather than a busy wait loop.

Have a look at this article http://raspi.tv/2013/how-to-use-interru ... d-rpi-gpio
by timhoffman
Sat May 18, 2013 1:42 pm
Forum: Python
Topic: SyntaxError: expected path separator ([)
Replies: 8
Views: 1561

Re: SyntaxError: expected path separator ([)

Check and see if you have lxml installed on your desktop. Your XML parsing may be devolving to elementree without lxml present and hence the error.
by timhoffman
Fri May 17, 2013 1:42 am
Forum: Python
Topic: Need help installing Peewee ORM for Python
Replies: 3
Views: 2002

Re: Need help installing Peewee ORM for Python

You need to install setuptools

Code: Select all

sudo apt-get install python-setuptools
by timhoffman
Fri May 17, 2013 1:11 am
Forum: Python
Topic: SyntaxError: expected path separator ([)
Replies: 8
Views: 1561

Re: SyntaxError: expected path separator ([)

Check you are using the same version of python on the working machine.
by timhoffman
Wed May 01, 2013 11:15 am
Forum: Python
Topic: Artificial Intelligence
Replies: 10
Views: 3216

Re: Artificial Intelligence

Some things to look at

NLTK Natural Language Toolkit if you want to start parsing natural language.

google will to parse spoken language to text - http://translate.google.com/#en
by timhoffman
Wed May 01, 2013 10:23 am
Forum: Python
Topic: error in pysubnettree
Replies: 2
Views: 679

Re: error in pysubnettree

You don't have all the files for compiliing python libs.

sudo apt-get install python-dev
by timhoffman
Tue Apr 30, 2013 1:50 pm
Forum: Python
Topic: Reading mouse events console/terminal
Replies: 7
Views: 10676

Re: Reading mouse events console/terminal

Oh and check out this thread on stackoverflow

http://stackoverflow.com/questions/4855 ... n-in-linux
by timhoffman
Tue Apr 30, 2013 1:45 pm
Forum: Python
Topic: Reading mouse events console/terminal
Replies: 7
Views: 10676

Re: Reading mouse events console/terminal

Another approach is to look at the curses lib http://docs.python.org/2/library/curses.html which definately doesn't require a screen (designed for tty's) , and has mouse support
by timhoffman
Mon Apr 29, 2013 11:31 am
Forum: Python
Topic: Reading mouse events console/terminal
Replies: 7
Views: 10676

Re: Reading mouse events console/terminal

Hi

Have a look at https://github.com/SavinaRoja/PyUserInput

Is cross platform.

If you need to do some thing always look on PyPi to see if it's already been done for you ;-)

Cheers

Tim
by timhoffman
Wed Apr 24, 2013 12:53 pm
Forum: Python
Topic: How to display one TTY while forwarding input to another.
Replies: 3
Views: 742

Re: How to display one TTY while forwarding input to another

is your USB RFID reader acting has a HID (input device) or a serial port? In both cases you should be able to use a python USB lib (or any other language) to get the incoming data directly from the USB device. You should probably procide a bit more detail on how you are connecting things up. I don't...
by timhoffman
Sun Apr 14, 2013 11:50 am
Forum: Python
Topic: PRINT function details
Replies: 2
Views: 621

Re: PRINT function details

Hi Unfortunately this is one area where python 2.x and 3.x differ. in python 3 if you want to suppress the newline you need to specify the "end" to use ie >>> print("Foot",end="") help tells us >>> help(print) Help on built-in function print in module builtins: print(...) print(value, ..., sep=' ', ...
by timhoffman
Sun Apr 14, 2013 11:38 am
Forum: Python
Topic: Threading - Pausing thread1 while thread2 starts
Replies: 1
Views: 528

Re: Threading - Pausing thread1 while thread2 starts

HI If you must use threads (I am not sure you do need them), consider changing your model to use a primary thread and a synchronized queue, to send messages to a another worker thread waiting/blocked on messages. That way whenever you want the LCD to change it's display send it a message (the text f...
by timhoffman
Sun Apr 14, 2013 11:13 am
Forum: Python
Topic: ds18b20 send multiple sensor data to Cosm
Replies: 24
Views: 13341

Re: ds18b20 send multiple sensor data to Cosm

Hi I log multiple arduino feeds via my raspi to cosm. I find it much easier to use eeml and post directly rather than shelling out to curl. You can see example code here which is feeding multiple different temps. https://bitbucket.org/zutesmog/securitynode/src/c577d6bd5a1e80f49fcc0ef80b061a44f988022...
by timhoffman
Sun Apr 07, 2013 9:57 am
Forum: Python
Topic: Raspberry Pi server access
Replies: 7
Views: 1094

Re: Raspberry Pi server access

Given what has gone before, you have connectivity and you can contact the http server.
So now you need to look at your code. How are you connecting to the mac with your raspi,
are you using requests library or httplib for instance.

Maybe show us you code .

T

Go to advanced search