Pointers needed to API documentation/IDE integration

6 posts
by Xezz » Sat Jan 05, 2013 2:02 pm
Hello all,

I just recently got my Raspberry Pi - like a lot of those posting here recently - and am starting fresh with Python. I'm having a java background and I'm looking for something similar to javadocs for API's/modules. I have had a quick look at http://pypi.python.org/pypi/RPi.GPIO for example, but couldn't find a description of the exposed API.

So I'd thought I quickly ask here if someone could point me to a place where the API is documented and how documentation is handled overall in Python.

The second point is IDE's for Python:
I use IntelliJ IDEA for Java and I'm now a spoiled kid when it comes to IDEs. So far I used IDLE for a starter, but I'd like a bit more comfort.
Stuff I'd like to have:
    Free IDE
    if possible API documentation for objects/methods

Thanks in advance
Posts: 9
Joined: Sat Jan 05, 2013 12:37 pm
by Digital Larry » Sat Jan 05, 2013 6:44 pm
I've just used Idle. My typical strategy is to develop on PC and then bounce the code through a Subversion repository to the Pi.

Sorry I don't have anything to suggest for a more powerful Python IDE.

My background is more C/C++ but I am also currently trying to learn Java for some Android projects. Python will probably baffle you for awhile because you never declare any variables, you just go ahead and use them. Also, there is no such thing as a compiler error - you have to fully exercise your code to find problems. There are a few other idiosyncrasies but overall I have not found Python to be that difficult.
Posts: 63
Joined: Tue Jul 24, 2012 9:10 pm
Location: Silicon Valley, CA
by Xezz » Sat Jan 05, 2013 8:06 pm
Hi Larry,

thanks for your post. I actually use Git(hub) right now while fooling around with python and the pi.

Where do you lookup the methods that all those modules expose for us to use? I guess that's my major issue right now, since in C++ I would look into the header files or in Java there is usually a javadoc available. In python tho I haven't really seen any documentation yet (I have not really dedicated myself to it that much yet to be honest).

Since you mention Java, if you aren't set yet on a IDE the community edition of Intellij IDEA is free of charge and is really powerful once you start writing bigger programs. Have a look at it if you like, it makes it possible to code without ever touching the mouse, since it enables you to use hotkeys for anything (and has a really good completition).

Edit: Since I wasn't able to edit my first post.
Is there a good plugin for Eclipse maybe for Python? I'm not the greatest fan of Eclipse, but I suppose if there is a plugin, it should be more than enough for me to get deeper into the subject.
Posts: 9
Joined: Sat Jan 05, 2013 12:37 pm
by croston » Sat Jan 05, 2013 8:48 pm
For python standard library information, try http://docs.python.org

Alternatively, you can type help() at the python >>> interactive prompt. If you write your own Python modules, docstrings are used to generate module documentation and they comment your code as is good practice.
User avatar
Posts: 657
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
by -rst- » Sat Jan 05, 2013 11:32 pm
For extension libraries like RPi.GPIO, it is obviously down to the individual developer to document his/hers code - exactly like in Java; some libraries are well documented, some not so much... With Python there is the advantage that you always get the source code you can look at ;)
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by Digital Larry » Sun Jan 06, 2013 5:14 am
Pressing F1 while running IDLE will launch a help file, you may find it helpful.

Now I have to say that I approach things bit by bit. Even though I was running the Pi, which a lot of people are using to twiddle GPIOs, I first got it to hook to a HDMI monitor to run a dedicated timer to keep track of the time my kids play video games and make them take breaks, etc. I had not used Python before. So pretty quickly I stumbled onto the Pygame library which offers graphics, timing (terribly inaccurate), and sound which I have used for my programs.

If you go to www.python.org you will find lots of definitions and references but I always like to see an example and they don't have a lot there. So you just have to use Google liberally.

I am using Eclipse for Java but there again I don't have tons of time to invest to see if there's something better. The IDE is not what's holding me back in other words!
Posts: 63
Joined: Tue Jul 24, 2012 9:10 pm
Location: Silicon Valley, CA