@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21



Comments:

<0> pianoboy3333: include COPYING file with it in
<1> Could ctypes handle functions that returns pointer to structs ?
<0> in the file*
<2> kbrooks: where can I obtain it?
<0> pianoboy3333: wget http://www.gnu.org/licenses/gpl.txt -O COPYING
<2> ok
<2> kool
<3> Bader: probably.
<1> ironfroggy: probably or you tried ?
<4> ctypes wouldn't be useful without it.
<1> I'm trying to code a minimal binding with it and I'm stuck
<4> Bader: have you considered reading the ctypes tutorial on structs and unions?
<1> yep
<2> kbrooks: is that all I have to do?
<1> it doesn't explain how to handle structures (and pointer) returned by a function
<0> pianoboy3333: no... search fior "How to Apply These Terms to Your New Programs" in the GPL



<2> ok
<3> you should be careful with GNU licensing. i dont think they apply well to non-compiled programs.
<4> Bader: define the struct, set the function restype to the struct.
<0> ironfroggy: the LGPL doesnt
<2> right, bzflag is under the lgpl
<3> kbrooks: i dont think the GPL applies well either. i mean, how do you translate the clauses about linking and such to python?
<5> Yhg1s: the tutorial says "Functions returning structures are not yet supported."
<4> ChrisLong: but 'pointers to other data' are.
<5> oh, i thought bader said his functions returned a struct...
<6> Hi all
<7> hello
<6> How ya doing?
<8> this will sound really newbish, but how can i get the contents of a http_open request ? if i try to print the result i get only the headers
<7> try dir(http_open)?
<7> What module is that from?
<7> (that sounds newbish too ;))
<5> Kousu: it's from urllib2.HTTPHandler
<8> exactly
<0> sradu: URL
<4> sradu: urllib2.open() returns a file-like object. you read from it like it were a file.
<8> aha i understand
<8> thanks you
<9> There are several ways of making Windows GUI's in Python; this I know - but what would be the recommended one to learn? As in, most efficient, least weird - I wouldn't mind a lot of control
<4> evilgod: it's hard to recommend one, it's mostly a matter of personal preference.
<9> If you have the time, could you give me a brief pros & cons between several implementations? :-\ It would feel bad if I'd learn one way and then discover that the other one was just what I wanted all along
<7> WxPython has good reviews; never used it myself, but Guido has even said it's the best one
<4> evilgod: for full control, use MFC and an ***ortment of win32 API's -- but it'll only work on Windows. Otherwise, PyQT, wxPython and PyGTK are all considered good for different rasons.
<4> well, Guido can be wrong quite often.
<4> I don't think there's a "best" GUI.
<9> Indeed
<7> Yhg1s: As in the new "with" statement?
<9> But if the language designer thinks it's good then at least it's structure should be logical
<0> cl*** GUI: def is_best(): return False
<4> Kousu: no, the with statement is fine. it's ifelse that's wrong ;)
<6> wxPython seems fairly nice, only used it briefly though
<4> evilgod: the structure is not the issue.
<0> cl*** PyGTK(GUI): p***
<9> I'll try wxPython first then
<9> I don't have that good expriences with GTK TH
<9> TBH*
<9> It seems my RX on the wireless base is slow.
<10> how do i generate an arbitraraly long list containing zeros. how do i go about doing that?
<7> [0]*n
<6> Can anyone recommend any good python books?
<7> Python Pocket Reference by Lutz (published by O'Reilly) is where I learned
<4> KieranDOA: thinkcspy, byteofpython and diveintopython are all considered good books, for slightly different audiences.
<4> those three are available online, for free.
<6> Thanks.
<10> Kousu: thanks
<7> hippi: But don't extend it to [[0]*n]*m to make a matrix or you'll be confused when changing one element changes all elements in the same column (since you'll made a list containing several pointers to the same internal list)
<6> Im loving python up to now, Its just the little things that are alot different to C im finding hard to get used to, like for loops and logical operators.
<4> KieranDOA: byte of python is probably best suited, then (of those three, anyway)
<9> KieranDOA: C and Python are very distant :-P
<5> KieranDOA: how are logical operators very different (except for the spelling)
<9> KieranDOA: C, the mother of strongly typed languages, and Python, where an object doesn't even have to be an instance of a cl*** (the ducktyping)
<4> they don't return booleans.
<7> I wish I could say a!=b!=c or a==b==c, and that methods weren't wrapped functions in MethodTypes, but other than that it wins
<4> evilgod: eh, C isn't strongly typed.
<9> of a particular cl****
<6> Exactly, theyre spelt differently, its just a case of getting used to.



<9> Yhg1s: It isn't? Err well, it's kind of.
<4> evilgod: nope, not at all. C goes "type? what's a type?"
<6> For instance, earlier, i tried if re.search("[^a-zA-Z0-9]", name) || len(name) < 4:
<4> evilgod: on the other hand, Python *is* strongly typed.
<6> And spent half a hour wondering why i got a syntax error
<4> evilgod: in C, you can treat a variable as if it had another type, and C doesn't mind -- in fact, it's encouraged. In Python, an object always knows what type it is, and it never gets confused.
<5> Kousu: a!=b!=c or a==b==c is valid python
<11> it is?
<11> hrm
<7> But it doesn't do what I want
<7> I want it to work like a<b<c works
<12> Yhg1s: i think he was thinking of type checking
<11> a==b==c does (a==b)==c
<11> or something
<4> ccknope.
<4> eh, ckknight, nope.
<7> Why would you ever write (True!=False)!=True?
<5> ckknight: a==b==c does a==b and b==c
<4> it does 'a == b and b == c'
<11> really?
<11> shiny
<11> oh em gee
<11> oh yea
<11> it didn't do it in Boo right
<5> only difference: b is only evaluated once
<11> Python it does do it right
<11> hooray
<9> Yhg1s: Not that I know a lot about neither, but I was thinking of declaration here -- char[] whatev = { 'h' }; vs. whatev = "h", don't know if I got that C syntax right
<0> what can I do with __get__ ?
<4> evilgod: sure. that's not 'strong typing', though, it's 'static typing'. C is weakly, statically typed. Python is strongly, dynamically typed.
<5> kbrooks: magic :)
<9> Yhg1s: I guess terminology isn't my thing :-\
<7> kbrooks: many things. see http://users.rcn.com/python/download/Descriptor.htm
<4> evilgod: more specifically, in C, variables (names) have a type, whereas in Python, variables (names) are just references to objects, and the objects have the type.
<5> kbrooks: __get__ is an advanced subject.
<9> Yhg1s: Ah, yes
<9> I knew I'd learn something the minute I joined this channel. >_<
<11> for comparison, Perl is weakly, dynamically typed, Java is statically, strongly typed
<4> well, Perl is partially statically typed, too (hashes and arrays)
<9> I like the Java way, static/strong (isn't C# also stat/strong?)
<11> yes
<6> Perl is aweful. I can see why people refer to it as 'write once'
<11> Perl is a write-only language
<7> So 'a == b and b == c' is the same as "a==b==c"? How can you be sure it's not doing "'(a == b) == c'"? Or is it that both ways of writing it are the same, in effect
<13> How could I improve http://deadbeefbabe.org/paste/619 the Python way? (silly os.read/while usage)
<9> PHP too is weak/dynamic, like Perl -- or well, it's getting strongly typed for every release :-\
<4> Kousu: we can be sure because that's how '==' is defined in the language specification, and also because simple testing will show you.
<11> Kousu, a == b and b == c is the same as a == b == c, just be sure not to wrap needlessly in parentheses
<14> you can use dis.dis if you like
<11> evilgod, it's still ugly
<9> ckknight: Depends on the author
<11> yea
<11> it does
<9> I've made cl***es in frameworks that I've been using and maintaining for quite a time now (speaking about PHP now)
<11> PHP allows you to be ugly easily
<9> Yes, that's the main problem
<11> same with Perl
<9> It's inherited from the way it was born though, a set of Perl modules
<14> what did it stand for?
<9> It was PHPFI back then
<9> Personal Home Page (something)
<6> PHP Hypertext Preprocessor
<15> once a function has been defined once within a script, can it be called from anywhere else in that script
<9> PHP currently, PHP: Hypertext Preprocessor, a recursive acronym
<7> pkern: http://deadbeefbabe.org/paste/619
<4> MrArmadillo: yes, that's exactly right. Once it has been defined. Keep in mind that Python executes the script from top to bottom, and 'def' is what creates the function.
<9> Much like Linux, "Linux Is Not UniX", although it's been discussed countless times if that's an acronym expanded after creation or not
<6> Damn upgrading python on OS X is a pain in the ***.
<13> Kousu: This wouldn't work.
<7> No?
<13> Kousu: os.read blocks when called with an empty pipe
<7> What are you trying to do exactly?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

device descriptor read/8, error -110
mysql DROP USER 1268
xmkmf gentoo nvidia
#linux
#php
#mysql
bene gesserit pronounce
ubuntu add nm-manager panel
#debian
#perl



Home  |  disclaimer  |  contact  |  submit quotes