| |
| |
| |
|
Page: 1 2
Comments:
<0> while 1: <0> ... <0> or better yet <0> just change the xmbc.Player().play() line to: <0> while xmbc.Player().play(): <0> p*** <1> xmbc is the greatest app ever, just thought I'd share that <2> lol yes it is <2> almty u coing for that? <1> no, just started learning python so I can make some admin scripts for my linux box <1> I might start coding for xbmc if I can think of something useful to do <2> u can help me very quick if u like :D <2> its not hard, just finishing off my script <1> heh I know very little about python or coding for xbmc <2> u know more than me..... ZERO :P <2> http://pastebin.com/735773
<0> daveyboy: what do you need? <2> take a look at that, if u can help get it so it randonly picks another playlist when playback is done, ill be well gratefull <1> so far I know print "hello world" <0> daveyboy: random.choice(playlist) <2> i got that scrtip so it randomly picks playlist and plays through, but wnat it 2 loop after it reaches end of playback, so it chosses another playlist <0> random.choice([a, b, c]) returns a random item from the list <1> when do you want it to end? never? <2> earle, i know F all, could u paste bin me what i have 2 do. sorry 2 be a noob, cding aint my bag, CAD is <0> for song in os.listdir('/path/to/music'): <1> does python have events? <0> playlist.append(song) <1> does an event fire when .play() finishes? <0> while 1: <0> xmbc.PlayerList(0).load(random.choice(playlist)) <0> xmbc.Player().play() <0> ***uming XMBC .play() blocks of course <3> no one's going to just write your script for you <3> (this is what most of the XMBC users who join here do) <0> oh :) <0> well that's basically 99% of his script so ohhwell <2> its not writing my script, its just finishign it off <1> Daveyboy: can't you make a queue of playlists in xbmc? <2> yes i think so <1> then why not just do that? <2> and get it 2 randomize them..... <2> not bad plan <0> song = random.choice(playlist) <3> you may note that was what I answered when you first asked that question ... <0> yeah daveyboy, we've now written your entire script like three times here. <0> why dont you go read what we said, and come bac kwhe nyou udnerstand it. <2> lol right give me 20 mins :P cheers guys, sorry 2 be a pain <1> python uses short circuit logic? <4> yes <1> thanks <5> are there any languages that don't? <4> I think pascal may leave it up to implementation <4> someone does <5> haha pascal <3> since there are zillions of languages, I'm sure at least some of them don't have short-circuiting logic operators <5> I suppose <1> damn this "Learning Python" book is goddamned wordy considering it's written for people who know the fundamentals of programming <6> all books are :P <3> yeah, how dare them books contain all those words and stuff <0> lol <0> get Dive into Python <1> they tell you like 4 times "make sure you type 'print' in your files even though you don't have to use it in the line interpreter!" <3> they're doing that precisely BECAUSE it's aimed at a readership that probably doesn't know any programming <7> how come this isn't working? if type(url) != 'str': <3> because type(url) returns a type, not a string <3> if type(url) is not str: ... <7> so I can write str straight out? <7> or list for that matter? <6> yes <7> ok, thanks <1> can you do "type(spam) is not in [foo, bar]" <3> yes <4> whew, good thing you stepped in or I would've said something that would confuse him even more <7> heh <6> if it makes sense you can probably do it :P <1> how good is python at working for databases? I'm learning it primarily to write some db admin scripts <3> bindings for all major SQL databases
<1> it's pretty database friendly though? I'm coming from DAO/ADO <1> are there similar concepts like connections and recordsets? <3> Python is a general purpose programming languages, it's everything friendly <3> sure, in the database bindings <1> k cool <0> xihr: asyncore is threaded right? if i am doing a handle_ this is in it's own thread? <0> so if i get 10 simultaneous connections they are individual threads? <0> right now im doing some handle_'s and upon a handle_close() im explicitly launching a thread.. but it would seem i dont have to do this since asyncore should be aasynchronous and handle each one of these in its own thread internally.......? <0> or is it not threaded, and it's just doing a select on a list of sockets and managing it? <3> no, asyncore is not threaded <3> in fact that's the whole point, it's asynchronous I/O only, avoiding threads <0> yeah ok. <0> thanks. <0> ugh got a small memory leak somewhere <0> bleach <8> How can I create a datetime object from an integer that contains the seconds from 1970? <0> time.gmtime(secs) <0> or if you want localtime.. time.localtime(secs) <3> he asked from a datetime object <3> go through a tuple object, datetime -> tuple -> time_t <9> I am trying to do some abstraction with some cl***es. I want to have a base cl*** method call a more specific child cl*** method but it isn't working - http://rafb.net/paste/results/I6oEmf64.html <3> you're adding self in the argument list explicitly, there's no need <9> tricky! <3> if you're dealing with a normal bound method (self.method(...)) <3> there's no need to include self in the argument list <3> you only need it 1. when defining a method and 2. when calling an UNBOUND method <9> I am a little confused why..ahh okay you just answered my question <3> e.g., Small.sayit(self, ...) <3> but:: aSmall = Small(); aSmall.sayit(...) <9> gotcha <9> Thanks for the quick help! <3> sure <10> does anyone know of any python database libraries that can be installed on windows <0> holy memory leak <0> was 8MB last night, is 1.2GB today! <0> lo <0> lol <11> which app? <11> bittorrent? ;) <11> er, bittornado* sorry <11> ..which leaks memory like a bucket with a huge hole in it <0> nah i have a python app <0> that is apparently leaking memory.. <11> start off with deleting references <0> i think the prob is, im launching a new thread inside of an asyncore handle_close() which goes and does some processing <0> and im ***uming those threads are just not being freed <0> can i "del self" in the thread when it's finished? <0> i can't do a join on it because i cant have asyncore blocking <0> http://pastebin.com/737674 <0> re yason <12> hi earle <12> how are you? <0> trying to figure out WTF this memory leak is coming from <0> http://pastebin.com/737674 <12> have you narrowed it down to something yet? <0> yeah that part <0> seems to be the problem <12> does it leak run-time or shutdown time? <0> the resident size grew from 8MB to 1GB overnight <12> does it leak with asyncore with some minimal implementation? <12> i could imagine it could only reach that if it somehow keeps all the images in memory.. <12> (unless the process is in active use, which i doubt if you're still debugging it:)) <0> it has bigtime active use <0> well, it does a tremendous amount of processing <0> and the retrievers didnt download more than a few items to process <0> so it appears its in the client->server communication <0> in that minimal asyncore implementation that pretty much just receives and sends pickled objects back and forth <0> well.. if i run it from scratch and it retrieves sayu, a million images, its resident size isnt that big.. but if i let it run all night where it's just polling with the server, it grows. <0> so clearly it has to be there or it never would have made it p***ed the retrieving <0> so it has to be in this client->server comm an ddispatcher.. probably in the pickled object receipt or something <0> but not ure where <0> oddly enough, the server talks to 150 clients, and doesnt grow at all <0> lol <12> and FlickrRetriever doesn't look too suspicious?
Return to
#python or Go to some related
logs:
pxe walkthrough ris #photoshop #delphi #red #opengl #computers #delphi t lost power cable, xbox 360 dremmel #solaris
|
|