Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Git
Aug 21, 2004

inveratulo posted:

At this point I'm kinda scratching my head. I really want to use Python for this project, but it looks like to do that I will have to use a real python web framework, which just seems like overkill for what was supposed to be a neat and tidy app.

You don't have to use a web framework to use Python for a web-app. You can, if you're so inclined, use Python Server Pages. They pretty much have you writing Python directly in your pages in a manner sort of akin to PHP.

Really though, Django might be overkill but it makes development fly by. I can't recommend it enough, but if you're absolutely certain that it won't suit, you might do well to look at the smaller frameworks like Pylons or CherryPy. Actually, you've a hell of a lot of frameworks you could choose from if any one doesn't suit.

Adbot
ADBOT LOVES YOU

Git
Aug 21, 2004

I use nano through Cygwin. Yes, I apparently do hate myself.

I think I'm going to try to get used to using PyDev now though.

Git
Aug 21, 2004

Mighty Germ posted:

does python not have a do ... while looping structure?
If not, is there a way I can emulate it without having to write my code blocks twice?

It doesn't have one as far as I'm aware, but PEP 315 proposes one.

I guess the equivalent would be:

code:
while 1:
    ...
    if not condition:
        break

Git fucked around with this message at 20:11 on Apr 10, 2008

Git
Aug 21, 2004

Kaluza-Klein posted:

I want the list sorted by the third value in each item.

There may be a better way to do this, but you can do it using your own sort function.

code:
>>> lst1 = ['lol', '1', '3']
>>> lst2 = ['lol', '2', '2']
>>> lst3 = ['lol', '3', '1']
>>> biglist = [lst2,lst1,lst3]
>>> biglist.sort()
>>> biglist
[['lol', '1', '3'], ['lol', '2', '2'], ['lol', '3', '1']]
>>> def asort(x, y):
...     if x[2] > y[2]:
...             return 1
...     elif x[2]==y[2]:
...             return 0
...     else:
...             return -1
...
>>> biglist.sort(asort)
>>> biglist
[['lol', '3', '1'], ['lol', '2', '2'], ['lol', '1', '3']]
This page seems pretty informative on sorting. But yeah, there's probably a better way to do this.

e: damnit.

Git
Aug 21, 2004

the talent deficit posted:

Any idea what I'm doing wrong?

Tell TextMate to use soft tabs, and set the option to re-indent pasted text in its preferences.

e: Actually, you probably don't need to use soft tabs, if hard tabs are your thing.

Git fucked around with this message at 21:28 on Apr 13, 2008

Git
Aug 21, 2004

Kire posted:

I read "A byte of python" and "thinking like a computer scientist," two of the intro-to-python docs recommended on the main website. Does anybody have further reading recommendations for someone still getting into programming and Python? Some simple projects I should try to do?

You might want to check out some of the stuff on iTunes U. I've had some people check out a couple of Stanford lectures on Python and come away happy, though I'm pretty sure they do require a fair amount of prior programming knowledge.

Adbot
ADBOT LOVES YOU

Git
Aug 21, 2004

Habnabit posted:

Fixed. mod_python is not for web applications. Seriously.

If you could educate me on what it is for then I'd be much obliged.

  • Locked thread