Balloon Collaboration
June 26, 2017, 05:40:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: DaddyB, Larry and Dan are your administrators...Private message for any problems or issues with the Forum//barntekadmin
 
   Home   Help Search gallery Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Python 3.3  (Read 2173 times)
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« on: January 02, 2013, 03:32:53 AM »

After getting an email from Danny about the possibility of upgrading to Python 3.3, I did a little research and eventually found this page.  I explains why 3.3 is better than 2.7 for manipulating the I/O's on the pi.

I had to figure out how to use Python 3 on the Pi and found that IDLE3 is Python 3.  from the command line, you simply type python3 filename and hit enter to run the app.  I needed to reinstall the lxml library into python 3 and did it using the following command:
sudo apt-get install python3-lxml
Seems as though you handle 3 the same way as 2, except you add the 3 to the end of the python name.

BTW, the Pi is running Python 3.2.3, but I think that is close enough to 3.3 that it doesn't make a difference.  I am running 3.3 on my Windows PC for development.

The latest EveAPI app converted and working in Python 3.3... even tested on the Pi...

EveAPI2_3.py
« Last Edit: January 02, 2013, 03:34:28 AM by Larry » Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #1 on: January 18, 2013, 02:52:12 AM »

I am about to throw my Pi out the window!!
I am trying to write the blink program and when I write "import RPi-GPIO as GPIO"  I get an error message.
I will keep trying, however. Angry
Logged
Larry
Administrator
Hero Member
*****
Posts: 1167



View Profile
« Reply #2 on: January 18, 2013, 08:03:51 AM »

Well, if you are trying to write it and run it in IDLE3, then you will have to run IDLE as root, because RPi-GPIO has to be run as root.  Basically, either open a terminal window and type in sudo idle3 to launch it, or right-click on the icon and there should be a text box with the word command beside it.  Just insert sudo and a space in front of whatever is in there and click OK.

Now when you douple-click IDEL3 it will launch as root.  

If you are just trying to run it from the command line, you will have to type in sudo python3 file_name.

Don't get too aggrevated, I went thru the same stuff, too.  Wink
« Last Edit: January 18, 2013, 08:32:08 AM by Larry » Logged
DaddyB
Administrator
Full Member
*****
Posts: 144



View Profile
« Reply #3 on: January 18, 2013, 05:26:11 PM »

Thanx.  I am about to go try it....

With your help, it is running along smoothly.  I'm still at the 'hello world' stage, but it is coming along.
I have it blinking two LED's for a predetermined count.  It prints the color LED and its associated count...
Thanks for the help.   Grin
« Last Edit: January 19, 2013, 03:36:29 AM by DaddyB » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!