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



Comments:

<0> >>> locals()[myvar] = 123
<0> >>> boo
<0> 123
<1> so about my problem. i thin i have to create somehow a tuple or list out of the xml file entries and have them expanded in the destination. but how ?
<0> but you shouldn't
<2> If Freenode would allow me to start my alias with a number, that would be lovely
<3> oh well, giving up on it for now. thanks for the help drigz
<4> hi. A quick one: when you are subcl***ing a cl***, you have to call its basecl*** init method in the constructor, in orde to inherit the attributes, correct? Does this apply too when you subcl*** object? (i.e. do I also have to call object.__init__(self) in my constructor?)
<0> NetDreamer_: i don't get what you're trying to do with the data
<5> pindonga: it doesn't do anything, but I read somewhere you should do it anyway
<5> pindonga: altho I think that was related to using super()
<6> pindonga, your choice.
<0> pindonga: you don't need to do it to get the attributes, but you should do it unless you know what it does with its __init__ and want to re-implement it
<1> drigz : u see the xml file entries for text and settings and so on ? i want them to appear instead of the currently hardcoded ones in the destination
<5> (which has issues, apparently)
<7> join #python-br



<8> hi
<8> what's the best way to convert (2006, 3, 2, 22, 7, 34, 3, 61, 0) into 2006-03-02 21:07:45 ?
<0> NetDreamer_: what does _ do?
<9> escuse me. To came back to my problems. the line
<9> Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/soya/_soya.so
<9> mean the symbol should be inside the _soya.so ?
<0> TVSET: time.asctime i think
<1> drigz: _ is for the language translations into other languages
<9> ou that _soya.so look for this symbol ?
<0> TVSET: time.strftime even
<8> drigz: thanks
<1> so the first entrie in ("full", _("full /etc directory")) is what is used inside the code. and the second is what gets translated
<5> drigz: _() is the gettext function, its part of __builtin__ if you have gettext installed
<0> NetDreamer_: http://deadbeefbabe.org/paste/3051 that what you want?
<5> apparently
<0> NetDreamer_: i changed what's appended to self.flist, and then turned that into a tuple and p***ed it as an argument instead of the hardcoded values
<6> The convention of _() for gettext() is used in other languages too. Nice compact way of saying "this string needs to get translated," while letting the developer work quickly.
<1> drigz: mmmh. that looks like what im searching for..
<0> hari`: i used to think it converted strings to unicode
<1> have to test it *g*
<5> hari`: and horribly unpythonic IMO
<6> AcidReign, I'll take a cross-platform, cross-language idiom over a "pythonic" idiom any day of the week.
<6> The world doesn't revolve around python, and python shouldn't demand something different just to be pythonic.
<6> It's a cool language, but have some sense of proportion.
<5> there was even a heated argument to remove _() from PHP at one point (in favor of the actual function name, since '_()' is aliased to 'gettext()')
<10> python is the most important thing since jesus
<10> everybody knows that
<0> i agree with hari`, it's not like it looks that bad
<10> Can someone suggest a small program which will cause PySQLite2 to raise an OperationalError with the message "schema has changed"?
<6> You can even make resource code recognize something like _() around a string, without having to have it look for a fugly keyword.
<11> no matter how fugly a keyword can you come up with, it won't be tenth as fugly as _
<11> by the same token, as many keywords as possible should be removed and turned into cryptic symbols instead
<11> guess you really like perl
<0> pity that python has it's own meaning for _ (a dummy variable)
<6> Oh, I said somethin' against the holy language. Everyone's piling on.
<10> hari`: don't be a pansy.
<12> I prefer the code to be as readable as possible
<12> that other languages sacrifice readability does not make it a good reason even if they do it the same way
<12> if we did stuff the way other language did our for loops would look like for(i=0, i<len(somelist); i++) { item = somelist[i]; dosomething(item)}
<6> I find the tiny unobtrusive _() idiom to be exactly toward that goal. If you're not thinking about internationalization, you just ignore it. If it's an identifier like gettext() sprinkled a hundred times through your code, it makes a much bigger visual stink.
<0> kosh: that's just C-like languages, as opposed to every other procedural language ever
<10> useless, as usual.
<12> drigz: that happens to be a heck of a lot of languages and certainly the most common type
<0> not a majority though
<3> kosh: I like those for loops, they make sense to me ;P i've yet to make sense of python's
<12> I don't want to remember what _() does I want something that I can read and understand
<12> ariqs: for item in seq: dosomething(item)
<0> ariqs: there's a list (or another iterable, but you don't really need to think about it), you do the same thing for each item
<12> I write code where I keep functions to 5-10 lines on average, I use long variable names, clearn function names etc
<13> buonasera
<0> kosh: that's like the argument for replacing the ** operator with a 'raisetothepower' keyword
<12> I want to be able to read and understand as much as possible
<0> you see ** once, wonder what it means, find out, and you're set for life
<12> drigz: import math math.pow(base, exponent)
<12> drigz it is clearer since the namespace tells you a heck of a lot
<6> re = regex('one-a, followed-by-one-or-more-b, ...')
<6> re = r'ab+'
<12> ** does not always mean raise to a power
<12> it can also means takes a keyword arguement, it can even mean take a mapping object apart into keywords to apply to a function
<0> and _ doesn't always mean gettext, but it often does
<1> drigz: thanks. looks like its working now. have to play with it now....



<0> i'm not a fan of *args and **kwargs personally
<6> In fact, it seems with r'' u'' and others, it would be pretty pythonic to add _'' support.
<1> great. u saved my day..
<0> they're too C like for my taste - we're not using pointers, so why should we have that artifact
<1> perfekt. weekend now.. c ya
<9> Yango: does it fit what you are looking for with ldconfig ?
<9> http://www.hmug.org/man/1/otool.php
<0> hari`: or g'', but that doesn't justify the _() function
<5> hari`: no, gettext is not a type, nor does it change the syntax of a string literal, as u"" and r"" do
<12> I would use gettext explicitely
<6> kosh, fine, do that.
<12> if I have to look at a piece of code written five years ago and maintain it I don't want to have to remember that it meant gettext at that point in time
<12> who knows what we will be using 5-10 years from now
<0> for something you potentially call on _every_ string you use, it's a bit OTT
<6> drigz, or OCD ;)
<14> [x]*n creates a list that contains n references to the same x?
<12> do you really want to look back at the code you are doing now and remember why that meant, for something that is probably not even used anymore?
<12> DataBeaver: yes
<14> What would be the easiest way to create copies?
<6> (x,)*n
<12> DataBeaver: why don't you say what x is and then i can answer that better
<0> DataBeaver: [copy(x) for i in range(n)]
<0> after from copy import copy
<15> DataBeaver: list((x,)*n)
<12> it shouuld be copy.copy not just copy, since it is copy you have polluted your namespace and also made it harder to debug later
<0> hari`: why does that copy/
<14> resvmap=[[0]*stuff.Columns]*stuff.Rows
<0> kosh: how have i polluted my namespace? i have a function called copy instead of a module instance called copy...
<12> DataBeaver: so you are trying to make a list of lists that contain 0s?
<14> Yeah.
<14> And change some of them to 1's based on another list.
<12> drigz: because when reading down in the code since you just have the bare word copy it is not obvious if it is in the same module or somewhere else
<15> No problem here, 0 s a singleton, immutable anyway.
<16> I've got here a strange problem with ctypes
<14> Yeah, but the outer list has copies of the same inner list instance
<15> ok.
<16> says OSError: libLoadLibrary.so: cannot open shared object file: No such file or directory
<14> So when I change the first 0 to 1 on some row, it changes on all rows.
<16> whenever I try cdll.LoadLibrary
<14> Which is not quite what I want.
<0> __doc__: broken install?
<16> drigz: setup.py build ran fine, setup.py test said ok, setup.py install put all in place
<14> Although this probably isn't the most efficient way to represent a bitmap either...
<15> Well, [([0] * x)[:] for i in xrange(y)]
<12> DataBeaver: resvmap=[[0]*stuff.Columns for i in range(stuff.Rows)]
<15> Well, [([0] * x) for i in xrange(y)]
<15> Should be ok too :)
<14> Yeah, that works. Thanks.
<16> ldd /usr/local/lib/python2.4/site-packages/_ctypes.so
<16> libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00120000)
<16> libc.so.6 => /lib/tls/libc.so.6 (0x00132000)
<16> /lib/ld-linux.so.2 (0x00524000)
<16> seems in order on all fronts
<16> but this
<16> >>> from ctypes import *
<16> >>> libc = cdll.LoadLibrary("/lib/libc.so.6")
<16> straight from their examples
<16> fails
<12> god I wish from x import * would be removed from the language
<0> __doc__: what platform are you on?
<16> drigz: redhat EL
<0> no package management?
<16> drigz: up2date
<0> well, portage doesn't seem to be creating a libLoadLibrary
<16> drigz: I've got a debian round here, doesn't have libLoadLibrary around either
<0> same error
<16> drigz: trying
<0> hasattr(cdll, 'LoadLibrary') ==> False
<0> it's cdll.load i think
<0> yep, that works
<16> ah, ic
<0> i guess their tutorial is out of date or something
<17> Is there any symmetric encryption shipped with python?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#javascript
+ubuntu repair permissions
#linux
#mysql
foremost gentoo segmentation fault -first and
opensuse repo's howto
ubuntu torrrents
dhpc package universe
#linux
#perl



Home  |  disclaimer  |  contact  |  submit quotes