[Pythonmac-SIG] Virtual Serial/USB Port

2009-04-11 Thread Stuart Davenport
Hi all,
I am trying to write a python program to "emulate" a USB GPS device on my
Mac, is there anyway this is possible via Python?

Basically I have something running over the network to tell my Mac its GPS
location. The application I have running is listening to the data from the
network and then I want that data be pushed onto a "virtual" USB GPS device.
The data I will send out of it will be the standard NMEA data for any
navigation software on a Mac (e.g. RouteBuddy) to read.

Would anyone know how to create this "virtual port" through python?

Thanks
Stu
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Problem with py2app and pygame on OS X Leopard (10.5.6)

2009-04-11 Thread Michael Sanders
I can't seem to get py2app to work with pygame. I'm testing by just trying
to compile a simple hello world app:  .

> '''A simple app that displays "Hello, world!" the title bar of its
> window.'''

import pygame


> quit = False

pygame.init()

screen = pygame.display.set_mode((640, 480))

pygame.display.set_caption('Hello, world!')


> while not quit:

pygame.event.pump()

for event in [pygame.event.wait()] + pygame.event.get():

if event.type == pygame.QUIT: quit = True


I ran py2applet --make-setup hello_world.py to make the setup.py, and it
looks like this:

"""

 This is a setup.py script generated by py2applet


> Usage:

python setup.py py2app

"""


> from setuptools import setup


>  APP = ['hello_world.py']

DATA_FILES = []

OPTIONS = {'argv_emulation': True}


setup(

app=APP,

data_files=DATA_FILES,

options={'py2app': OPTIONS},

 setup_requires=['py2app'],

)


Running "python setup.py py2app" now seems to work fine with no errors,
however, when I run the app I get this error message:

hello_world Error

"An unexpected error has occured during execution of the main script



ImportError: PyObjC 1.2 or later is required to use pygame on Mac OS X.
> http://pygame.org/wiki/PyObjC




(Leopard comes with PyObjC 2.0 and I haven't uninstalled it.)

If I run "python setup.py py2app -A", I get:

hello_world Error

"An unexpected error has occured during execution of the main script



ImportError: No module named pygame


Any ideas on how to fix this? This app runs fine on my machine by running
"python hello_world.py", and py2app seems to work with another test app I
tried using pyglet.
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Virtual Serial/USB Port

2009-04-11 Thread Kevin Horton

On 11 Apr 2009, at 13:38, Stuart Davenport wrote:

I am trying to write a python program to "emulate" a USB GPS device  
on my Mac, is there anyway this is possible via Python?


Basically I have something running over the network to tell my Mac  
its GPS location. The application I have running is listening to the  
data from the network and then I want that data be pushed onto a  
"virtual" USB GPS device. The data I will send out of it will be the  
standard NMEA data for any navigation software on a Mac (e.g.  
RouteBuddy) to read.


Would anyone know how to create this "virtual port" through python?



I'm not sure I completely understand what you want to achieve, but it  
might be worth looking at the python code in the gpsd package of  
programs.  One of those programs, possibly gpsfake, may either do what  
you want, or at least give some good ideas.


http://gpsd.berlios.de/
http://gpsd.berlios.de/gpsfake.html

--
Kevin Horton
Ottawa, Canada


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig