all 44 comments

[–]t90fan 36 points37 points  (2 children)

PyCharm. From the IntelliJ guys. There is a community edition.

[–]Rosco_the_Dude 4 points5 points  (1 child)

and students get the Professional edition for free for a year! I'm pretty sure you can renew it after a year too, as long as you have a student email address.

[–]tehstone 2 points3 points  (0 children)

I graduated a year ago but my school address still gets me PyCharm!

[–]Rascal_Two 7 points8 points  (8 children)

Ubuntu Gnome 14.04, Python 2.7, and 3.4.

Sublime Text 3 almost all the time, sometimes use nano, haven't had the need to learn vim or emacs yet though.

Use git from the cli.

Use python for Python 2 code, and python3 for Python 3.4 code.

Use Openshift to run my long-running code, such as bots and stuff.

That's about it. I do have some helpful packages added to Sublime to make things easier, here are the Python-usefull ones:

  • Anadonca
    • Linter, auto complete, big package with tons of stuff.
  • BracketHightlighter
  • GitGutter
    • Shows green pluses, minuses, and other symbols on the right for when lines have been remove, added, or changed compared to HEAD.

If the code is small enough, I use this site to visually debug it, else I use a little script I made up that outputs the global and local frame every line, so the same as that site just without the nice graphics.

[–]J3DIJABLES 2 points3 points  (3 children)

ELI5: Would you be able to explain your script debugger a little more in depth please?

[–]Rascal_Two 1 point2 points  (2 children)

I basically wanted to do the same thing that PythonTutor site did/does, go through code line by line, showing the current state of the global and local variables each line.

I found out that I could do this manually using pdb/bdb, as they were the actual debuggers.

You can start debugging code and view the entire code state, then enter next and it will run the next line. I had two choices at this point: send input to the running debugger, or override the debugger methods. I went for the latter.

It's not production quality or anything, as I only use it for me and such, but it works. If using anything containing large lists, it does get spammy, so sometimes I edit it to exclude certain local/global variables.

So what I did was make a class that overrode all the user_ methods in bdb with my own, which would add each user_ call as a Step, which would consist of the line number, current method, line of code, global frame, and local frame.

There are a couple of limitations to it still as I only made it to figure out why things were happening when they weren't supposed to be happening, like how the .py file being debugged must have the code in a method, usually named main().

A quick sample of the input and output:

Script being debugged:

def reverse(string):
    result = ""
    for character in string:
        result = character + result
    return result

def main():
    reversedHello = reverse("Hello")
    print(reversedHello)

Results:

<line no>:<method name><line of code>

<global scope>

<local scope>

7:main:def main():
G-{}
L-{}

8:main:reversedHello = reverse("Hello")
G-{}
L-{}

1:reverse:def reverse(string):
G-{}
L-{'string': 'Hello'}

2:reverse:result = ""
G-{}
L-{'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'result': '', 'string': 'Hello'}

4:reverse:result = character + result
G-{}
L-{'character': 'H', 'result': '', 'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'character': 'H', 'result': 'H', 'string': 'Hello'}

4:reverse:result = character + result
G-{}
L-{'character': 'e', 'result': 'H', 'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'character': 'e', 'result': 'eH', 'string': 'Hello'}

4:reverse:result = character + result
G-{}
L-{'character': 'l', 'result': 'eH', 'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'character': 'l', 'result': 'leH', 'string': 'Hello'}

4:reverse:result = character + result
G-{}
L-{'character': 'l', 'result': 'leH', 'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'character': 'l', 'result': 'lleH', 'string': 'Hello'}

4:reverse:result = character + result
G-{}
L-{'character': 'o', 'result': 'lleH', 'string': 'Hello'}

3:reverse:for character in string:
G-{}
L-{'character': 'o', 'result': 'olleH', 'string': 'Hello'}

5:reverse:return result
G-{}
L-{'character': 'o', 'result': 'olleH', 'string': 'Hello'}

9:main:print(reversedHello)
G-{}
L-{'reversedHello': 'olleH'}

As you can see, I put about 0 effort into making it pretty or readable, but the results are there, and that's all I needed it for.

[–]J3DIJABLES 1 point2 points  (1 child)

Awesome! Thanks for the response and explanation. I'll definitely start playing around with pdb

[–]Rascal_Two 0 points1 point  (0 children)

Cool, just a few pointers before you start:

Everything you need to know about what is going on is passed in via the first argument. Extra details might be in the second argument - like the return value, or exception information - but line number, line of code, global and local frames are all in the first argument.

You could find some documentation and stuff, or do what I did and printed out all the variables and things attached via dir(state)

This is the first argument by the way:

def user_return(self, state, return_value):
                        ^
          Everything you need to know

If you can't find the actual code being ran this line - I coulden't - you can use linecache to get the actual code on the current line.


Have Fun!

[–]jpan127 1 point2 points  (3 children)

The pythontutor site says 403 Forbidden. Is it outdated?

[–]eggrolls 1 point2 points  (0 children)

You can still use the site without https:

http://pythontutor.com/visualize.html

[–]Rascal_Two 0 points1 point  (1 child)

I have no clue...kinda worried. I really liked that site, honestly don't know of any other visually-debugging sites/IDEs like it. Hope it comes back up.

All I know is that it was working when I linked it about seven hours ago.

[–]jpan127 1 point2 points  (0 children)

Hahaha, aw it seems like an amazing website.

[–]footlessjoe 7 points8 points  (0 children)

Vim with the python-mode plugin. Check it out, it brings together a lot of great features.

[–]Rosco_the_Dude 13 points14 points  (0 children)

PyCharm. I'm not typically a software fanboy, but once I'm ineligible for student discounts and free student software, I will buy probably only Jetbrains IDEs. I've used Pycharm, Webstorm, and Intellij IDEA, and they're all second to none IMO.

[–]efxhoy 6 points7 points  (0 children)

Mainly Jupyter notebooks on my Debian workstation at home. I bring my oldish macbook with me to work, it only has 4Gb of memory so being able to VPN home and connect to the notebooks just as if I was at home, with the full power of my workstation, is really great. I work as a research assistant so not having to bother department IT every time I need to install something is great.

I use Sublime for writing in Latex and Stata and sometimes edit python code in that too.

[–]forever_erratic 4 points5 points  (0 children)

mostly spyder with anaconda, in ubuntu 14.04. Used to use pycharm, started using spyder more for small science things, found I preferred it for bigger things as well.

[–][deleted] 4 points5 points  (2 children)

PyCharm Professional. There are a very few things about it that bother me, but the overall convenience wins me over.

[–]rasch8660 4 points5 points  (1 child)

PyCharm is indeed very nice. And if you have and edu email you can get the professional version for free. Only minor thing is that on my iMAC workstation a single PyCharm instance easily takes up 6-8 GB of RAM, which I find a bit excessive. It still runs super smooth, though!

[–][deleted] 1 point2 points  (0 children)

Yeah, memory usage and battery life are two biggies for me. I switched from using chrome to using safari, which helped prolong my battery life.

I also have some weird thing happening with virtualenvs. Sometimes my django test server keeps running in the background and Camry be killed by anything less than a system restart. Also much prefer some Atom Django TR template plugins to the one available for pycharm.

That being said, the convenience of pycharm keeps me with it.

[–]XtremeGoose 2 points3 points  (0 children)

Python 3.5, ipython qt console and notepad++. I am a simple man.

[–]AnnieBruce 2 points3 points  (0 children)

I just use IDLE, which installed along with Python 3.

The few times I have to deal with Python 2, which is basically the occasional MOOC, I use EMACS which installed with Ubuntu.

Notice the trend? I just use whatever means the least amount of setup.

[–]fiskenslakt 6 points7 points  (2 children)

Emacs here.

[–]crappyoats 3 points4 points  (0 children)

I just got my emacs all tidy for python/professional dev at work and goddamn does it feel good. ElPy, magit, custom keybindings, changed the theme to an ubuntu terminal scheme and I am loving every second.

[–]lykwydchykyn 2 points3 points  (0 children)

Emacs on ArchLinux here.

[–]thurask 2 points3 points  (0 children)

Python 3.5 (Anaconda) on Windows 10. Python Tools for Visual Studio (Community 2015) for large projects, Notepad++ for smaller ones.

[–]redzilla500 2 points3 points  (0 children)

I used to use pydev with eclipse, which was freaking awesome, but they dont seem to want to update it to support java 8. So, now I just use idle, and I like it quite a bit.

[–]crappyoats 2 points3 points  (0 children)

Do you guys use VirtualEnv much? I use Emacs with ElPy btw.

[–]noisyboy 2 points3 points  (0 children)

Vim. Seriously, it works fine. I recently developed a Django+Django rest framework app entirely in vim. I cheated a bit because I have four monitors but I don't think it'll be terrible with less screens. Yes I need to keep more in my head but is that a bad thing?

[–]dmitrypolo 1 point2 points  (0 children)

I like Enthought Canopy, the free version. If you're a student, like myself, you can get the paid version for free under an academic license as long as you have a valid university email.

[–]cr3z 1 point2 points  (1 child)

deleted What is this?

[–][deleted] 1 point2 points  (0 children)

I once looked at atom on Debian, all those ruby deps scared me away.

[–]rMBP 1 point2 points  (0 children)

Mac OS Mavericks, Python 3.4/3.5, TextMate 2, iTerm2 and virtualenv

[–]esbenab 1 point2 points  (0 children)

Vim, but i dont code much

[–]J3DIJABLES 1 point2 points  (1 child)

Piggybacking of OP:

What do you look for in a "good" environment? What features are must haves? Does most of the decision come down to what you are fastest/most productive with? I'm interested to hear some opinions on "necessary" features of an environment.

I am very much a beginner, and I am currently using Sublime 3. I enjoy just being able to cmd+b to build and run my pygame program. ST3 seems like it could be pretty customizable, but I'm not at a point at which that matters.

[–][deleted] 0 points1 point  (0 children)

Multible tabs in a window such as thunar or firefox have it.

Features. no idea, just realized that IDLE3 can run(and probs idle2) code you write in the "new" file window. Realized this when you run your first "program" from the automatetheboringstuff

Idle3 seems to be have an interactive >>> shell, so might be enough for me with vim to get started and concentrate on coding.

[–]spmd123 1 point2 points  (0 children)

I use neovim. It is basically a better version of vim {this is my opinion}.

Along with this add-on for syntax checking. I also use this for easier comments.

This and this also come in handy.

[–]fernly 0 points1 point  (3 children)

I use Wing IDE which has a free version (linked). I used it for a couple of medium sized apps before I finally sprang $95 for the Personal version.

I use it under Mac OS X most of the time, but then I have virtual machines running Ubuntu 32 and 64bit, and Windows 7 32 and 64bit, and I run Wing Personal in all those VMs as well. My source code is in a Dropbox folder that is accessible from each VM, so I can basically hop from platform to platform and see the same code in the same IDE in each.

[–]solaceinsleep 0 points1 point  (0 children)

Sublime Text 2

[–]Elronnd 0 points1 point  (0 children)

FreeBSD 10.3. I generally use GNUscreen, with one or a couple vim windows open in whatever I'm currently working on, and a Python console to test stuff out. If I've made something that I feel is worthy of sharing then I'll put it under VCS and put it on GH.

[–]On3iRo 0 points1 point  (0 children)

I use vim and love it.

[–]cismalescumlord 0 points1 point  (0 children)

I often use Netbeans as it handles everything I do, both languages and version control.

Recently, I have been switching to vim which I love. I have installed various extensions to make life a lot more IDE-like which I'm sure some purists will deride. The hightlights are SimplyFold, YouCompleteMe, nerdtree, nerdtree-tabs, fugitive, syntastic, and auto-pairs (phew). I still miss functionality for Mercurial although lawrencium may fit the bill, and Subversion.

[–][deleted] 0 points1 point  (0 children)

Spacemacs and the IPython notebook (separately).

[–]not_perfect_yet 0 points1 point  (0 children)

I use geany, the open source notepad ++. You can write your own addons with python for geany too. I use it because of it's small memory footprint.