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



Comments:

<0> haha
<1> bomber098: do you have no other coding experience at all? other languages?
<0> if not, i would suggest that you learn python first before thinking about turbogears :)
<1> I was going to say that, as an experienced coder, I haven't found anything to be nervous about learning a new language :-)
<2> hi.. I was wondering if anyone has done some cool things with rsync in python
<3> rsync?
<3> no I have 0 coding
<3> exp
<3> 0
<3> I hear clisp is good
<2> yes... I want to get a python program to send a buffer to a remote rsync server with a file/path on it
<2> and don't want to save it as a file first if I can help it
<1> iholsman: honestly, I'm not sure from reading the page if http://www.vdesmedt.com/~vds2212/rsync.html is just a wrapper around rsync or not...
<2> the site was down a while ago..
<1> bomber098: then forget turbogears - learn to program first... preferably in python :-)
<2> still looks quite dead



<1> works for me...
<2> connection timed out for me ;(
<1> hmm... it appears not to actually do the network side of rsync at all, anyway
<2> bugger
<2> I'm trying to implement a message-queue type thing.. where one machine gets the message, and then forwards it to another to do the actual work
<1> which makes it a rather useless rsync clone...
<4> Is the Python (2.4) garbage collector fooled by circular references?
<1> okay, what the fsck is wrong with just giving me a tarball, huh? why do people have to drink the Debian kool-aid and use a funky downloading tool?
<4> LeedsHK: lol
<2> Leedshk.. i haven't seen a deb file for months (if not years)
<5> hi
<2> hi bader
<1> iholsman: I'm talking about eggs
<2> those i've seen ;-(
<1> I have no objection to eggs, but when the download instructions for a package consist of "easy_install -U SQLObject" with no link to a tarball, that pisses me off
<4> Okay, having done a newsgroup search, I think the answer to my question is "no".
<4> LeedsHK: that's nice with gentoo... if the installation instructions tell you to "emerge foobar", then after doing so you probably have foobar-$V.tar.bz2 in /usr/portage/distfiles :)
<4> they use unmodified source tarballs (+ loads of patches, if necessary)
<1> Japsu: yup, equally braindead
<4> LeedsHK: works for me :)
<1> I've worked on OS install... I've worked on packaging tools... I've worked on a packaged 'distribution' - and all I want now is a tarball I can build myself
<4> flame the author
<1> his code, his choice, etc. etc. but it's dumb
<4> LeedsHK: err, if you're talking about SQLObject (.org), I found the .tar.gz with no effort
<4> http://cheeseshop.python.org/pypi/SQLObject
<4> the cheese shop link at the download page
<1> no you didn't
<1> 0.8 is current and isn't on the cheeseshop
<4> right
<4> now that's evil
<4> 0.7 is the newest that's in portage
<1> and of course since the news page is undated, there's no way to tell if it's just that it was updated today and the update hasn't propagated yet
<4> back to "flame the author" :P
<1> doing it...
<1> there's also no sign of a (recent) release announcement on the sqlobject mailing list
<1> flame duly sent, except I'm far too polite to make it a real flame
<6> I've got a list, and each of the items contains a '\n', what's the best way to remove them all?
<7> [foo.strip('\n') for foo in bar]
<6> so listname.strip('\n') for...
<6> ?
<1> no
<1> [foo.strip('\n') for foo in whatever_your_list_is_called] will return a new list with the \n removed
<1> list comprehension: learn it, live it, love it :-) (sometimes generator expressions instead)
<6> Oops...
<6> What happens if the list is a self.variable
<6> Wait..
<1> self.variable=[blah blah in self.variable]
<6> AttributeError: 'list' object has no attribute 'strip'
<1> each of the items *is* a string, I ***ume?
<6> Yeah
<1> then what does the line in your code say?
<6> self.alist.strip('\n')
<6> Should I do it this way?
<6> self.variable=[blah blah in self.variable]
<1> because you can't strip a list :-)
<1> strip is a method of string objects, not list objects
<6> Oh
<6> Oh :S I get it lool
<6> So I do a loop and say...
<6> list[counter].strip('\n)



<1> nope
<1> what's wrong with the list comprehension ignacio and I have shown you?
<8> is there an easy way to remove an element from a sequence? like converting [1, 2, 3, 4, 5] to [1, 2, 4, 5]?
<6> Sorry LeedsHK, I'm a bit new..
<7> [x for x in l where not x == 3]
<1> alanic: del list[2]
<10> a.remove(3)
<1> jimmey_: no worries...
<6> So, if I'm trying to remove all cases of '\n' from list self.alist, what would the code look like?
<8> thanks
<1> jimmey_: step back...
<6> .
<6> ?
<1> the construct [f(x) for x in y] returns a list, built by running f() on each element in y in turn
<6> Oh..
<1> so, if string.strip('\n') is what you want to run, and alist is what you want to run it on...
<6> [foo.strip('\n') for foo in whatever_your_list_is_called]
<1> [x.strip('\n') for x in alist] will return a new list consisting of the elements in alist with \n taken off the end
<6> x?
<1> jimmey_: yes, that's what I wrote about 15 minutes ago :-)
<11> Gooood Morning IRC!
<6> Really sorry lool
<1> the name of the variable doesn't matter - it's just a loop variable, like in a for loop
<1> and finally, if you want to overwrite alist with the modified form, just ***ign the result of the list comprehension to it, like: alist=[x.strip('\n') for x in alist]
<6> Damnit, you're clever :S
<1> yes, but in this case it's all down to the inherent coolness of list comprehension :-)
<1> m0no: stop that
<12> :(
<1> oh, and my awesome pedagogic style
<6> One more question about lists...
<6> How would I check if something's _not_ in a list?
<1> "x not in alist"
<6> Thanks.
<13> foo
<14> bar!
<12> manchu
<15> ah! the dastardly foo manchu!
<13> everybody at PyCon?
<16> not me
<16> anything exciting happen?
<15> I heard python2.5 was cancelled.
<14> where is pycon?
<13> dunno. just had the impression not so much going on here.
<15> isn't it in america or someting ;)
<13> texas
<14> texas :-\
<13> is that also america
<13> ?
<14> that's on the other side of the world :(
<15> isn't it in mexico?
<13> it is mexico, isnt't it?
<16> I'm in Japan, so that'd be a pretty long trek for me
<1> pretty far from here too
<1> plus, hometime...
<13> speedi, i heard all talks will be published as casts.
<15> LeedsHK: toodles.
<14> i'm south of japan
<14> so it's even further :P
<15> I'm faar south of japan.
<16> Jerub: aussie right?
<15> yes
<16> You like it there?
<15> yes.
<16> I've always wanted to live there
<15> brisbane is by far the best city in the country.
<15> for weather and stuff.
<15> not so good for jobs, but it's getting better
<16> isn't the whole middle of the island like desert and stuff though?
<12> actually I would say melbourne is better
<15> m0no: sure, if you like having 4 seasons all in one day :)
<12> speedie: ell oh ell - most of the country is dessert
<15> speedie: yep.


Name:

Comments:

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






Return to #python
or
Go to some related logs:

ubuntu vnc before login
raid 5/10/50 defined
Bundle::Freeside
pam_sql imap where realm
nulog tutorial
#perl
hplip sles
linux hw keeps changing
xorgsetup ubuntu
#math



Home  |  disclaimer  |  contact  |  submit quotes