| |
| |
| |
|
Comments:
<0> Newb question, how do you get the position of a value in a tuple? <1> convert it to list then .index <0> k <1> tuples are simple things <1> dont really have any functions <1> maybe someone knows why, but not me :) <0> hehe <2> how do I list all files in a directory? <2> I'm reading DiveIntoPython... <3> os.listdir <2> thanks.
<2> when I type "fileinfo." in Komodo (OS: Windows), it pops up suggestions on how to complete it, but when I try to "import fileinfo" it says it doesn't exist. I also forgot how to list the lib search paths. uff. <2> in PythonWin I can import fileinfo. hmm. <2> ah, it was sys.path, not os.path <2> turns out it was a module that came with DiveIntoPython, and that dir was somehow in PythonWin's path.. <4> Just purchased Beginning Python today, hope its good :) <2> I started reading about Python yesterday. <2> so I'm in the annoying stage. <4> what other languages are you familiar with? <2> a bit of Perl.. <2> and I read a book on C# once, but forgot most of it. <4> and what doyou think of python thus far? :) <2> it's different from Perl, but there are also some similarities. it seems pretty nice. <2> trouble is I've been reading and not coding so far, so I forget easily. <4> True, but you'll pick up what you forgot in under a day <4> *most* of the time <4> python isn't as ghastly as perl <4> perl has too many things going on, very few people can claim they know it all <2> I guess you don't have to know it all to use it successfully. <2> for elem in a: <2> mp3file = fileinfo.MP3FileInfo(elem) <2> print mp3file["artist"] <2> how dumb is this really? it surely doesn't work like I expect it to. <3> "doesn't work" isn't really diagnostic <2> in PythonWin, I can set mp3file = fileinfo.MP3FileInfo("C:\\prog\\mp3\\somefile.mp3") <2> I know. <2> and then I can type mp3file["artist"] to print the artist. <2> I'm trying to do the same for a list.. <2> just as practice. <3> we still don't know what "doesn't work" means here <2> File "C:\Python24\lib\UserDict.py", line 17, in __getitem__ <2> def __getitem__(self, key): return self.data[key] <2> KeyError: 'artist' <3> that means that the mp3info dictionary doesn't have 'artist' in it <3> mp3file I mean <2> right. <2> I get this when I "print mp3file": <2> {'name': '01 - Angels & Agony - Darkness (Outside Version).mp3'} <2> and so on, one entry for each mp3. <3> so that's what it has in it <3> it's unclear what your question is <2> yet in PythonWin I get this: <2> >>> mp3file{'album': 'Darkness', 'comment': '', 'name': 'C:\\prog\\mp3\\01 - Angels & Agony - Darkness (Outside Version).mp3', 'title': 'Darkness (Outside Version)', 'artist': 'Angels & Agony', 'year': '', 'genre': 255}
<3> I don't know what fileinfo is so I don't know <3> probably one is finding an ID3 module and the other isn't <3> but that's just a guess <2> guess I should pick something more traditional to experiment with. <2> is there a python equivalent of perl one-liners, such as: perl -le 'print "Hello world"'? <2> uh, I guess maybe just typing python and then issuing commands serves the same purpose. <3> python -c <2> ah. <2> I actually read python -h, but didn't understand what they meant with "program p***ed in as string". heh. <3> how so <3> are you seeing it blank <5> yeah <3> goddamn thing <3> I see it normal, not sure why other people don't see it sometimes <5> ? <5> yeah, now I see it <3> I saw that when you made that commnt <3> comment* <3> only seen this complaint about lost topics in #python, not sure why <6> The servers just aren't synchronized. I joined two hours ago and saw if fine from here. <5> oh <3> ah <6> Which is irc.inet.tele.dk. <5> is that a bug or is it just that the servers aren't set up properly (sorry, I'm don't know much about how this IRC thing works) <3> well it apparently has pretty persistent problems, I see constant complaints about that <6> BlueTurtl: IRC started as an ugly hack in 1988. By now, the original hack is almost gone, while a house of post-it notes has replaced it. <6> It's still better than the original, though. :) <5> (-: <7> hi <7> I have a distutils setup script. When I run 'python setup.py install', it installs the modules into $PYTHONHOME/site-packages, and the data files in their proper location. Since my program is an application and not a module, how can I have it NOT put files in $PYTHONHOME/site-packages? <8> I'm trying to get a function to return a value (or anything),but nothing shows up. I'm using IDLE, what am I missing here? <9> re <5> yason, "re" to? <9> BlueTurtl: those who last saw me talking <5> oh <5> I was wondering if "re" also meant something new because I saw you join and immediately say "re" <9> it means "re" as in re-{appear,turn,...} <9> There might be a nice acronym expansion for it too but I'm not aware of that <9> found on reddit: <9> http://video.google.com/videoplay?docid=-3993578102572669647&q=forklift <9> hilarious especially in contrast to the academic German appearance displayed in the beginnign :) <9> s/gn/ng/ <9> worth watching till the end :) <1> i got that on dvd <9> are there more? <3> that's been floating around, I saw that months ago <1> nope <1> thats all <9> xihr: I live in back time. If you're into something new, here's the GPLv3 draft released just today: http://gplv3.fsf.org/draft
Return to
#python or Go to some related
logs:
#worldcup magnetic sheild partitions #online sql query set minus a subset
#beginner #freebsd #computers #politics 7gay #freebsd
|
|