You are not logged in.

#1 2013-03-24 22:21:56

mpardalos
Member
Registered: 2012-12-01
Posts: 11

[SOLVED]Pygame and geany

Hello,

I am in the process of learning to code in python and recently, after learning the basic stuff, i started a tutorial on pygame.

The editor I use is geany and I have a problem. I want to have auto-completion and tooltips for the pygame library. I googled it a lot and i only found out about other IDEs like pydev and IDLE which i both dislike very much, so i wouldn't want to switch. Help would be very appreciated since writing pygame code and continuously having to alt-tab to the pygame docs isn't exactly convenient.

Thanks in advance.

Last edited by mpardalos (2013-04-05 18:11:04)

Offline

#2 2013-03-25 00:39:10

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED]Pygame and geany

I was under the impression that Geany doesn't have API auto-completion. Instead, I thought it had a sort of word memory, which allows you to "auto-complete" words you've already used. Even so, I might be completely wrong.

Have you tried ipython? It's a Python command line interpreter (similar to the official "python") but it has tab-completion. So, it makes writing Python as easy as using tab-completion in Bash. It's not quite what you were asking for, but it sure does help me (and many other Python programmers) a lot.

Offline

#3 2013-03-25 09:08:21

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Pygame and geany

I was a heavy geany user myself, until I learned how hard it is to define my own syntax highlights and so on. Now vim and I are becoming good friends (slowly but with growing affection). What you want is Vim with http://www.vim.org/scripts/script.php?script_id=850

Offline

#4 2013-03-25 10:06:09

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED]Pygame and geany

drcouzelis wrote:

I was under the impression that Geany doesn't have API auto-completion. Instead, I thought it had a sort of word memory, which allows you to "auto-complete" words you've already used. Even so, I might be completely wrong.

Have you tried ipython? It's a Python command line interpreter (similar to the official "python") but it has tab-completion. So, it makes writing Python as easy as using tab-completion in Bash. It's not quite what you were asking for, but it sure does help me (and many other Python programmers) a lot.

FYI you can get tab-completion in the normal Python interpreter. Just include the following in a script somewhere:

import readline
import rlcompleter
readline.parse_and_bind("tab: complete")

And then set the PYTHONSTARTUP environment variable to the location of that script.

In fact, I have implemented a lot of the core useful features from iPython in the normal Python interpreter in my startup file, so I can avoid the mountains of other iPython features that I would never use. So, for example, with the normal interpreter I have tab-completion, auto-indentation, pretty-printing, command history that spans multiple sessions, and a prompt that shows the input history number.

Last edited by jakobcreutzfeldt (2013-03-25 10:06:46)

Offline

#5 2013-03-25 10:52:09

mpardalos
Member
Registered: 2012-12-01
Posts: 11

Re: [SOLVED]Pygame and geany

Awebb wrote:

I was a heavy geany user myself, until I learned how hard it is to define my own syntax highlights and so on. Now vim and I are becoming good friends (slowly but with growing affection). What you want is Vim with http://www.vim.org/scripts/script.php?script_id=850

I've tried vim and use it, but not for programming, only for quick edits. Every vim user that I have talked with says that it makes you a lot faster but it slows me down when I use it for large files.

drcouzelis wrote:

I was under the impression that Geany doesn't have API auto-completion. Instead, I thought it had a sort of word memory, which allows you to "auto-complete" words you've already used. Even so, I might be completely wrong.

So, you are saying that I can't get auto-completion for external libraries in geany? If that's the case, can you suggest me any other good editors or IDEs that have that feature?

Offline

#6 2013-03-25 12:47:42

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED]Pygame and geany

mpardalos wrote:

So, you are saying that I can't get auto-completion for external libraries in geany? If that's the case, can you suggest me any other good editors or IDEs that have that feature?

No, I'm saying that I can't get auto-completion to work in Geany. ;P Apparently jakobcreutzfeldt (above) can, so that's great! (EDIT: I was wrong, he meant it's possible in the normal Python interpreter, just like he said)

I'm one of those weirdos that doesn't use an IDE, and instead prefers Vim + tmux.

Last edited by drcouzelis (2013-03-25 13:45:10)

Offline

#7 2013-03-25 12:57:24

mpardalos
Member
Registered: 2012-12-01
Posts: 11

Re: [SOLVED]Pygame and geany

drcouzelis wrote:

No, I'm saying that I can't get auto-completion to work in Geany. ;P Apparently jakobcreutzfeldt (above) can, so that's great!

I'm one of those weirdos that doesn't use an IDE, and instead prefers Vim + tmux.

I think that jakobcreutzfeldt isn't talking about the editor, he is talking about the python interpreter. What i want is code completion inside geany.

Offline

#8 2013-03-25 13:08:55

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Pygame and geany

http://www.geany.org/Support/PluginWishlist

PYTHON Code Completion: By popular demand! Very few Python IDE's and editors support FULL code completion and call-tips. In particular, most editors cannot handle self defined objects and do not show call-tips and those that do cannot do it outside of a Python shell. IDLE has good completion but everything else about it sucks on Linux. yikes) Step-through debugging would be nice but Geany doesn't need any GUI builders and other bloat...those areas are already catered for.

Offline

#9 2013-03-25 13:34:40

mpardalos
Member
Registered: 2012-12-01
Posts: 11

Re: [SOLVED]Pygame and geany

@Awebb

So if geany doesn't have this, do you know any other good editors or IDEs that have this feature?

Offline

#10 2013-03-25 13:36:27

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Pygame and geany

I only use vim and geany and since you did not feel like putting on your robe and wizard hat, I have no suggestion at this point.

Offline

#11 2013-03-25 15:26:00

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,041

Re: [SOLVED]Pygame and geany

Sorry for derailing the thread with the python interpreter stuff.

Perhaps Vim + ropevim or Emacs + ropemacs will do what you want.

Last edited by jakobcreutzfeldt (2013-03-25 15:27:19)

Offline

#12 2013-03-25 15:36:55

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Pygame and geany

Or maybe vim+jedi.

Offline

#13 2013-03-27 18:23:53

mpardalos
Member
Registered: 2012-12-01
Posts: 11

Re: [SOLVED]Pygame and geany

Well, after searching I decided on Ninja IDE, it has all the features I need and also PEP-8 check. Just one last thing, whenever I open the color scheme settings it stops highlighting syntax immediately. Has anyone else encountered this problem?

Offline

#14 2013-03-28 00:10:07

Odaer
Member
Registered: 2010-08-14
Posts: 87

Re: [SOLVED]Pygame and geany

A bunch of IDE has intelligent code completion for python. PyCharm is supp to be good but I have not tried it. I have used the eclipse plugin and eclipse or the kdevelop plugin with kdevelop. Both mostly do what you ask I think.
But mostly I use Vim without  completion. Omnicomplete is supposed to work for python in Vim but I have never tried it for python and for c++ i switched to the clang complete plugin.
python wiki has a list with IDEs http://wiki.python.org/moin/IntegratedD … vironments

Last edited by Odaer (2013-03-28 00:13:24)

Offline

#15 2013-03-28 19:58:04

mpardalos
Member
Registered: 2012-12-01
Posts: 11

Re: [SOLVED]Pygame and geany

I've heard about PyCharm, but it's a commercial IDE and I prefer not to pay

Offline

#16 2013-03-29 02:30:36

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED]Pygame and geany

Thanks to this thread, I just gave ninja-ide a try. Wow, that's a pretty editor. yikes I'm going to continue trying it out on my next project.

Offline

#17 2013-03-29 08:01:04

Awebb
Member
Registered: 2010-05-06
Posts: 6,272

Re: [SOLVED]Pygame and geany

It looks like ninja-ide is python2 exclusive. Does it already understand python3?

Offline

#18 2013-03-30 00:40:13

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: [SOLVED]Pygame and geany

Awebb wrote:

It looks like ninja-ide is python2 exclusive. Does it already understand python3?

Well, I've only used it for, like, five minutes, but changing the Python executable from "python" to "python3" under "Preferences" seemed to work fine...

Offline

#19 2013-03-30 16:45:35

Kopfweh
Member
Registered: 2011-08-06
Posts: 77

Re: [SOLVED]Pygame and geany

What about eric? eric5 for python3 and eric4 for python2. It's a big python-ide with debugging features. But to be honest, I don't know whether it supports auto-completion.

Offline

#20 2013-03-30 17:33:47

bmanuel
Member
Registered: 2011-10-06
Posts: 106

Re: [SOLVED]Pygame and geany

PyCharm is your best bet then, it has the best Python auto-completion feature i ever seen in a Python IDE, very complete: http://www.jetbrains.com/pycharm/

Offline

#21 2013-03-30 20:00:56

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED]Pygame and geany

Eclipse. 
Emacs also, but it can be a serious PITA to get working with Python.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#22 2013-03-30 22:31:50

Sanne
Member
Registered: 2012-03-13
Posts: 87

Re: [SOLVED]Pygame and geany

I'm currently looking into Spyder, seems to be nice also and has good code completion for Python. It's Python 2 only for now, though, as far as I can see. But maybe worth a look also.


If our currency were not money but appreciation and acknowledgement for what we do for others, for the community, for the benefit of all, we would have paradise on earth.

Offline

Board footer

Powered by FluxBB