@# 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



Comments:

<0> when a SSH tunnel to port 80 is not enough? (to see web content)
<1> import urllib
<1> urllib.urlopen("http://www.python.org";)
<1> AttributeError: 'module' object has no attribute 'urlopen'
<1> wtf?!
<2> squ: don't name your .py source-file `urllib'
<1> aaaaaaa:))))))))
<2> (& delete any .pyc's that you've now created of your .py-source.)
<1> thanks
<1> User-agent: Python-urllib/1.16
<3> I'm p***ing a tuple into a function and then doing arg1, arg2 = myargs .. is there a way to expand the tuple to arguments for the function?
<1> does it reads the data at open moment? or at read() ?
<4> exonic: def func((arg, arg))
<4> squ: at read().
<1> Yhg1s, it creates a socket at open moment? and sends the GET



<4> yes.
<5> exonic: if your tuple is stored in foo, you can p*** your function *foo, and the arguments will be unwrapped.
<1> how can it READ?:)
<1> repeat GET ?
<4> squ: I don't understand the question.
<1> nevermind
<1> its just my curiosity
<4> squ: it sends the request when you open it, and it reads the data when you tell it to read.
<1> Yhg1s, request is the GET
<4> yes.
<1> as server sees GET it sends data
<4> yes.
<1> so, there is the read?:)
<4> what do you mean, 'there is the read?'
<4> when you read, you read data from the socket. the data that was sent in response to the request.
<1> python stores whole get answer into memory?
<4> no.
<4> it doesn't read the data from the network until you tell it to.
<1> http has no another command to read data, except get
<4> it's not a HTTP command.
<1> which is sent at open time
<4> it's reading from sockets.
<1> :)
<4> you're thinking two layers too high.
<1> maybe I should expirience myself in sockets
<6> is it possible to work with Windows' Shortcuts in a manner similar to os.path.islink() on Linux/UNIX?
<6> actually, more importantly I'm looking for a way to extract the filename a given Windows shortcut is pointing at
<6> the Windows equivalent of os.readlink()
<7> foobliss, here's some Delphi that does it: http://delphi.about.com/od/windowsshellapi/l/aa072704a.htm
<4> foobliss: you probably need to use pywin32 for it, but I don't know enough Windows.
<0> do you know a good GUI builder for wxPython? I've been trying boa-constructor but I don't like it much
<8> hi
<7> xrced is decent (http://xrced.sourceforge.net/), I like wxDesigner (http://www.roebling.de/), but it's commercial software
<9> Yango_, there's also wxGlade and Boa Constructor
<9> and VisualWx
<6> hmmm... found site-packages/win32comext/shell/test/link.py... demos a PyShortcut cl***...
<6> I'm wondering though now if there is any useful documentation for the win32* modules... Pydoc shows just signatures, but no actual discussion of the purpose of the various bits... it seems one has to be already familiar with win32 API to use these modules...
<6> is this true or are there some decent docs on what various things do?
<7> foobliss, it comes with a nice CHM
<6> benji, ahh, found it, thanks for the pointer!
<7> glad to help
<0> TFK, why is VisualWx windows only if it's written in wxpython?
<9> I thought it's written in c++?
<0> oh, sorry
<0> misread the icon
<0> you're probably right
<0> :)
<10> how can I use a reserved key word as a variable name?
<10> I'm using a third party tool, and one of the parameters to a function is cl***=""
<11> you can't? :)
<10> but I get errors because cl*** is reserved
<4> byteshack: you can call a function like that by using 'func(**{'cl***': arg})'
<4> or by p***ing it as a positional argument.
<4> but I suggest asking the third party tool to fix their function signatures ;)
<10> cool, leme try that
<9> Yango_, of course, it's still a good question - it's written in wxWidgets etc., so it should be portable...
<0> TFK xrced seems pretty decent, though
<9> Whatever makes you make it to the deadline :-)
<12> reguarding usage of super(), would using the cl*** p***ed into a cl***method work? or is this equivilant to using self.__cl***__ (i.e. wont work with super)



<4> AcidReign: yes, the cl*** p***ed to a cl***method is the same as self.__cl***__
<4> so, no, that won't work.
<12> damn
<4> AcidReign: I use an auto-super cl***, the conveniencyTypeType here: http://www.xs4all.nl/~thomas/python/conveniencytypes.py
<12> Yhg1s: yeah, I was about to implement the example here: http://www.python.org/download/releases/2.2.3/descrintro/#cooperation
<4> (the super-part of it is quite small, the first 5 lines of conveniencyTypeType.__init__)
<4> aye, that's where it's from.
<12> I already implemented, and modified auto property one
<12> there were a few things that could have been done better, I'm ***uming they are because of updates ot the language since 2.3
<4> in what?
<12> (I dont know what was implemented when, I started with 2.4)
<12> Yhg1s: autoprop
<4> what parts could have been done better?
<12> first, I used a set, instead of a dict
<12> rather than dict[key] = 1
<4> sets were added in 2.3 (as a module, in 2.4 as a builtin type).
<4> so that's easily explained.
<12> Yhg1s: exactly my point
<4> what else? :)
<12> I replaced "if name.startswith("_get_") or name.startswith("_set_"):" with "if name[:5] in events:" where: events = ( '_get_', '_set_', '_del_' )
<12> also, I handle _del_ ;-)
<12> the next thing is several lines, I might aswell just paste my version to a pastebin
<12> actually, I just saw where I could replace a loop with a list comp
<4> that's just coding style, then.
<12> I think so anyway, I'd have to test that
<12> Yhg1s: this is my version: http://pastebin.com/638519
<9> ?rex
<12> I replaced the, repeatative, fget = .... fset = ... lines with a loop
<4> what peculiar use of enumerate.
<12> Yhg1s: thank you :-)
<4> why not do 'prop = [ getattr(cls, evt + name, None) for evt in events ]' ?
<12> Yhg1s: that's what I was talking about
<12> I just saw that
<12> comprehensions are still new to me
<12> I'm not used to using them yet
<12> I wonder if this will work: setattr( cls, name, property( *[ getattr(cls, evt + name, None) for evt in events ] ) )
<12> heh
<12> that gets rid of 3 lines, entirely
<4> yes.
<4> but it doesn't improve readability.
<12> true
<4> (I prefer the explicit listing of 'events', rather than looping around the 'events' tuple.)
<12> so you would have the same line 3 times, with different variables being ***igned?
<4> yes.
<4> (4, in my case; my autoprop uses _doc_attr for the property's docstring.
<12> ah
<12> I'll have to add that one
<4> nah; in 2.5, properties take over the docstrings of their fget function.
<4> and that's the most sensible thing to do in this case, too.
<12> ok
<0> and what do you save when actually using the autoprops?
<0> N lines of a = property(_set_a) ?
<12> Yango_: hm?
<4> Yango_: yes.
<4> Yango_: and you gain inheritance.
<0> will 2.5 have autoprops by default?
<4> no.
<12> Yhg1s: why do you have __slots__ in conveniencyType?
<12> heh, neat
<12> I just made that autoprop 4 lines (not including cl*** or def lines)
<12> the actual work is done in 2
<4> AcidReign: conveniencyType has a __slots__ so it doesn't force subtypes to have an instance dict.
<12> Yhg1s: ok..
<12> I don't understand the significance
<4> AcidReign: it prevents arbitrary attributes from being ***ignable.
<4> which is a desireable trait in immutable objects.
<13> is it possible to create pages in the memory and manage them via python? (for testing page replacement algorithms for eg.)
<12> ok, does that force subtypes to be like that aswell?
<4> no, it just allows subtypes to be like that.
<12> ah, ok
<4> if it didn't have a __slots__, all subtypes would have instance dicts, even if they had __slots__


Name:

Comments:

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






Return to #python
or
Go to some related logs:

yaird.deb
qemu convert from iso to qcow
reiserfs md0 warning sh-2006
gentoo i810_drv
#perl
#web
i810 xorg refresh rate lvds
how to unistall fluxbox
#suse
irongland



Home  |  disclaimer  |  contact  |  submit quotes