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



Comments:

<0> scorchsaber: for the record, all emacs users smell terrible...
<1> scorchsaber: by the way, emacs comes up with menus and toolbars by default, but nobody, except nobody, uses them.
<2> ok... its python 2.4.2
<2> wow that took long
<1> scorchsaber: you won't get an accurate idea of how emacs works and feels if you think that the menubars are the way to use it. therefore, read the built-in tutorial first.
<3> Jesus Christ--I want to code! How long are the tutorials?
<4> scorchsaber: and for vim, make sure you follow a tutorial too. You'll have no hope if you try to dive in to vi[m]
<1> scorchsaber: vim and emacs are both completely undiscoverable; you must start with at least a short tutorial, and a longer one if you want them to really serve you well.
<1> scorchsaber: if you just want to jump in and start coding, right now, there's gedit and such.
<5> you know you can do this to an open 'file' type:
<1> scorchsaber: emacs and vim will serve you better in the long run, however.
<5> print >>some_open_fp, "Hello World"
<3> Well, I already am coding. With an IDE :/
<4> But with either of them, if you do, they will serve you well. It's disappointing how many programmers stumble through their career without using a decent text editor.
<4> Most important tool of the trade.
<5> is there some way i can allow people to do that to my objects?



<1> that it is.
<5> can i subcl*** <type 'file'> ?
<2> !tor
<1> _chris_: you probably don't want to subcl*** file, but you can do that for your cl***es.
<1> _chris_: http://www.python.org/doc/ref/specialnames.html
<6> What is a .pyo and how is it different than a .pyc? I am building a package on Fedora Core 5 and it builds both .pyc and .pyo, but Fedora Core 4 just .pyc.
<0> ahz: a pyo is an optimised python bytecode file, as opposed to a pyc which is just compiled
<1> _chris_: actually, that's probably not what you want, either.
<5> davidmccabe: ahhh... so if i override the >> operator then i can probably do what i want
<0> last I heard, the optimisation wasn't particularly agressive and was more to do with things like stripping docstrings than code optimisation, but I could be wrong
<5> ?
<1> _chris_: probably print is calling file's write() method.
<2> how do i change my nickserv p***? i did the /msg nickserv ident thing and it told me what the p*** was, but i want to change it
<2> well...
<1> _chris_: no; I think >> is a special form of the print syntax, not a real operator.
<2> nickserv reg, not ident
<5> davidmccabe: hmm...
<1> _chris_: so you'd actually want to implement write() or something.
<0> exiodus: /msg nickserv help set
<7> of course vim is the one true editor
<7> everything else is a fork
<7> badly done
<3> I've uninstalled vim-GTK2 and installed vim-Python so that I can add python scripts--anything else I have to do to program in python on vim?
<6> LeedsHK: I ***ume I should leave both .pyc and .pyo when installing or building an rpm
<5> davidmccabe: i'll take a look. i'm basically trying to pop the write requests onto a queue and then have some listener on the other side of the queue popping the messages off and writing them to disk. multi-threaded logging....
<2> thanks
<0> ahz: if it's binary, you might as well just ship one or the other - pyc is bigger but has documentation...
<1> _chris_: I don't see anything in the docs about emulating a file object.
<7> _chris_ check out Queue module
<7> _chris_ its already thread safe
<0> ahz: and I'm wrong...
<1> _chris_: though I don't exactly see why you want to print to it.
<2> ok... im running python 2.4.2... should i update?
<3> exiodus: No, you're good
<0> ahz: from the man page, using -O *twice* strips docstrings, using it once just optimises - in which case you probably want to ship the .pyo
<7> if its two seperate processes, why not use a FIFO device?
<2> scorchsaber: ok... so i should look at the docs now?
<5> parks: it's more that a library that i'm using (ZSI) logs by print >>some_open_fp, which the caller is supposed to provide. i'm running a bunch of threads in twisted that're LoopingCall's, and every time one of them executes and calls ZSI it opens a fp, calls ZSI for a long method, and then closes the fp.
<6> The part that confuses me is that the python installer (distutils?) records which files it installs, and RPM reads that list. However, the installer omits to tell rpm about the .pyo files
<3> exiodus: Yes. Diving Into Python is good, it's a free book
<0> _chris_: fix the library would be my advice...
<5> parks: i'm running into two threads trying to write to the same file at the same time, so i would like to go to a Queue.
<3> exiodus: I haven't read it personally, but...
<5> LeedsHK: the thought has occurred :)
<2> scorchsaber: ok... ill let you know what i think about it from a newbies pov
<7> _chris_ or the logging module, again threadsafe ?
<3> thanks exiodus :D
<3> exiodus: I only read the tutorial at the docs website, but that's reccomended for programmers with previous experience. I'd be very happy to know how you think the book, and python, is
<5> parks: the problem is complicated by my desire to keep separate logfiles for each "virtual service" i'm providing. if i could just get around the multiple open file problem i'm having i think i'd be ok. to do that i need to something that i can do this to: print >>instance, "yo mama"
<2> scorchsaber: will do... ty for your help
<5> not sure how to do that.... am experimenting now but not getting far
<7> _chris_ logging module will let you do that afaik
<2> scorchsaber: if fox ever loads.......
<7> _chris_ just setup different strema handlers fro each "virtual service"
<7> stream
<5> parks: are you referring to log observers?
<7> _chris_ pydoc logging
<5> parks: hmmm ok...
<8> Anyone know how I can install 2.4 using yum on CentOS 3.5?
<5> parks: does twisted push down to the logging module?



<2> now i should read dive into python 2.4 right?
<7> _chris_ sorry, dont know
<5> parks: k. thanks for your help
<7> _chris_ good luck
<9> anyone here familiar with the win32all extension?
<4> What's the name given for cl***methods like __init__ and __add__?
<10> cratuki: first, cl***methods are a type of method like 'static' in java, but completely different.
<10> second, I call them 'magic' methods. like the markers. you know. the ones you sniff?
<11> anyone here have any experience with urllib2 ?
<12> cant get my regExp to work .. i have to parse a string with this form: <string1>;<string2>;<stringN>; and the most close i got to it was re.search("(.*;)*", rLine) ... the problem with this is that it doesnt separate the groups .. ant help on a match that could help ???
<13> why is xml bad for large scale databases? i.e. scientific computing?
<14> Because it's F'ING HUGE
<7> why not string.split(';') ?
<10> godhammre: because it's not indexed data.
<7> why is xml bad full stop
<14> There are also a lot of answer standardized formats for scientific data
<10> godhammre: you've basically gotta load the entire frigging thing into RAM and iterate through it to figure out what it contains.
<10> it's alright for data transport, but once you recieve the data, you should load it into a real database.
<7> most parsers cnat parse partial documents if it contains an error
<13> jerub: aha!
<12> parks: WOW !! thats a solution !!! thx ..
<13> pubchem has all their chemical data in xml format
<13> so I need to extract the strings I want, build database, and search through lots of strings (3million)
<13> does that sound reasonable?
<13> any recommendations?
<14> PyXML?
<13> CHodapp: That will let me parse the results, what about when I build my own database?
<14> Something SQLish maybe...
<4> Jerub: so you're telling me that they're like static methods yet completely different. I can't see at all how they're like static methods. The reason I wanted a name for them was so I knew where to look up the documentation for them.
<10> cratuki: they're like static methods in that they're not p***ed an instance of the cl***.
<10> cratuki: instead, they're p***ed the cl***.
<4> They are p***ed an instance of the cl*** though. __init__(self)
<10> no, there were two things I said.
<13> CHodapp: what libraries let me use SQL?
<10> one: cl***method doesn't mean what you think it means, two, methods like __init__ and __add__ are magic methods.
<14> I dunno, but there are probably a wealth of them out there.
<10> godhammre: psycopg2 is a postgresql interface module.
<15> godhammre: depends on the db to use..
<4> jerub: cl*** method means to me 'a method for a cl***'. I suspect you'll have difficulty arguing with this definition.
<14> now a static method is what?
<15> CHodapp: MySQLdb is the mysql package iirc, pysqlite for sqlite
<15> oops sorry, godhammre
<15> hmm sorry CHodapp, ment for godhammre :s
<13> errr:jerub: thank you
<16> is it possible to format output to be in columns with builtin functions or modules
<17> ObsidianX, '%-20s|%20s' % ( 'foo', 'bar' )
<16> ah neat
<16> thanks
<7> cx_Oracle
<18> How might I run an external program in python, and then redirect the stdout/stderr stream to something I can edit as it p***es? Possible with os?
<11> whats the easiest way to do non-case-sensitive string searches?
<19> os.popen()
<19> What sort of search?
<11> a line by line search of basically a urlobject that im reading data from
<11> trying to match a keyword
<19> Use .lower().
<11> so convert the search query to lowercase as well as the current line im searching?
<19> Sure. Then you can just use in.
<11> in?
<19> print 'bar' in 'foobarbaz'
<11> ah
<11> gotta love python
<11> ive been using the .find()
<11> well for my situation i actually need to use the .find
<11> but yeah,. cool
<11> so just for my own edification, say myLine = resultdata.lower().readline() ? would that be correct
<19> No. .lower() is a string method.
<20> any example link for to print a mysql table into the ctree with pygtk
<11> so i then it would be myLine.lower() = ... ?
<11> or just, myLine = myLine.lower()
<19> myLine = resultdata.readline().lower()
<11> ah
<11> excellent, thanks.
<21> hey, how do I turn an str into a list of characters?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#css
#kde
ERROR: You need the openssl PHP extension to use SMTP/IMAP TLS!
Can't modify list slice in scalar assignment
xgalaga array type has incomplete element type
ERROR: `phpize' failed in ubuntu
missing synapic
#css
#linux
gnome-vfs gentoo downgrade dbus



Home  |  disclaimer  |  contact  |  submit quotes