@# 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> why not write a parser kbrooks
<1> joe_k: words is a object that when called on returns "\w". pretty simple
<1> joe_k: well, not simple as that
<0> so what is its argument for
<0> wouldnt that be
<2> how can I loop through a list backwards?
<1> joe_k: zero_or_more = "*".
<0> zero_or_more(words)
<2> I used to know this, but it's been some time since I've coded in Python
<1> joe_k: that order doesn't make sense
<0> zero or more = lambda expr: return expr+"*"
<2> hi kbrooks, long time
<0> its not hard to make a recursive descent parser
<1> robotgeek: hi. here to ping me?
<3> waltz: reversed(list)
<4> kbrooks: nope, general python question



<1> robotgeek: ask it.
<4> kbrooks: i was about to
<0> kbrooks: how does it not make sense? * can be applied to any regex.... zero_or_more(any_regex) -> any_regex + "*"
<5> what is PyJama made for ??
<1> HellDragon: what is what made for?
<0> words can't be applied to anything
<5> PyJama module
<1> HellDragon: talking about pyjamas?
<5> noam_, PyJama
<4> i'm trying to import data from a xls file, tab delimited. using the csv module imports it as strings, can i specify the data contained as numberic?
<5> kbrooks, *
<0> consider words(words(...))
<5> google.com
<6> HellDragon: you too
<0> robotgeek> you can convert it yourself with float() int() etc...
<0> robotgeek: or decimal.decimal() which is better than anything excel has for monetary computation
<4> joe_k: i don't want to do it manually for every row etc though
<2> hmm
<7> robotgeek: are you importing from xls or csv?
<4> redir: xls
<7> s/csv/tsv
<7> binary?
<2> I don't think I've ever called the reversed function on an object; how do I iterate through a listreverseiterator object?
<4> redir: but its tab delimited file
<3> waltz: e.g. for elem in reversed(list):
<8> robotgeek, I did the same thing this morning.
<2> thank you
<0> robotgeek: http://deadbeefbabe.org/paste/746
<0> just use that on _everything_
<7> robotgeek: csv.reader(open(file, '\t') or something
<8> robotgeek, what I did was to use a list comprehension on the resulting list and convert the data.
<7> default to ',' you need to tell it to use a \t
<4> http://deadbeefbabe.org/paste/747 is what is have redir
<8> through a "dialect" cl***
<4> shekmalhen: hmm, do you have some code so that i can better understand
<7> robotgeek: csv.reader(open(file, dialect='excel', delimiter='\t')
<7> maybe
<8> robotgeek, is your data all ints, floats or something else?
<4> shekmalhen: all floats
<0> http://deadbeefbabe.org/paste/746
<1> what's a thread safe objject?
<4> redir: i'm able to open the file, and read data. my issue is that all the data is all the 'rows' have string elements
<0> an object that can have its methods called safely even multiple times simultaneously and in parallel
<4> joe_k: thanks, i was wondering if there was something which i could do at the source. thanks for this though!
<8> robotgeek, yeah... what redir gave you will do the trick.
<8> err. not redir but joe_k
<0> ohh i should skip the float part if int worked
<4> hmm, yes. seems such a waste of cpu cycles.
<4> joe_k: can handle it from here though :)
<1> what's a thread safe object?
<0> waste of cpu cycles???? you're reading a csv??? you know how slow the disk is right?
<1> joe_k: ?
<4> joe_k: heh, i was wondering if i could specify something while importing it :)
<9> If anyone here would like to have a little talk on Skype, please contact me. Thanks a lot.
<5> apple Py
<10> Im trying to create an array and getting confused.. can someone help.. http://pastebin.com/771176
<8> I see that :)
<8> what are you trying to do?



<8> first [] create a list
<10> shekmalhen: I'm trying to do something like this tel['key'] = {'jack': 4098, 'sape': 4167539}
<8> {} create a dictionnary
<8> 'k
<8> so one dictionary per key?
<10> and then be able to loop tel.. so tel['a'] tel['b'] .. same as foreach($foo as $k => $v) in php ...
<8> p_masho, a list can only have integer index
<10> shekmalhen: getting confused with dictionaries, and lists :-)
<3> p_masho: [] is a list, not an array. you should not mix those name,because there is an array module
<8> list index = 0, 1, 2, 3, 4, 5... 100
<8> dict = anything else
<4> http://rafb.net/paste/results/HtCxh427.html is what i came up with.
<10> shekmalhen: so i cant do >> tel[1] = {'jasdadasck': 40958, 'savbbvbnpe': 4139}
<8> p_masho, the right way would be to .append it
<8> tel.append({'jasdadasck': 40958, 'savbbvbnpe': 4139})
<8> if you want a different behavior, you should use a dictionnary instead.
<8> p_masho, a list is ordered and keys are integers and are continous
<8> you cannot say l[25] = ... if there is no element #25 in the list
<10> shekmalhen: lovely.. lovely.. the tel.append works.. but not the way I expected.. can
<8> what do you expect?
<10> what I am looking for is .. let me explain in php terms.. $array['foo'] = array('name' => 'betty','age' => '30'), $array['fbar'] = array('name' => boo','age' => '20')
<4> matlplotlib...hmm, cool!
<8> p_masho, so you're looking for a dictionary then :)
<10> ahh ok...
<8> p_masho, dictionnary are not ordered but the can use any data type that is hashable for its keys
<11> hey everyone
<8> hello, guzzlefry
<8> how you doing?
<11> I'm good
<11> what about you?
<8> Fine, indeed
<5> can i use a rect for a sprite ?
<5> oops, with pygame
<3> gn8
<12> Night, ChrisLong.
<13> how do i substitute a re group? r.sub() looks like it substitutes the whole match only.
<13> oh well, i guess I'll do it with the match object and using str.index with groups()
<3> nouri: http://docs.python.org/lib/node115.html
<3> but now i'm really gone
<14> chrislong
<14> guess what
<12> Chicken butt.
<10> anyone know how to align text left on a gtkComboBox ?
<15> what is the best mysql package for python
<16> ropoctl: psycopg2
<15> heh cool, i already got that when i tried postgres
<15> i wonder if itll have the same problem though
<16> ropoctl: I was being silly.
<15> heh
<16> ropoctl: I was suggesting that perhaps you should use postgres instead of mysql.
<17> one solution is to just not use mysql :-)
<15> yah im giving up on postgres
<16> why's that?
<15> python, pgadmin3, and psql all seem to see like 3 separate databases
<15> its weird
<15> like ill create a table using the psycopg2 interface
<4> while plotting with matplotlib, plot does not plot from 0 (it plots from least value. is there anyway to make it plot from 0)
<1> ropoctl: so you want unification?...
<15> and i wont see it in psql
<0> you are committing right?
<15> and im pretty sure im using the same database
<15> ill stick with postgres i guess
<18> postgres
<0> postgres is fast, featureful, multiplatform... its great
<15> also for some reason, fetching a bytea from the postgres terminates the string at a null character
<15> is there a way around that
<0> hmm
<17> ropoctl: stored in what kind of column?
<15> a bytea column
<16> ropoctl: don't put raw byte data in a character column.
<15> so maybe i told it to make bytea and it somehow decided i really wanted to use a varchar?
<0> bytea is a raw byte column!
<16> how odd.
<4> nvm, you use the axis command for that


Name:

Comments:

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






Return to #python
or
Go to some related logs:

comedi etch install
#linux
couldn't download genpatches
livecd-install hangs
gentoo udev_run_hotplugd failed
#css
ubuntu acer 8200
why you throw chip fucking come on then
nukepuppy
m635 gentoo



Home  |  disclaimer  |  contact  |  submit quotes