sompor9
Posts: 13
Joined: Mon Oct 29, 2012 8:12 am

Cannot run GPIO on IDLE

Sun Nov 18, 2012 5:10 am

Hi All

I have problem with GPIO on IDLE cannot use but command line is work.

please help me..
Attachments
ScreenHunter_01 Nov. 18 12.07.jpg
ScreenHunter_01 Nov. 18 12.07.jpg (41.84 KiB) Viewed 1399 times

sompor9
Posts: 13
Joined: Mon Oct 29, 2012 8:12 am

Re: Cannot run GPIO on IDLE

Sun Nov 18, 2012 5:11 am

on command line is work.

How to fix problem.
Attachments
ScreenHunter_02 Nov. 18 12.10.jpg
ScreenHunter_02 Nov. 18 12.10.jpg (28.56 KiB) Viewed 1397 times

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Cannot run GPIO on IDLE

Sun Nov 18, 2012 8:06 am

IDLE is itself a python program. I think you will need to run Idle as root using sudo.

I and others have found that Idle does peculiar things when running programs from it. I find it best to use Idle just as an editor and run the program from a terminal window.
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Cannot run GPIO on IDLE

Sun Nov 18, 2012 8:10 am

Your second problem, I think you need to import time
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

techpaul
Posts: 1512
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
Contact: Website

Re: Cannot run GPIO on IDLE

Sun Nov 18, 2012 4:37 pm

In standard Grpahics environment from main menu select "Run" and type in

For Python 2

Code: Select all

sudo idle
For Python 3

Code: Select all

sudo idle3
If you need the root permissions for GPIO and the like, do NOT use the other icons for IDLE
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/

User avatar
paddyg
Posts: 2555
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Cannot run GPIO on IDLE

Sun Nov 18, 2012 6:23 pm

There a couple of things that IDLE just doesn't seem to do, or are much easier to do with geany
also https://groups.google.com/forum/?hl=en-GB&fromgroups=#!forum/pi3d

Return to “Python”