Python noob question about PoMoCo

Post all your hardware and software upgrades/projects here.

Python noob question about PoMoCo

Postby wayne » Sat Mar 21, 2015 9:38 pm

Hi all!

I've built the hexy and am now examining options for modifications and upgrades. I've downloaded the PoMoCo V1.2 and PoMoCo V2.1 Python files from the thread at http://forum.arcbotics.com/viewtopic.php?f=21&t=481. I fully understand that this is NOT an official Arcbotics release but one created by the user community.

I've not programmed in Python before; however, I am technically minded and don't hesitate tackling unknowns like this. I have programmed in C, Arduino & VB. My problem is this... I can't seem to get the code to run through the Python interpreter correctly. It seems to get hung up on the sections of code that define global variables with the "__builtins__" function. For example, early in the PoMoCo.py code it attempts to define a global variable "floor" by the following statement:

Code: Select all
__builtins__.floor = 60


When I run PoMoCo, I'll get a Traceback error something like "AttributeError: 'dict' object has no attribute 'floor'

I've researched this bit of code extensively and all indication is that it is NOT recommended to define global variables using __builtins__. Even though it is not recommended, it apparently has worked for this Python program before. It just doesn't work for me! The official Python documentation suggests creating a separate module file that defines global variables visible to all modules that 'import' the said module.

I'm using Python version 2.7.6 through the "Enthought Canopy" development environment. I've got all the recommended libraries installed (Pyserial, Pygame, numpy, Pyaudio, matplotlib). Any help with __builtins__ or another workaround would be greatly appreciated.
wayne
 
Posts: 1
Joined: Sat Mar 21, 2015 9:06 pm

Return to Projects and Upgrades

Who is online

Users browsing this forum: No registered users and 2 guests

cron