[portland] Planning for the August Meeting
kirby urner
kirby.urner at gmail.com
Fri Aug 3 19:58:51 CEST 2007
> Is this something that would be appropriate at a meeting, posted to this mailing
> list for comment, or is there a different Python forum for this sort of thing?
>
Did you get some feedback on this? I think short code snippets to give the
flavor would be fine. If there's something stylistic to comment on,
it's probably
pervasive, like long_camelCase_Variable_names_used_in_Java or something.
Assuming some interest in the Tux Droid, Python programmable, here's a
short script just to give the flavor:
#!/usr/bin/python
# -*- coding: latin-1 -*-
import sys
sys.path.append('/home/kirby/tuxsetup-1.0-final/tuxdroid/api/python')
from tux import *
# -----------------------------------------------------------------------------
# Object "tux" is created by tux.py
# Your script begins here
# -----------------------------------------------------------------------------
def spindemo():
tux.tts.select_voice_us_male_tuxed()
tux.tts.speak("Hello Tawra. I know how to spin on my butt. Watch")
tux.cmd.spinl_on(4)
tux.tts.select_voice_us_female_tuxed()
tux.tts.speak("Now I have a girl voice.")
tux.tts.speak("I still know how to spin on my butt. Watch")
tux.cmd.spinl_on(4)
spindemo()
# -----------------------------------------------------------------------------
# End of your script
# -----------------------------------------------------------------------------
tux.destroy()
Documentation looks like this:
1) Class : tux (tuxapi_class.TUXTCPCommunicator)
1.1) Class : tux.cmd (tuxapi_class.TUXcmd)
1.1.1) Function : tux.cmd.audio_channel_general
1.1.2) Function : tux.cmd.audio_channel_tts
1.1.3) Function : tux.cmd.eyes_close
...
1.1.44) Function : tux.cmd.wings_off
1.1.45) Function : tux.cmd.wings_on
1.1.46) Function : tux.cmd.wings_on_free
1.2) Class : tux.daemon (tuxapi_class.TUXdaemon)
1.2.1) Function : tux.daemon.auto_connect
1.2.2) Function : tux.daemon.connect
1.2.3) Function : tux.daemon.disconnect
...
1.6.11) Function : tux.status.lled
1.6.12) Function : tux.status.lwing_bt
1.6.13) Function : tux.status.mouth_closed
...
1.9.5) Function : tux.tts.pause
1.9.6) Function : tux.tts.play
1.9.7) Function : tux.tts.select_voice
1.9.8) Function : tux.tts.select_voice_fr_female
1.9.9) Function : tux.tts.select_voice_fr_female_tuxed
...
With each entry looking like this:
1.1.38) Function : tux.cmd.spinl_on
Send a command to tux to spin to the left
Parameters:
"count" as integer : number of quarter turns
(default = 4)
"speed" as integer : speed of the movement(1..5)
(default = 5)
Example:
>>> tux.cmd.spinl_on()
>>> tux.cmd.spinl_on(2) (count = 2)
>>> tux.cmd.spinl_on(2,5) (count = 2 and speed = 5)
More about Tux Droid in my blog:
http://mybizmo.blogspot.com/2007/07/tux-is-alive.html
Kirby
More information about the Portland
mailing list