How do you go about pythoning?

70 views
Skip to first unread message

Duraid

unread,
Mar 19, 2011, 12:49:00 PM3/19/11
to Montréal-Python
Hi,

I'm new to python and I'm still not settled on my python environment,
i.e. what tools to use for developing with python.

Right now for my experimentation and writing small scripts i use
TextMate and 2 terminals: one for running the script and one python
shell to run snippets and use the help function. I like textmate
because it's fast to launch and has nice syntax highlighting.

I downloaded Pycharm and tried it. I like it's refactoring and
intellisense support but I'll probably leave it for developing bigger
applications.

I'm curious how do you guys write your python code? maybe i could
steel one tip or two:)

Duraid

Dimitry Zolotaryov

unread,
Mar 19, 2011, 1:21:28 PM3/19/11
to montrea...@googlegroups.com, Duraid
Hey Durald,

Many Montreal Python developers use command line editors EMACS and
VIM. Being command line tools, there is no mouse support. Instead,
control over the file is through key command (eg. to search through a
file in Vim, you would press slash—/—then the characters you're
looking for.)

I have personally tried using a tool like Eclipse for Python
programming but it feels too bulky.

I hear textmate is very nice. Why would you switch?

Dimitry

2011/3/19 Duraid <dur...@gmail.com>:

> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Montréal-Python.
> Pour envoyer un message à ce groupe, adressez un e-mail à montrea...@googlegroups.com.
> Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
> Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/montrealpython?hl=fr-CA
>
>

Yannick Gingras

unread,
Mar 19, 2011, 2:23:59 PM3/19/11
to montrea...@googlegroups.com
On March 19, 2011, Dimitry Zolotaryov wrote:
> Many Montreal Python developers use command line editors EMACS and
> VIM. Being command line tools, there is no mouse support.

I've had mouse support out of the box in Emacs for the past decade.
If you want to avoid mouse support, you need to actively disable it.

--
Yannick Gingras
http://ygingras.net

signature.asc

Nicolas Cadou

unread,
Mar 19, 2011, 2:13:50 PM3/19/11
to montrea...@googlegroups.com, Duraid
Le Saturday, March 19, 2011, Dimitry Zolotaryov a écrit :
> Many Montreal Python developers use command line editors EMACS and
> VIM. Being command line tools, there is no mouse support.

I beg to disagree. My vim runs in a terminal, in a screen session, and has
mouse support, scroll wheel included. :)

--

Nicolas Cadou
(514) 664-5284

http://ajah.ca
http://ca.linkedin.com/in/nicolascadou

signature.asc

Derek Mounce

unread,
Mar 19, 2011, 2:33:52 PM3/19/11
to montrea...@googlegroups.com, Nicolas Cadou, Duraid
Yup, indeed.

Derek Mounce

unread,
Mar 19, 2011, 3:33:13 PM3/19/11
to Duraid, montrea...@googlegroups.com, Nicolas Cadou
Debugging is `print` or `pprint` if you want to get spiffy.  For me, anyway. :)
I think it's fair to say that pretty much everyone on Emacs or Vim has customized it --at the very least, the colours.



On Sat, Mar 19, 2011 at 3:21 PM, Duraid <dur...@gmail.com> wrote:
Do you use vim vanilla or is it customized in some sort? also any other tools than the editor.. like for debugging?

-- 
Duraid
Sent with Sparrow

Duraid

unread,
Mar 19, 2011, 3:21:26 PM3/19/11
to Derek Mounce, montrea...@googlegroups.com, Nicolas Cadou
Do you use vim vanilla or is it customized in some sort? also any other tools than the editor.. like for debugging?

-- 
Duraid
Sent with Sparrow

On Saturday, March 19, 2011 at 2:33 PM, Derek Mounce wrote:

Louis Munro

unread,
Mar 19, 2011, 4:26:15 PM3/19/11
to montrea...@googlegroups.com
Either I'm not paying attention or no one has mentioned ipython.

What about things like pyflakes?
It work pretty well for me in vim.

-- 
LM

Yannick Gingras

unread,
Mar 19, 2011, 4:52:30 PM3/19/11
to montrea...@googlegroups.com
On March 19, 2011, Louis Munro wrote:
> Either I'm not paying attention or no one has mentioned ipython.
>
> What about things like pyflakes?

It's probably because this question comes up very often and that
everyone is tired of repeating themselves. Maybe we should put a page
on the wiki. The last time we had this discussion, some popular
on-the-side tools to go with "plain" editors were:
* WebError
* import ipdb; ipdb.set_trace()
* pyflakes
* nose

It's worth mentioning that IDEs such as Eclipse+PyDev and WingIDE
work for some and not for others. Give it a try and see what you
like.

Personally, I use Emacs but mostly because I'm used to it. I don't
think it's particularly optimized for Python development. I've seen
super stars being very efficient with GEdit and TextMate. You should
worry more about the libraries that you use that about your editor.

signature.asc

Pierre Thibault

unread,
Mar 19, 2011, 5:37:40 PM3/19/11
to montrea...@googlegroups.com
Hi,

Le 19 mars 2011 12:49, Duraid <dur...@gmail.com> a écrit :
Hi,

I'm new to python and I'm still not settled on my python environment,
i.e. what tools to use for developing with python.

This is an eternal question. Different people, different solutions. I guess the best is to try what seems right to you.

Personally, I love Eclipse with Pydev. From the Pydev websites it says:

It is scriptable with Python. It gives you code coverage. It analyzes the code with Pylint. It also has templates.

What I like about Eclipse is its support for the things I need: Mercurial, CodeGoogle issues, html, JavaScript. Lots of plug-ins and the possibilty to easily integrate external tools.

You may find interesting this article I wrote on my blog: http://pierrethibault.posterous.com/2010/10/web2py-eclipse-pydev-recipe.html


Right now for my experimentation and writing small scripts i use
TextMate and 2 terminals: one for running the script and one python
shell to run snippets and use the help function. I like textmate
because it's fast to launch and has nice syntax highlighting.

I downloaded Pycharm and tried it. I like it's refactoring and
intellisense support but I'll probably leave it for developing bigger
applications.

I'm curious how do you guys write your python code? maybe i could
steel one tip or two:)

Duraid
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Montréal-Python.
Pour envoyer un message à ce groupe, adressez un e-mail à montrea...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/montrealpython?hl=fr-CA




--


A+

-------------
Pierre
My blog (http://pierrethibault.posterous.com)
YouTube page (http://www.youtube.com/user/tubetib)
Twitter (http://twitter.com/pierreth2)
Google profile (http://www.google.com/profiles/pierre.thibault1)

François Pinard

unread,
Mar 19, 2011, 6:28:58 PM3/19/11
to montrea...@googlegroups.com
Le 2011-03-19 15:21, Duraid a écrit :
> Do you use vim vanilla or is it customized in some sort? also any
> other tools than the editor.. like for debugging?

I used to use Emacs for Python development, and liked it. There is (or
at least was) many facilities to ease Python highlighting, indentation,
and such.

Later, when I much tried to avoid Emacs (as a furious attempt to break
out of the addiction! ☺), I got used to Vim for Python development, and
found it fast and convenient enough (even if a bit less clever, or let's
rather say "different", about indentation). All in all, Vim is quite
comfortable for Python edition.

One attractive feature is editor extensibility, especially if you use it
a lot. For Vim, it may be built with Python enabled, and "gvim" is
usually distributed with Python already enabled. So you can use Python
to augment the editor with new commands. On the Emacs side, I gave
myself the ability of extending with Python instead of Emacs Lisp
(through Pymacs, which some of you might know). I made a great deal of
customization to Vim for easing some complex Python edition tasks, but
the need progressively vanished, and I do not use them much anymore.

I also tried Pydev (on the Eclipse side) which is surely as heavy as
Eclipse itself. It also clashes destructively with SchemeScript (an
Eclipse addition for handling Scheme), and having to choose between
Python and Scheme on Eclipse, I had to select Scheme.

I've been more happy with Wing IDE. Yet, I'm uncomfortable with the
required NDA if you want to really extend it with Python, so I currently
don't. I particularly appreciate the debugger integration, the
on-the-fly source help, and the project switching.

Of course, IPython is nicer and nicer as time goes. I did not use it
much recently, with the impression left of some slowness, and many
things to configure. I should likely revisit it! ☺

François

Pierre Thibault

unread,
Mar 19, 2011, 7:01:51 PM3/19/11
to montrea...@googlegroups.com
2011/3/19 François Pinard <pin...@iro.umontreal.ca>
Le 2011-03-19 15:21, Duraid a écrit :
I also tried Pydev (on the Eclipse side) which is surely as heavy as
Eclipse itself. It also clashes destructively with SchemeScript (an
Eclipse addition for handling Scheme), and having to choose between
Python and Scheme on Eclipse, I had to select Scheme.

François


You could have used two different Eclipse installations to avoid such a clash.

Michael Dekmetzian

unread,
Mar 19, 2011, 7:11:24 PM3/19/11
to montrea...@googlegroups.com
This is true, but the requirement for same is the reason for my love/hate relationship with eclipse - I have 6 different eclipse installations with varying plugins and such.

(This counts eclipse implementations such as Aptana and STS) 

Le Mar 19, 2011 à 7:01 PM, Pierre Thibault a écrit :

François Pinard

unread,
Mar 19, 2011, 7:48:09 PM3/19/11
to montrea...@googlegroups.com
Le 2011-03-19 12:49, Duraid a écrit :
I'm new to python and I'm still not settled on my python environment,
i.e. what tools to use for developing with python.
There is one tool, Rope, which I forgot to mention, likely because I never really used it myself.  On the other hand, I often read about it (because it uses Pymacs on the Emacs side), and who knows, it might be worth a good look.  On Ubuntu, there are packages python-rope and python-ropemacs, but you might also seek the Rope site.  This is a Python refactoring library, supporting both Vim and Emacs, and maybe a few more.  If you do try it, tell me the result of your evaluation, as I'm curious ☺.

François

Dimitry Zolotaryov

unread,
Mar 19, 2011, 10:08:12 PM3/19/11
to montrea...@googlegroups.com, François Pinard
You guys are right about the mouse support. I got so used to using
just the keyboard it completely slipped my mind :)

2011/3/19 François Pinard <pin...@iro.umontreal.ca>:

dsx

unread,
Mar 20, 2011, 10:06:32 AM3/20/11
to Montréal-Python
Hi,

How to make Eclipse+PyDev play nice with virtualenv? I tried couple
different ways but it doesn't work as I want it to work. How do you
solve this problem?

On Mar 19, 5:37 pm, Pierre Thibault <pierre.thibau...@gmail.com>
wrote:
> Hi,
>
> Le 19 mars 2011 12:49, Duraid <dur...@gmail.com> a écrit :
>
> > Hi,
>
> > I'm new to python and I'm still not settled on my python environment,
> > i.e. what tools to use for developing with python.
>
> This is an eternal question. Different people, different solutions. I guess
> the best is to try what seems right to you.
>
> Personally, I love Eclipse with Pydev. From the Pydev websites it says:
>
>    - Django integration <http://pydev.org/manual_adv_django.html>
>    - Code completion <http://pydev.org/manual_adv_complctx.html>
>    - Code completion with auto
> import<http://pydev.org/manual_adv_complnoctx.html>
>    - Syntax highlighting <http://pydev.org/manual_adv_editor_prefs.html>
>    - Code analysis <http://pydev.org/manual_adv_code_analysis.html>
>    - Go to definition <http://pydev.org/manual_adv_gotodef.html>
>    - Refactoring <http://pydev.org/manual_adv_refactoring.html>
>    - Mark occurrences <http://pydev.org/manual_adv_markoccurrences.html>
>    - Debugger <http://pydev.org/manual_adv_debugger.html>
>    - Remote debugger <http://pydev.org/manual_adv_remote_debugger.html>
>    - Tokens browser <http://pydev.org/manual_adv_open_decl_quick.html>
>    - Interactive console<http://pydev.org/manual_adv_interactive_console.html>
>    - Unittest integration <http://pydev.org/manual_adv_pyunit.html>
>    - *and many others*:
>
> It is scriptable with Python. It gives you code coverage. It analyzes the
> code with Pylint. It also has templates.
>
> What I like about Eclipse is its support for the things I need: Mercurial,
> CodeGoogle issues, html, JavaScript. Lots of plug-ins and the possibilty to
> easily integrate external tools.
>
> You may find interesting this article I wrote on my blog:http://pierrethibault.posterous.com/2010/10/web2py-eclipse-pydev-reci...
>
>
>
>
>
>
>
>
>
> > Right now for my experimentation and writing small scripts i use
> > TextMate and 2 terminals: one for running the script and one python
> > shell to run snippets and use the help function. I like textmate
> > because it's fast to launch and has nice syntax highlighting.
>
> > I downloaded Pycharm and tried it. I like it's refactoring and
> > intellisense support but I'll probably leave it for developing bigger
> > applications.
>
> > I'm curious how do you guys write your python code? maybe i could
> > steel one tip or two:)
>
> > Duraid
>
> > --
> > Vous recevez ce message, car vous êtes abonné au groupe Google
> > Groupes Montréal-Python.
> > Pour envoyer un message à ce groupe, adressez un e-mail à
> > montrea...@googlegroups.com.
> > Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse
> > montrealpytho...@googlegroups.com.
> > Pour plus d'options, consultez la page de ce groupe :
> >http://groups.google.com/group/montrealpython?hl=fr-CA
>
> --
>
> A+
>
> -------------
> Pierre
> My blog (http://pierrethibault.posterous.com)<http://pierrethibault.posterous.com>
> YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib>
> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2>
> Google profile (http://www.google.com/profiles/pierre.thibault1)<http://www.google.com/profiles/pierre.thibault1>

Pierre Thibault

unread,
Mar 20, 2011, 7:44:14 PM3/20/11
to montrea...@googlegroups.com
Le 20 mars 2011 10:06, dsx <free....@gmail.com> a écrit :
Hi,

How to make Eclipse+PyDev play nice with virtualenv? I tried couple
different ways but it doesn't work as I want it to work. How do you
solve this problem?


I don't understand what could be the problem.

You install your virtualenv.

Then you define a Python interpreter in Window > Preferences > Pydev > Interpreter Python for the virtualenv.

You create a new Pydev project in Eclipse located where you want based on the interpreter you just created.

No?

Duraid

unread,
Mar 21, 2011, 10:14:28 AM3/21/11
to Montréal-Python
Thank you all for your replies. I'm sorry to bore you with this
recurring question but I would like to remind you how invaluable these
suggestions are to a new comer.

I'm glad to have learned about ipython, ipdb, rope and other tools
that will enhance my experience with python.

I agree to Yannick's suggestion that we should create a wiki page.
Since this is an individual preference, I suggest that each
contributer writes his own section of how he develops with python and
the tools he uses. I found this post by Yannick and I think it's a
good example: http://groups.google.com/group/montrealpython/msg/7eb78a836c76b9dd

Thanks,

Duraid

Chris Steel

unread,
Mar 21, 2011, 11:30:22 AM3/21/11
to montrea...@googlegroups.com, Duraid
Hi Durald,

I like to be able to setup shop anywhere in an instant and get going and tend to prefer light weight text editors and command line interactions. Recently I started looking into emacs as it runs "everywhere" and has some pretty intriguing features.


OS X
Bean, JEdit, TextWrangler, nano, vim, vi

Ubuntu Linux -
gedit, nano, vim, vi

Windows -
notepad, JEdit...



2011/3/21 Duraid <dur...@gmail.com>
Point me to the place and I am happy to contribute...
 
Thanks,


Duraid

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Montréal-Python.
Pour envoyer un message à ce groupe, adressez un e-mail à montrea...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/montrealpython?hl=fr-CA




--
Christopher Steel

Voice of Access

Duraid

unread,
Mar 21, 2011, 12:25:23 PM3/21/11
to Chris Steel, montrea...@googlegroups.com
Thanks Chris,

I wanted to ask is virtaulenv something you guys use? and do you use it for every project you start or only for some? what's the best practice for that?

Thanks

Nicolas Cadou

unread,
Mar 21, 2011, 12:38:27 PM3/21/11
to montrea...@googlegroups.com
Le Monday, March 21, 2011, Duraid a écrit :
> I wanted to ask is virtaulenv something you guys use? and do you use it for
> every project you start or only for some? what's the best practice for
> that?

Personally I use virtualenvs for all projects. Even when using zc.buildout I
wrap it in a virtualenv.

signature.asc

Chris Steel

unread,
Mar 21, 2011, 1:09:15 PM3/21/11
to Duraid, montrea...@googlegroups.com
Hi Duraid,

I use Virtualenv with virtualenvwrapper frequently for projects where I need full control of my app(s) environment(s). For utility scripts I do not bother unless I have some particularly tricky environmental (lib) requirements.

"best practice" will vary depending a lot on your project/needs.

virtualenv
once you are very comfortable with virtualenv if your project requires it you might consider adding:
virtualenvwrapper
once you are very comfortable with virtualenvwrapper, if your project requires it, you might consider adding:
fabric
- for automating setup, staging and deployment of virtualenvs and associated applications.


http://pypi.python.org/pypi/virtualenv

http://www.doughellmann.com/projects/virtualenvwrapper/

http://docs.fabfile.org/en/1.0.0/

Cheers and welcome...
Reply all
Reply to author
Forward
0 new messages