IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.67 MB
Powered by
Channel Info
Network: freenodeChannel: #python |
Search in www.irclog.org
Log from #python at freenode 2006-05-20
[19:14]<mugsvw>+it's the script to get the tags from an mp3 file
[19:14]<ajsyl>+the tutorial at python.org is enough for beginning
[19:15]<mugsvw>+I find diveintopython fastwer
[19:15]<mugsvw>+*faster
[19:15]<mugsvw>+and less boring
[19:16]<zzfzmzgmnz>+dunstx I see it I think. Did you have a specific question?
[19:16]<mugsvw>+well
[19:17]<mugsvw>+the script works if I just run it
[19:17]<c2zjjcs>+Anyone want to see a text editor that is crossplatform, simple and easy to use and contribute to?
[19:17]<mugsvw>+it searches mp3s in a folder and get their tags
[19:17]<mugsvw>+jedit
[19:17]<mugsvw>+but if I give a specific file
[19:17]<mugsvw>+it doesn't get the tags
[19:18]<mugsvw>+it doesn't make the dictionary with the tags
[19:19]<mugsvw>+(I'm on windows)
[19:20]<mugsvw>+ah and another thing
[19:20]<cjgzrms>+kbrooks: eclipse?
[19:20]<mugsvw>+I didn't understand well what is self
[19:20]<c2zjjcs>+konrads: no. orwell ;)
[19:20]<mugsvw>+in the classes
[19:20]<c2zjjcs>+konrads: #orwell
[19:21]<ludv>+'self' in python is the same as 'this' in C++
[19:21]<ludv>+It references the instance itself
[19:21]<mugsvw>+yes but
[19:22]<gggyv>+I have a program that creates an instance of sched.scheduler to schedule som task. When I call the .run() method to execute the scheduler, I can't interact with the program anymore because it won't go further before all the tasks are executed. Should I be looking into threads or fork?
[19:23]<c2zjjcs>+zenit: threads, for linux and unix. fork, for unix
[19:23]<c2zjjcs>+zenit: threads:
[19:23]<c2zjjcs>+import threading
[19:23]<cjgzrms>+zenit: threads
[19:23]<c2zjjcs>+threading.Thread(target=sObj.run).run()
[19:23]<gggyv>+oki, thanks.
[19:23]<c2zjjcs>+fork is a bit harder
[19:24]<c2zjjcs>+import os
[19:24]<c2zjjcs>+pid = os.fork()
[19:24]<zzfzmzgmnz>+dunstx ?
[19:24]<mugsvw>+yes?
[19:24]<c2zjjcs>+if pid > 0: # parent
[19:24]<c2zjjcs>+else: # childl
[19:25]<zzfzmzgmnz>+dunstx "but" what?
[19:25]<zzfzmzgmnz>+heh
[19:25]<mugsvw>+no I think i've undestand what is it
[19:25]<mugsvw>+it doesn't explain well self in diveintopython
[19:27]<mugsvw>+def __init__(self, dict=None, **kwargs) <- what are the two * for?
[19:28]<zzfzmzgmnz>+dunstx optional named parameters, which get stuffed into the dictionary named "kwargs"
[19:28]<mugsvw>+mhm
[19:29]<mugsvw>+ah so it's an optional parameter with no default value
[19:29]<mugsvw>+right?
[19:30]<zzfzmzgmnz>+no, it's a container for arbitrary name/value pairs you want to add when calling the function
[19:31]<mugsvw>+so what's the difference between a simple parameter?
[19:32]<mugsvw>+and this
[19:36]<zzfzmzgmnz>+dunstx http://pastebin.com/728358
[19:37]<mugsvw>+k thanks a lot
[19:55]<mugsvw>+I think I've found the problem
[19:55]<mugsvw>+When I try to read the last 128 bytes of the mp3 tags are
[19:55]<mugsvw>+I get this: 'TAGMeet Sue Be She\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Miss Kittin\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00I Com\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x03\x0c'
[19:56]<mugsvw>+why there are all these \x00\?
[19:56]<cn2r2scrf>+nulls?
[19:56]<cn2r2scrf>+i dont know ho id3 tags work
[19:56]<mugsvw>+mhm
[19:56]<cn2r2scrf>+but if the fields are fixed wisdth those are used to pad the strings
[19:58]<cn2r2scrf>+http://www.id3.org/
[19:59]<mugsvw>+k thanks
[19:59]<cn2r2scrf>+np :)
[20:01]<mugsvw>+yes they should be nulls
[20:01]<mugsvw>+but the program should strip them mhmmm
[20:01]<mugsvw>+*script
[20:09]<2rvjc>+can anybody explain me what's the meaning of else in a try except block?
[20:10]<tfk>+that code runs if no exception was raised
[20:10]<2rvjc>+tks
[20:11]<mugsvw>+NameError: name 'os' is not defined
[20:12]<gyacwqt>+dunstx: did you import it?
[20:12]<2rvjc>+import os
[20:12]<mugsvw>+ah lol what module is it?
[20:12]<mugsvw>+thanks
[20:12]<mugsvw>+eh? it's forbidden to say "lol"?
[20:14]<z1v1frvy0g>+Hi. I have one question: If the blocks are determined by the indentation why is the ":" needed? It is redundant, isn't it?
[20:15]<gyacwqt>+well, because, you _can_ do some of if blocks with one line
[20:15]<gyacwqt>+for example:
[20:15]<gyacwqt>+if arg: dosomething(arg)
[20:15]<z1v1frvy0g>+I know. But for multiline blocks
[20:16]<gyacwqt>+well, first of all, what would be the point in removing it from multiline blocks?
[20:17]<z1v1frvy0g>+I wasa thinking about python's philosophy: simplicity and functional syntax
[20:17]<z1v1frvy0g>+*was
[20:17]<z1v1frvy0g>+If there is no need of brackets - remove them
[20:17]<z1v1frvy0g>+if there is no need of the colon - remove it would be the logical conclusion
[20:18]<gyacwqt>+wouldn't it be weird if the docs said this: if you are using multiline ifs, you don't have to add it, however, if you are on a single line, you do
[20:18]<tfk>+r3v3lati0n, Python's syntax does not follow that principle.
[20:18]<tfk>+The Python FAQ says that the colons are there for English-like readability, IIRC.
[20:18]<gyacwqt>+that would simply drive it away from simpilicity
[20:18]<z1v1frvy0g>+TFK: that's a good argument - thx
[20:18]<2rvjc>+some editors would catch : and indent automatically, I guess
[20:19]<mugsvw>+if you think on it, is simpler with the : always
[20:19]<z1v1frvy0g>+yeah, you are right
[20:19]<gyacwqt>+yeah
[20:19]<gyacwqt>+plus..
[20:19]<gyacwqt>+they would have to change it all
[20:20]<z1v1frvy0g>+?
[20:20]<gyacwqt>+class, def, try, except, if, else, elif, and the list goes on
[20:20]<z1v1frvy0g>+I don't get your point... sry
[20:21]<mugsvw>+the list of objects with the : is too long







