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



Comments:

<0> TFK: code too huge for that pastebin (500 lines)
<0> it's being truncated ! :P
<1> truncate away ;-)
<0> it barely fits my 'header' :P
<0> -sheet-
<2> pfote: do you really expect plain text from microsoft? ;P There are alot \0 strings and some info about the file, like what icon to use i guess and which working directory, but it looks pretty ugly to parse
<2> i was hoping there is someone did figure out what all that stuff means so i dont have to redo it ^^
<3> im convinced someone already did it
<4> THC4k: \0 string suggests utf-16 encoding
<4> codecs.open
<4> ('filename.lnk', encoding='utf-16')
<5> is there a module that lets me kill a process by pid?
<4> Just use os.kill
<4> ***uming POSIX
<2> Erwin: ah cool thanks, i just took a quick peek in a text editor and turned away horrified ;)
<4> THC4k: Your text editor may be from the 1980s if it cannot understand utf-16



<2> Erwin: well its scite, it probably just didnt guess the right encoding
<6> hiya guys, i found a really weird but EXTREMELY handy usage for python
<4> No need to guess, windows puts a BOM in utf-16 files
<6> you have a program which writes to files, can be anything, now to extend it, you can use python to monitor the files for changes and handle the changes, using that you can build "app-extenders" which extend apps without changing them, so you can add features to apps without modifying any code :)
<6> for example, you have a blogger account, right? and you make it put the info on your webserver, then, using the toolkit i'm going to create (python-extender), you can add all kinds of features to the blogging system without having to change the code thus you can modify online apps
<6> ^^\
<6> i'm going to write this idea down, hold on a sec.
<4> sounds like the swedish chef filter
<6> swedish chef filter?XD
<1> m0no, I was wrong, tweaking your __cmp__ to accept datetime instances won't help :-(
<6> but i mean you can make it handle all sorts of changes which does things, like.... somebody posts a comment on your blog
<7> TFK: ah...well, its not so bad to create a temporary DatedValue object....thanks for trying though :)
<6> it contains.. err..... a web address with [VIEW] behind it.. then it opens up a webbrowser for ya
<6> bad example, but it is something XD
<6> or, for example, a news system, where it is online, and writing to your webserver. monitor for events and then modify the file when needed.
<6> i can't think up uses for that now but it is handy XD
<8> Where's the thing that tells me the stdlib is /usr/lib/python2.4/?
<9> python -c "from distutils.sysconfig import get_config_vars; print get_config_vars()['LIBDEST']"
<8> I'm gonna be sick
<9> o_O
<10> Question: I'm cycling through several directories and subdirectories. What is the best way to keep track of where I've been and not reprocess the same directoies again?
<8> C_Kode: os.walk
<10> yeah.. hah problem is. this isn't exactly a python question :( They won't allow me to install python on the Windows servers :(
<8> C_Kode: Then you are in the wrong channel, alas.
<4> C_Kode: You can write the python script on your linux machine and use pyinstaller to create an exe file ;)
<10> Yeah, well I was just asking about programming methodology, but python makes everything so damn simple hah.
<10> vbscript lets me list subdirectories, just not subs under the current subs :(
<4> Well, the answer is either recursion or keeping your own stack of visited directories. Although if your system supports symbolic or hard links for directories, you may need to keep additional information.
<11> C_Kode, that seems like a basic recursive problem
<9> They don't teach recursion in schools anymore.
<10> It is. I'm just trying to figure out the best way to handle the data.
<12> Sure they do!
<12> If only they taught when _not_ to use it
<10> alas I didn't go to school...
<10> Unles you count reading 1000 books
<10> unless too
<9> You can still fake a stack-based solution and use iteration instead.
<10> Yes, i just have to learn this crap as I go. I haven't written in vb anything in 10 year.
<10> years
<4> Well, if you use your own or the computer's stack makes no difference except when you want to break iteration and later suspend it
<4> Why so defensive?
<10> Well, I'm a unix admin hah I took this job because they are converting some windows servers to linux. The problem is there are 32 windows servers and 6 unix. But now that I"m here.. hah they are only moving about 5 more servers so now I'm going to be around 27 windows boxes and about 9 linux/tru64 boxes. Not exactly what I wanted
<10> I don't want to learn vb :(
<0> TFK: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA I WANNA DIE
<0> it was latin1 :P
<13> Does anyone know if it's possible to make a Windows screensaver with Python?
<0> filenames are encoded internally/whatever in unicode, but i was reading a file written in 'latin1' encoding
<11> C_Kode, start sending out resumes :)
<0> dammit
<0> Ceran: a screensaver is a exe :P
<10> haha
<1> cadu, and this is why it's important to know what kind of strings you're getting :-)
<10> but this one pays really well and is about 3/4 of a mile from home hah can't beat that part of it.
<0> TFK: but it's kinda braindead in a multibyte enviroment, unicoded filesystem...a program spit LATIN1 data!
<13> cadu: so?
<11> %google pure python windows screen saver
<14> pure python windows screen saver: http://homepage.hispeed.ch/py430/python/index.html
<11> there you go, Ceran
<13> benji: Thanks.
<1> cadu, not everyone uses unicode. Tons of legacy apps, for example.



<0> dammit, winamp.
<0> :)
<0> hate yooooooooou :P
<1> cadu, besides, you STILL need to know what encoding the unicode is stored in!
<0> ahhaha
<0> dammit
<0> i'll add some japanese encoded filenames and see what winamp will spit, gibberish? o_O
<1> it will be, under latin1... winamp 5?
<0> winamp5
<0> under latin1? i don't think it can handle japanese :P
<1> well, let us know :-)
<15> meep
<15> i'm having a bizarre problem with __import__..
<15> running 'import psycopg' works fine, but calling __import__(conf['adaptor']) fails with "cannot find module DateTeim2
<15> *DateTime
<15> both in the same scope
<15> oh, it wasn't in the same scope.
<15> executing 'import psycopg' from __main__ is fine, but from within a module in my package, it fails
<7> do u need mx.DateTime lib installed?
<15> python2.3-egenix-mxdatetime is already the newest version.
<15> python2.4-egenix-mxdatetime is already the newest version.
<15> :<
<4> well, there is no DateTime, but mx.DateTime
<16> I've got a problem... given my paste in http://deadbeefbabe.org/paste/3040/2 ... foo.memberVar doesn't get reset with in the for loop, instead it keeps acumulating values
<16> does this mean i should make foo.memberVar into foo.__memberVar?
<9> No, that means that you should make it an instance variable instead of a cl*** variable.
<16> can you give me an example? I gues i'm thinking in terms of c++ a little bit.
<1> def FooCl***(object): def __init__(self): self.memberVar = []
<16> ahhhh ok, thank you much
<1> instance members are just attributes of 'self' (=this in C++), and what you did made memberVar a cl*** attribute (=static member(?) in C++)
<0> TFK: i'm making a program that converts .m3u playlist --> 'kinda-DVD-audio' ...it's a dvd-video with black video for maximized playback time, mp2 audio, metadata on subtitles...it's running nicely ...just got to get rid of this internationalization issue and it'll be set
<0> TFK: runs on windows using only free/gpl material :P
<1> hmm. doesn't mplayer do that?
<0> TFK: makes you a .ISO you can burn and have a 512-song party at your mp3 disabled playstation2
<0> does what ?
<0> mplayer plays :P
<0> my program generates a dvd from flacs/oggs/mp3
<1> Ah, I see. neat!
<1> Now only if I had a PS2 o.o;
<17> hello everyone. i'm creating a Logger object that keeps track of messages from a running application. It has an optional output stream so the messages can be, for example, saved to disk or printed to the screen. Is the best way to use the output stream to simply try to use it and catch an exception if it's not defined, or have a conditional checking to see if it's defined first?
<0> and it has subtitles...showing 'time' 'position on the list'...AND full song metadata...got it
<0> TFK: any dvd player will do :P
<0> i mentioned PS2 coz it lacks MP3 :P
<1> Now only if I had a DVD player o.o;;
<1> (I should get a DVD drive soon enough, though)
<0> TFK: xine? ogle? powerdvd?
<18> I need to do some very simple xml dom stuff from an xml string... can someone tell me what I should be googling for? it seems like there are a zillion xml modules for python...
<1> berto-, isn't it possible to define it in the beginning of the program first?
<17> Cainus, xml.dom.minidom
<18> berto-: k thakns
<18> er thanks
<19> can i send a command to the system in python?
<20> of course
<21> is there a way to find a list of all modules you can import?
<19> shekmalhen, what method/function do i use?
<17> TFK, I was thinking if the user doesn't want to output to the screen, or to disk the output stream would be None. I suppose if a user does not provide an output stream I can create a fake output object with an empty write() method.
<20> Sonderblade, for use in your program or just for your own information?
<21> shekmalhen: use in program
<20> Absolute0, look at the `os' module. Like os.system
<17> in general, though, is it best to test or to use a try/except block?
<20> Sonderblade, I don't know a method for this. :/
<21> berto-: try/except, but in your case a fake object is definitely best
<17> Sonderblade, cool, thanks!
<20> Sonderblade, have you took a look at pydoc.py ?
<20> Sonderblade, it iter through sys.path to find the modules
<21> shekmalhen: cool thanks
<22> hi fellows, i have this: if ii in a.values(): how can i print out the key from a when i find a match? something like.. a = {'a':'b','c':'d'} when i find 'd' i want to print 'c', is there a way?
<4> keys = [key for key,value in a.iteritems() if value = ii]
<4> that may be a list of 0 or 1 or 200 entries
<4> obviously, this is very inefficient
<22> Erwin, why this is inefficient?
<4> sapo: Because you have to compare your value against every value in a dictionary.
<4> while as searching for a key is fast
<22> Erwin, hum.. i m trying to compare a dict with a list, my list have just numbers, but these numbers are the dict values


Name:

Comments:

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






Return to #python
or
Go to some related logs:

meaning of pollsa
djmount gentoo
HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the reque
#sql
arptype linux
Ubuntu LG monitor out of range
#perl
#gentoo
laod data+mysql
#lisp



Home  |  disclaimer  |  contact  |  submit quotes