Open Side Menu Go to the Top
Register
** Python Support Thread ** ** Python Support Thread **

11-28-2011 , 10:08 PM
Once you go command promp you never go back. Seriously, IDLE sucks. Ironically, slick GUI may draw you in, but after you program a while, you learn to despise GUI.
** Python Support Thread ** Quote
11-28-2011 , 10:58 PM
I'm still a newb too but I've always hated IDLE. Personally I prefer coding in a text editor (I use Textmate on Mac OS X) for writing scripts etc., and the command prompt/shell for just getting quick and dirty stuff done.

IDLE just feels clumsy/ugly/counter-intuitive to me.
** Python Support Thread ** Quote
11-28-2011 , 11:06 PM
Idle is not very good and I doubt that anyone uses it for serious coding, but it is a pretty good way to get started with Python since it requires no setup or separate install.

I personally either use emacs or WingIDE (professional version, intellisense & debugger with Wing are awesome and it comes with emacs key bindings).
** Python Support Thread ** Quote
11-29-2011 , 01:21 AM
Once my laptop started running slowly and I decided to check Task Manager and saw page after page of processes that IDLE spawned for some reason I still haven't figured out. I thought about manually killing them all but lost count at something like 110. I finally ended up restarting the damn thing.

On a related note, I just found out gedit has a python console plugin. If only I could figure out a way to run my saved python scripts from within it in windows...
** Python Support Thread ** Quote
11-29-2011 , 02:05 AM
intradesting
** Python Support Thread ** Quote
11-29-2011 , 01:16 PM
i use vim + bash. some guys at work like pyscripter.
** Python Support Thread ** Quote
11-29-2011 , 09:49 PM
If I wasn't too lazy / stupid, I would code Python in Emacs, but fml, the setup for Windows is way too difficult for that. There's like 3 downloads plus you have to change the Emacs file to do correct indents and paths and getting it all to work can't be possible. Just not that interested atm.
** Python Support Thread ** Quote
11-29-2011 , 10:02 PM
I looked at it and came to the same conclusion. The stuff that would make Gedit worth it appears to not exist in Windows at all. It really sucks that I haven't seen anything I like enough to switch from terrible IDLE, but the problem is that I'm the only person who ever runs any of my scripts and I spend more time explaining the output in papers than actually coding it so I don't have the motivation to set up anything even slightly complicated. I would probably be burning less time by just saying "**** it" and restarting my laptop every so often, lol
** Python Support Thread ** Quote
11-29-2011 , 10:16 PM
emacs takes about 5 minutes to set up on windows...
** Python Support Thread ** Quote
11-29-2011 , 11:09 PM
Really? Everything I've found says download ropemacs, pymacs, some other stuff, fix the .emac file, point here point there... Ah screw it. I'll research again.
** Python Support Thread ** Quote
11-29-2011 , 11:23 PM
Yeah, that's true. If you install all the goodies it can be a major pain in the arse that will have you pulling your hair out.

I was just talking about barebones emacs which has a passable python mode that works okay.

If you want the grandaddy emacs setup look here: https://github.com/pdee/pdee

Most of the hard work is done for you and it shouldn't be too bad to set up although I haven't done it yet since I already had most of the stuff cobbled together myself.
** Python Support Thread ** Quote
11-29-2011 , 11:43 PM
Yeah, but what do I learn by installing that?

It's more than I remember. Of course I'll work through it one day. If e i pi is interested in posting a TR:

http://www.emacswiki.org/emacs/?acti...rammingInEmacs
** Python Support Thread ** Quote
11-29-2011 , 11:48 PM
What did you learn installing your current text editor?
** Python Support Thread ** Quote
11-30-2011 , 12:21 AM
Apparently emacs doesn't natively support Python versions > 3.0, or at least that's what its error messages just told me.
** Python Support Thread ** Quote
11-30-2011 , 12:28 AM
I don't use 3 but it looks like it should be easy enough to get running from a bit of googling around.
** Python Support Thread ** Quote
11-30-2011 , 03:35 PM
I took a programming course like 7 years ago and for some reason think I remember learning that you shouldn't use If without Else...

Is this true or am I making things up?
** Python Support Thread ** Quote
11-30-2011 , 03:54 PM
definitely not true. completely context-dependent.
** Python Support Thread ** Quote
11-30-2011 , 04:19 PM
I'd have a lot of empty else blocks if that were the case.
** Python Support Thread ** Quote
11-30-2011 , 08:32 PM
The closest thing I can think of is the general advice against doing stuff like this in C:

Code:
if (condition)
     do_stuff();
Because it has the potential to turn into:

Code:
if (condition)
     foo = bar;
     do_stuff();
And now "do_stuff()" is no longer conditional and that may go unnoticed. Python's indenting rules make this impossible though.
** Python Support Thread ** Quote
11-30-2011 , 09:37 PM
That's usually more of a reason to always use curly braces then always have an if statement right?

I would always write :
Code:
if (condition) {
     do_stuff();
}
Can't see any reason to always use an else statement and Stack Overflow says no too
** Python Support Thread ** Quote
11-30-2011 , 10:12 PM
huh, that link is surprising to me. I was working from the assumption that e i pi was misremembering his programming class from 7 years ago and just named the closest thing I can think of. I never would have assumed that someone might have actually told him that.

EDIT: ROFL: http://stackoverflow.com/a/2042730 Note the followup.
** Python Support Thread ** Quote
12-06-2011 , 01:38 AM
Re: the editor discussion earlier, I think I may finally settle on Notepad++ with this thing: http://mpcabd.igeex.biz/notepad-plug...ython-scripts/
** Python Support Thread ** Quote
12-06-2011 , 12:09 PM
kind of a noob to python so apologize if this is a dumb question:

>x = 'sss'
>x.count('ss')
1

whats the easiest way for me to count 'ss' in this string and have the result be 2? it seems count only counts the first 'ss' whereas i need it to also count the second 'ss' that overlaps the first 'ss', if that makes sense.
** Python Support Thread ** Quote
12-06-2011 , 01:03 PM
I'm just a noob but you could use the fact that x[0],x[1],x[2] are all = 's' and write code to loop through and count the number of times x[n] and x[n+1] are equal to 's'

Last edited by e i pi; 12-06-2011 at 01:19 PM.
** Python Support Thread ** Quote
12-06-2011 , 01:47 PM
Quote:
Originally Posted by e i pi
I'm just a noob but you could use the fact that x[0],x[1],x[2] are all = 's' and write code to loop through and count the number of times x[n] and x[n+1] are equal to 's'
ty, was able to figure it out thanks to this thought.
** Python Support Thread ** Quote

      
m