Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1]

Author Topic: Python editor  (Read 5430 times)

0 Members and 1 Guest are viewing this topic.

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Python editor
« on: September 08, 2015, 10:35:22 am »
0

Just a question: what editors to people use to write Python code?  I tend to do fairly short-ish (from 100 to 1000 lines, including white space, comments, etc.)  scripts, nothing advanced or fancy.  Right now I use IDLE, which is okay.  I would use Notepad++, except that the carriage return on Notepad++ tends to mess up the indentation levels (the tabs are not the same, or something).  I guess the main thing that would be nice to have is line numbering (like, along the left-hand side of the window, not just the current line/column displayed at the bottom) and text wrapping to window width.  Also vertical lines to indicate indentation level, so you can tell if you're lined up with something further up.

Anyway, just want to see what's out there and what advantages there are.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #1 on: September 08, 2015, 10:36:32 am »
0

Oh yeah, and, running Windows.
Logged

AdamH

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2833
  • Shuffle iT Username: Adam Horton
  • You make your own shuffle luck
  • Respect: +3879
    • View Profile
    • My Dominion Videos
Re: Python editor
« Reply #2 on: September 08, 2015, 01:05:19 pm »
+1

I use vi/vim when possible, but I'm biased ;)

But a lot of the time it isn't possible (or easy) for me. On Windows I use Cygwin a lot of the time for editing executing Python files. (EDIT: wow, typing is hard. I use Notepad++ for editing text) It's not terribly complicated to make it so that your tabs are Python-friendly, and you can easily configure all of the things you said you wanted.

Speaking of that, I'm just finishing up writing a Python script that will automate the Swiss round pairings for my IRL tournament. It may be useful to discuss that around here but probably not in this thread. I can share my source if desired
« Last Edit: September 08, 2015, 01:14:43 pm by AdamH »
Logged
Visit my blog for links to a whole bunch of Dominion content I've made.

pacovf

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3499
  • Multiediting poster
  • Respect: +3838
    • View Profile
Re: Python editor
« Reply #3 on: September 08, 2015, 01:35:06 pm »
0

SublimeText is good but expensive. Gedit is a very nice free one, but I don't know if it has a Windows version.
Logged
pacovf has a neopets account.  It has 999 hours logged.  All his neopets are named "Jessica".  I guess that must be his ex.

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #4 on: September 08, 2015, 01:36:33 pm »
0

I downloaded PyCharm after I posted this.  It seems pretty nice.

I think the problem with Notepad++ is that IDLE/Notepad++ tab differently, so if I start a script in IDLE and later edit it in Notepad++, or copy an excerpt from IDLE not Notepad++, I get indentation errors.
Logged

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4787
  • Respect: +3412
    • View Profile
Re: Python editor
« Reply #5 on: September 08, 2015, 01:44:07 pm »
0

How about PyDev? http://www.pydev.org/
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

Chris is me

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Chris is me
  • What do you want me to say?
  • Respect: +3457
    • View Profile
Re: Python editor
« Reply #6 on: September 08, 2015, 02:12:18 pm »
+2

You can configure Notepad++ to do carriage returns / tabs the way you prefer.  You can set it so the Tab button types a certain number of spaces for example. It's a very flexible program; I use it for all my script writing (mostly short little programs)
Logged
Twitch channel: http://www.twitch.tv/chrisisme2791

bug me on discord

pm me if you wanna do stuff for the blog

they/them

markusin

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3846
  • Shuffle iT Username: markusin
  • I also switched from Starcraft
  • Respect: +2437
    • View Profile
Re: Python editor
« Reply #7 on: September 08, 2015, 02:13:52 pm »
0

I've used both  IntelliJ and PyCharm (same company I think) to code in Python. As a student, I have access to a student license of these IDE's. I like them both.

You can configure Notepad++ to do carriage returns / tabs the way you prefer.  You can set it so the Tab button types a certain number of spaces for example. It's a very flexible program; I use it for all my script writing (mostly short little programs)
Also this.
Logged

sudgy

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3431
  • Shuffle iT Username: sudgy
  • It's pronounced "SOO-jee"
  • Respect: +2706
    • View Profile
Re: Python editor
« Reply #8 on: September 08, 2015, 02:28:29 pm »
0

Hey, I just had this question recently for myself!  I ended up choosing gvim (which comes when you download vim (at least on Windows)).
Logged
If you're wondering what my avatar is, watch this.

Check out my logic puzzle blog!

   Quote from: sudgy on June 31, 2011, 11:47:46 pm

singletee

  • Jester
  • *****
  • Offline Offline
  • Posts: 915
  • Shuffle iT Username: singletee
  • Gold, Silver, Copper, Let's Jam!
  • Respect: +1606
    • View Profile
Re: Python editor
« Reply #9 on: September 08, 2015, 02:39:15 pm »
0

You can configure Notepad++ to do carriage returns / tabs the way you prefer.  You can set it so the Tab button types a certain number of spaces for example. It's a very flexible program; I use it for all my script writing (mostly short little programs)

Specifically, go to Settings → Preferences... → Tab Settings, and check Replace by space.

I like Notepad2 on Windows for small programs and quick edits.
« Last Edit: September 09, 2015, 11:45:21 am by singletee »
Logged

Titandrake

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2210
  • Respect: +2854
    • View Profile
Re: Python editor
« Reply #10 on: September 08, 2015, 03:00:40 pm »
0

For Windows, I used to use Notepad++ (setting tabs = 4 spaces in the settings). I haven't used Sublime but I know a lot of people like it, and it should have an unlimited free trial.

Now, I do work in babun to get a UNIX-like terminal (babun is Cygwin + the packages you usually download manually after installing Cygwin), and use vim in that.

I don't know how IDLE does tabs, but it's an interesting exercise to write a script which converts your source code to the right format (meaning, tabs to 4 spaces, or 4 spaces to tabs, or 2 spaces to tabs, or whatever the standard is.)
Logged
I have a blog! It's called Sorta Insightful. Check it out?

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9701
  • Respect: +10741
    • View Profile
Re: Python editor
« Reply #11 on: September 09, 2015, 10:58:32 am »
+1

Real coders use plain-old Notepad.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

markusin

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3846
  • Shuffle iT Username: markusin
  • I also switched from Starcraft
  • Respect: +2437
    • View Profile
Re: Python editor
« Reply #12 on: September 09, 2015, 12:10:36 pm »
0

Real coders use plain-old Notepad.

Actually not unreasonable for a small collection of scripts with a couple hundred lines of code each. I did something like that for Perl scripts using Gedit. Other than syntax highlighting Gedit and Notepad provide the same features more or less. Gotta love those compile time errors though.

But really, the text editor you choose should be based on how easy and comfortable it is to use. No need to rely on IDE's if you feel that you don't gain anything out of their use.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #13 on: September 09, 2015, 12:24:40 pm »
0

Real coders use plain-old Notepad.

I wrote my undergrad thesis (LaTeX) in Notepad.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #14 on: September 09, 2015, 12:27:00 pm »
0

Real coders use plain-old Notepad.

Actually not unreasonable for a small collection of scripts with a couple hundred lines of code each. I did something like that for Perl scripts using Gedit. Other than syntax highlighting Gedit and Notepad provide the same features more or less. Gotta love those compile time errors though.

But really, the text editor you choose should be based on how easy and comfortable it is to use. No need to rely on IDE's if you feel that you don't gain anything out of their use.

I'm pretty sure notepad does some weird encoding that could be problematic for Python code with the whitespace issue.

I suppose if you author everything in the same editor, it doesn't become a problem, but moving between editors or copying and pasting stuff can cause issues. 
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #15 on: September 09, 2015, 12:31:50 pm »
0

For Windows, I used to use Notepad++ (setting tabs = 4 spaces in the settings). I haven't used Sublime but I know a lot of people like it, and it should have an unlimited free trial.

Now, I do work in babun to get a UNIX-like terminal (babun is Cygwin + the packages you usually download manually after installing Cygwin), and use vim in that.

I don't know how IDLE does tabs, but it's an interesting exercise to write a script which converts your source code to the right format (meaning, tabs to 4 spaces, or 4 spaces to tabs, or 2 spaces to tabs, or whatever the standard is.)

Looks like you can set it in IDLE.  It's possible that when I started learning Python (not too long ago), the code I used for "sandbox" used 2 spaces for tabs or something, so that might be the source of the issues I've seen.

At any rate, the editor in PyCharm seems a lot nicer than IDLE.  I think Notepad++ has a lot of the same features too.
Logged

pst

  • Minion
  • *****
  • Offline Offline
  • Posts: 584
  • Respect: +906
    • View Profile
Re: Python editor
« Reply #16 on: September 09, 2015, 01:16:26 pm »
0

Just a question: what editors to people use to write Python code?  I tend to do fairly short-ish (from 100 to 1000 lines, including white space, comments, etc.)  scripts, nothing advanced or fancy.  Right now I use IDLE, which is okay.  I would use Notepad++, except that the carriage return on Notepad++ tends to mess up the indentation levels (the tabs are not the same, or something).  I guess the main thing that would be nice to have is line numbering (like, along the left-hand side of the window, not just the current line/column displayed at the bottom) and text wrapping to window width.  Also vertical lines to indicate indentation level, so you can tell if you're lined up with something further up.

Anyway, just want to see what's out there and what advantages there are.

Emacs, with the new Python mode since version 24.3.
Quote
A new version of python.el, which provides several new features, including:
per-buffer shells, better indentation, Python 3 support, and improved
shell-interaction compatible with iPython (and virtually any other
text based shell).

I use it for good indentation, highlighting, navigating through code blocks, for running Python from Emacs for good interaction, and because I do everything in Emacs anyway. I don't know if the shell-interaction stuff will work under MS Windows, though. I don't understand what you would want line numbers for though. I sometimes use goto-line to go to a line which yields an error or warning, but I wouldn't want to see those numbers that prominent.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7861
    • View Profile
Re: Python editor
« Reply #17 on: September 09, 2015, 01:19:57 pm »
0

I don't understand what you would want line numbers for though. I sometimes use goto-line to go to a line which yields an error or warning, but I wouldn't want to see those numbers that prominent.

Well, because I don't use a goto-line command; but I guess that would be convenient.
Logged

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5477
  • Respect: +2860
    • View Profile
Re: Python editor
« Reply #18 on: September 09, 2015, 01:41:15 pm »
0

Vi is bae.
Logged

markusin

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3846
  • Shuffle iT Username: markusin
  • I also switched from Starcraft
  • Respect: +2437
    • View Profile
Re: Python editor
« Reply #19 on: September 09, 2015, 01:48:19 pm »
0

Real coders use plain-old Notepad.

Actually not unreasonable for a small collection of scripts with a couple hundred lines of code each. I did something like that for Perl scripts using Gedit. Other than syntax highlighting Gedit and Notepad provide the same features more or less. Gotta love those compile time errors though.

But really, the text editor you choose should be based on how easy and comfortable it is to use. No need to rely on IDE's if you feel that you don't gain anything out of their use.

I'm pretty sure notepad does some weird encoding that could be problematic for Python code with the whitespace issue.

I suppose if you author everything in the same editor, it doesn't become a problem, but moving between editors or copying and pasting stuff can cause issues.
I wouldn't want to write Python code in Notepad for that reason. It does mess up the tanning when switching from Notepad or Gedit to some other text editor or IDE.
Logged

DStu

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2627
  • Respect: +1490
    • View Profile
Re: Python editor
« Reply #20 on: September 09, 2015, 02:46:56 pm »
0

Real coders use plain-old Notepad.
http://xkcd.com/378/

i can't believe I'm post 20 and nobody has posted it yet...
Logged

blueblimp

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2849
  • Respect: +1559
    • View Profile
Re: Python editor
« Reply #21 on: September 10, 2015, 06:17:17 am »
0

I just use Vim for everything because I can't be bothered to learn a new editor every time I'm using a different OS and/or language. (I mainly do C++ and Python, for what it's worth.) GVim on Windows, MacVim on Mac.
Logged

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5477
  • Respect: +2860
    • View Profile
Re: Python editor
« Reply #22 on: September 10, 2015, 09:38:16 am »
0

What's a Mac?
Logged

pacovf

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3499
  • Multiediting poster
  • Respect: +3838
    • View Profile
Re: Python editor
« Reply #23 on: September 10, 2015, 01:20:09 pm »
+3

A type of burger.
Logged
pacovf has a neopets account.  It has 999 hours logged.  All his neopets are named "Jessica".  I guess that must be his ex.
Pages: [1]
 

Page created in 0.052 seconds with 20 queries.