|
dorkanoid posted:For the record (even if this is an old post, and seems resolved), this is most likely because the target computer needs the Visual C++ 2008 SP1 Redistributable Package (I'm guessing you use Python 2.6.0-2.6.1?) Ah, thanks for that. I wound up going the webapp route instead, but this is good to know for the future.
|
# ? May 15, 2009 06:51 |
|
|
# ? May 9, 2024 18:07 |
|
Are there any performance implications between old-style and new-style classes? Are some things slower or faster with one or the other? And as a related question: a class that does not derive from object (e.g., does not derive from anything) is automatically an old-style class, right?
|
# ? May 15, 2009 11:09 |
|
tbradshaw posted:A novel bit of trivia, and I only call it "just an optimization" because there's no zen-like understanding at the end of the this issue, it doesn't generalize or anything.
|
# ? May 15, 2009 13:29 |
|
I just want to say: fuuuuuuuuuuuck matplotlib. I was using it to make some graphs of timings in Python, and the very act of importing the module somehow hosed up the timer making things appear to be running much faster. (Or maybe it had voodoo powers and really was faster!!)
|
# ? May 15, 2009 23:13 |
|
Avenging Dentist posted:I just want to say: fuuuuuuuuuuuck matplotlib. I was using it to make some graphs of timings in Python, and the very act of importing the module somehow hosed up the timer making things appear to be running much faster. (Or maybe it had voodoo powers and really was faster!!) Weird, how the hell does that happen? Were your timings just stored in a numpy array?
|
# ? May 15, 2009 23:18 |
|
tripwire posted:Weird, how the hell does that happen? Were your timings just stored in a numpy array? Just a regular list. It goes back to normal if I import the module after the timings are done at least...
|
# ? May 15, 2009 23:35 |
|
supster posted:Are there any performance implications between old-style and new-style classes? Are some things slower or faster with one or the other? Yes, but nothing that you should be concerned with. Use new-style classes everywhere; it'll make your life easier than mixing the two. Correct. Janin posted:C++ has a bizarre mixture of both, but C (everything is by-value) and Java/C#/Ruby/Python/etc (everything by-reference) are consistent. C++ does have some consistency. On the other hand, there's always php if you want arbitrarily inconsistent behavior.
|
# ? May 16, 2009 01:24 |
|
can someone help me with using IDLE? im trying to make a compounded if statement if not 1: print('true') else: print('false') for some reason, idle just doesnt like compounded if statements. edit: i fixed it... thank you for reading. it was simple, one should not be consider the logical line to start right after the prompt (>>>) but pretend before it. awesomepanda fucked around with this message at 04:57 on May 19, 2009 |
# ? May 19, 2009 04:53 |
|
sorry for the double post.
|
# ? May 19, 2009 04:55 |
|
Stupid question: how the gently caress do you install pip? I need it to install another python module. Googling brings up a lot of information, but no download link anywhere. The ubuntu repos don't have neither...
|
# ? May 19, 2009 05:56 |
|
nbv4 posted:Stupid question: how the gently caress do you install pip? I need it to install another python module. Googling brings up a lot of information, but no download link anywhere. The ubuntu repos don't have neither... You should be able to download it somewhere and then invoke it like a normal Python script. It doesn't actually need to be installed. If you really want to do it, though, you can always "easy_install pip".
|
# ? May 19, 2009 07:22 |
|
Xenos posted:You should be able to download it somewhere and then invoke it like a normal Python script. It doesn't actually need to be installed. If you really want to do it, though, you can always "easy_install pip". nbv4 posted:Stupid question: how the gently caress do you install pip? I need it to install another python module. Googling brings up a lot of information, but no download link anywhere. The ubuntu repos don't have neither... code:
|
# ? May 19, 2009 08:54 |
|
Found this useful this week.. Just wanted to share http://pypi.python.org/pypi/python-daemon quote:python-daemon 1.4.5
|
# ? May 19, 2009 18:41 |
|
I have never even glanced at a programming language before. So I have decided that I am going to learn python. So far I have just done some really simple basic stuff like the 'Hello World!' and made a number guessing game. Is it safe to say that it ramps up in difficulty rather quickly?
|
# ? May 20, 2009 16:25 |
|
Icesler posted:I have never even glanced at a programming language before. So I have decided that I am going to learn python. So far I have just done some really simple basic stuff like the 'Hello World!' and made a number guessing game. It depends how you are going about learning it. If you are simply copying and pasting code from the internet into a script and then running it to produce "Hello World" and ing, then it may prove difficult. However, if you take the time to actually understand what is going on and work on getting a hang of the general feel of python then it shouldn't be too bad. Be sure to check out the OP with links to some tutorials that I think ease you into it pretty nicely. A lot of people on here recommend Project Euler which is pretty good for learning how to think like a programmer without getting too caught up in the intricacies of the language that you are using. Personal Opinion: give it some time and you will come to love it. Modern Pragmatist fucked around with this message at 16:37 on May 20, 2009 |
# ? May 20, 2009 16:33 |
|
Icesler posted:I have never even glanced at a programming language before. So I have decided that I am going to learn python. So far I have just done some really simple basic stuff like the 'Hello World!' and made a number guessing game. For what purposes are learning Python? It's easy as a programming language gets but a lot of people would argue that learning a language like Python first might make you miss some essential programming concepts since the interpreter does (some of) the dirty work for you.
|
# ? May 20, 2009 17:40 |
|
Pavol Paska posted:For what purposes are learning Python? It's easy as a programming language gets but a lot of people would argue that learning a language like Python first might make you miss some essential programming concepts since the interpreter does (some of) the dirty work for you.
|
# ? May 20, 2009 18:13 |
|
Icesler posted:I have never even glanced at a programming language before. So I have decided that I am going to learn python. So far I have just done some really simple basic stuff like the 'Hello World!' and made a number guessing game. If you take on a hard project, yes. Pick easy projects that are fairly simple to complete. A standard and simple task is to re-implement classic unix utilities like sort or grep. Personally, I would go and look at the turtle module and draw fractals.
|
# ? May 20, 2009 18:39 |
|
tef posted:Personally, I would go and look at the turtle module and draw fractals.
|
# ? May 21, 2009 00:11 |
|
If I want to make a site that's basically only index.py, what's the best way to do that? I'm honestly not quite sure what magic words I should be searching for.
dustgun fucked around with this message at 00:44 on May 21, 2009 |
# ? May 21, 2009 00:41 |
|
dustgun posted:If I want to make a site that's basically only index.py, what's the best way to do that? I'm honestly not quite sure what magic words I should be searching for. django (only sort of kidding)
|
# ? May 21, 2009 00:57 |
|
Pavol Paska posted:For what purposes are learning Python? It's easy as a programming language gets but a lot of people would argue that learning a language like Python first might make you miss some essential programming concepts since the interpreter does (some of) the dirty work for you. I work as an IT support specialist (aka computer janitor) and I don't know any programming. It can be very useful in my job if I at least learn something. Plus with layoffs coming, it wouldn't hurt my resume. So far I am understanding it all pretty well and I am actually finding it kind of fun.
|
# ? May 21, 2009 01:02 |
|
dustgun posted:If I want to make a site that's basically only index.py, what's the best way to do that? I'm honestly not quite sure what magic words I should be searching for. Smaller libraries tend to have fewer users, and correspondingly worse documentation. Even if you decide to move on to web.py or werkzeug or whatever later, Django's a great place to start.
|
# ? May 21, 2009 01:02 |
|
ChiralCondensate posted:Here is the python code that drew my avatar: http://pastebin.ca/1429413
|
# ? May 21, 2009 01:14 |
|
dustgun posted:If I want to make a site that's basically only index.py, what's the best way to do that? I'm honestly not quite sure what magic words I should be searching for. web.py or for a django related 'micro-framework' djng
|
# ? May 21, 2009 03:03 |
|
Does anyone here happen to know the super intimate details of how list(obj) works. list(obj) should be raising a TypeError for me, but it's being caught *somewhere*, presumably in my own code since this used to work. However, right now it's being caught and list(obj) is just returning an empty list. However, list(iter(obj)) is correctly raising the TypeError, so I'd like to figure out what code path lits(obj) actually exercises so I can pursue it. Please don't make me read the C source
|
# ? May 21, 2009 03:42 |
|
ATLbeer posted:web.py or for a django related 'micro-framework' djng I was just coming in here to say that. There's a number of these micro-frameworks out now* that (arguably) duplicate the PHP "a page == a single lump of code" idiom, which is (also arguably) what a lot of people are looking for and the right tool in the right circumstances. * I think "newff" is the name of another one, but on a recent search I found about 4 or more with the same approach. Googling for djng and newff will pick up a few webpages that summarize the lot.
|
# ? May 21, 2009 10:01 |
|
dustgun posted:If I want to make a site that's basically only index.py, what's the best way to do that? I'm honestly not quite sure what magic words I should be searching for. Google App Engine can do this, otherwise you need a server that supports some variety of python in either CGI or mod_python
|
# ? May 21, 2009 21:30 |
|
king_kilr posted:Does anyone here happen to know the super intimate details of how list(obj) works. list(obj) should be raising a TypeError for me, but it's being caught *somewhere*, presumably in my own code since this used to work. However, right now it's being caught and list(obj) is just returning an empty list. However, list(iter(obj)) is correctly raising the TypeError, so I'd like to figure out what code path lits(obj) actually exercises so I can pursue it. Please don't make me read the C source Sylink posted:Google App Engine can do this, otherwise you need a server that supports some variety of python in either CGI or mod_wsgi
|
# ? May 22, 2009 10:16 |
|
Habnabit posted:Does this class implement __iter__ and/or __getitem__? What is the full traceback? The class implements both __iter__ and __getitem__, looking at the C source it appears that only __iter__ would be called. There is no traceback, which is sort of the point. If I switch these exceptions to raise ValueErrors then they propagate though. I think it may just be list() catching a TypeError inadvertantly, in which case I may just have to switch the exception type. EDIT: For those who are looking the issue is that obj.__len__() raises a TypeError, which PyObject_LengthHint interprets as "BAD", which then causes listextend not to examine the iterator. king_kilr fucked around with this message at 15:15 on May 22, 2009 |
# ? May 22, 2009 15:09 |
|
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.
|
# ? May 22, 2009 22:03 |
|
Git posted:If you could educate me on what it is for then I'd be much obliged.
|
# ? May 22, 2009 22:09 |
|
Git posted:If you could educate me on what it is for then I'd be much obliged. If you ever want to write apache extensions in python instead of C, go ahead and use mod_python. For everything else, mod_wsgi is by far a better choice, and especially because it (by default) runs python interpreters as separate daemon processes instead of embedding them all. I have a huge list of reasons not to use mod_python, but here's three good ones:
|
# ? May 23, 2009 02:09 |
|
Not to mention that getting virtualenv working with WSGI is easy as pie, with mod_python it's hit or miss. And you are deploying with virtualenv, right?
|
# ? May 24, 2009 18:01 |
|
Does anyone have any experience with Kamaelia or similar systems? http://www.google.com/search?hl=en&safe=off&client=opera&rls=en&hs=vzK&q=kamealia&aq=f&oq=&aqi=g10 I've been wanting a sort of pipes & processes model, but a little more lightweight than using the os primitives.
|
# ? May 24, 2009 21:51 |
|
tef posted:Does anyone have any experience with Kamaelia or similar systems? No but you may find this blog post by m0nk3yz informative: http://feedproxy.google.com/~r/Jessenollercom/~3/Sf61Y3skZSw/ Part of a series of posts about python distributed libraries that culminated in a Pycon talk: http://us.pycon.org/2009/conference/schedule/event/69/
|
# ? May 25, 2009 00:40 |
|
tef posted:Does anyone have any experience with Kamaelia or similar systems? I'd check it out and see if it fits your need. Also see Fibra by Simon Wiitber
|
# ? May 25, 2009 12:51 |
|
I'm kind of a beginner, and this is my story. I don't get classes. Every time I start a project I think: "Damnit, I'm going to learn what these are good for now." Except, once I start, I end up not using them because I'm comfortable with the way I do things. Basically I worked all the way through Think Python up to the Files chapter. When I got to "Classes and objects" I started reading and then thought "I don't need this poo poo." and then went out and wrote a bunch of scripts. I want to learn them, but similar to how many people need a project to learn to program, I need a reason to use them before I'll learn them. Basically, I want someone to talk me into thinking they're useful for something. Thermopyle fucked around with this message at 16:33 on May 25, 2009 |
# ? May 25, 2009 15:54 |
|
Man I'm still fantasizing about doing a hostile takeover of boa constructor. Delphi-for-python (aka boa constructor) really is the greatest thing ever, but the glacial speed combined with a dude who seems alergic to cooperating with people makes me think that motherfucker needs to be forked. Because a well maintained publically loved boa constuctor would be a dominating bulldozer of a linux IDE. If the free pascal guys (Lazarus, its loving amazing) can do it, why the hell cant python get it right.
|
# ? May 25, 2009 16:09 |
|
|
# ? May 9, 2024 18:07 |
|
Thermopyle posted:I'm kind of a beginner, and this is my story. Of course, there are ways of programming without classes (asides from procedural). And there are people who think that classes are a bad (or not the best) idea. But lots of people think otherwise. so lets take classes as a given and Good Thing. For what it's worth, when I've taught Python, there are students who've had trouble 'getting' classes. So you're not alone. Here are some random things that classes are good for: * New primitives: your programming language comes with strings, integers, and dictionaries built in, assumed. Classes let's you build objects that behave like primitives, like a built in part of the language. * Objects: a lot of programming problems can be broken down into objects easily. A game world has players, equipment, buildings - all objects. It's a very natural way of representing your data - map domain objects to programming objects - and a very natural way to design a program. * Containment and abstraction: Objects also naturally let you hide and contain detail. It doesn't matter what the "inside" of a class is doing, or if that changes. All that matters is the public "face" of the object. Again, there are ways of doing these without classes and objects. Objects just happen to be a natural way of doing it.
|
# ? May 25, 2009 16:50 |