| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> Kmirno: the global interpreter lock. <1> Yhg1s: hooo I didn't new that thing existed <1> Yhg1s: that's helping ! than you :=) <0> Kmirno: it's what prevents multiple threads from executing Python code at the same time. <2> AnKiMo: python lacks static typing, so the lesson is to keep your module interfaces simple and stable, use adaptors and facades if you have to <0> Kmirno: be careful when dropping it, though. <3> Looking to make Python my primary language. I just like the simplicity. It does what I need it to do, no fuss. <2> I started with python with version 1.5 ... hated it with a p***ion. it's gotten better <2> still could use better feedback on where indent consistency is broken though <4> sproingie: PyProtocols is something for the bathtub. Lay back and read a while. I will do it this weekend. <3> Any recommendations on a good dead-tree reference? I know about Learning and Programming Python (Love O'Reilly) want to give others a fair shake. <2> what wamd said, except for twisted ... any good books on that? <3> I hear the new Twisted book from O'Reilly is supposed to be good. :D <5> it old <2> i use stackless which obviates twisted's main use, reactors ... but all that protocol stuff looks nice <1> Yhg1s: I had a look at the module code, I can't find anything about that GIL : http://deadbeefbabe.org/paste/677
<2> Kmirno: the GIL is part of the interpreter itself. it just means that regardless of threading, only one thread can actually be executing python bytecode at a time <2> on a single-CPU machine, this is usually not very noticeable since only one thread runs at a time anyway <2> however, if a thread is actually busy receiving data and not blocking on I/O, it's still executing python, albeit in a C function <2> solution is to receive your data in smaller chunks and explicitly yield <0> Kmirno: yes, the code never releases the GIL, so it does not allow other threads to run. <1> Yhg1s: and how can I make it do that ? <1> sproingie: smaller and yield ? <2> the GIL is *really* noticeable on a python webserver on a 4-CPU machine. it's why threading webservers in pure python are kind of a joke <0> Kmirno: http://docs.python.org/api/threads.html#l2h-848 <2> nonblocking ones based on asyncore or twisted fairly well scream however <1> Yhg1s: thx <1> sproingie: thx <3> Ok, so if I have a list of integers I want to out put, I understand join to be a string function, does that mean I need to first convert the elements to string values? Or is there another way? <1> sproingie: yes well I still need psedo parallel execution... <3> Shouldn't have left out that point. But informative none the less. <1> sproingie: or the code will be sooo much ugly <0> wamd: depends. if it's an arbitrary length list, use 'map(str, l)' instead of 'l'. If it's fixed-length, you may enjoy "%s %s %s" % tuple(l) instead. <2> Kmirno: then you'll need to yield. another thread will not pre-empt your receiving thread, only a process or a higher priority thread will <2> Kmirno: and i've no idea if python even lets you set thread priorities <2> Kmirno: or if it will even yield the GIL if you do. thus my recommendation to make the thread cooperate by making your receives smaller and yielding explicitly <2> like i said, i use stackless. posix threads are for the birds <2> Kmirno: it should be a matter of just changing one parameter and adding one line of code <1> stackless <1> I'm sorry I'm unsure of what stackless is. <2> Kmirno: it's a python fork that adds microthreads. which won't help you in your case unless you go async anyway <1> oh* <2> Kmirno: i really suggest learning asyncore. it comes with python <1> yup i'm gonna look at it <1> more closely <3> Thanks, Yhg1s. Very effective. <6> after using easy_install to install a package in site-packages, should that be added automatically to my python path? <7> hi.. someone who can help me with creating a low p*** filter in scipy? somehow I'm stuck <2> FlimFlamMan: it gets added to easy_install.pth, which does some voodoo import hook thing to make it visible to import <7> for example.. in the help of iirdesign it says that the P***band and stopband edge frequencies, normalized from 0 <7> to 1 (1 corresponds to pi radians / sample) <7> but how would it know the sample frequency? i can't specify it <2> math is hard. have a cookie! <7> do you have one? <2> i always have cookies <1> Yhg1s: OMG ! (WO)MAN ! I worked !!! There was a sleep loop in the code I added the GIL release around it and the I/O blocking as recommended in the official doc http://docs.python.org/api/threads.html#l2h-848 : IT WORKS <1> Yhg1s: THANK YOU THANK YOU THANK YOU THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUU <8> if i have: self = None in one of the cl*** mehtods, would that effectivaly destroy the object? <8> or i must set the refence of that object to None? <0> Kmirno: keep in mind that you may just have caused dozens of subtle bugs, depending on what the code does in that sleep loop. <9> ezeki3l: that only changes what the local name scope references in the current stack frame. <0> ezeki3l: it doesn't do anything other than in that specific method. <8> how do i kill it from all references? <1> Yhg1s: nothing, it waits few secs for the server needs more data, there's absolutely nothing python accessed between the GIL release <2> objects cannot self-destruct themselves. don't use the object anywhere and it'll be garbage-collected <2> Kmirno: not yet, wait til you tweak your code. shared state is a ticking bomb (ominous droning music) :) <10> hmm, with Python I can quit programming :-) <11> hi <12> Hi. <11> what would be the best way to say scan a folder and make a list of the files in there? <12> ironfroggy : It's kinda obvious who I am. <2> Solak: scheme would also do nicely for ya there too <9> Solak: be careful if you think you can replace a safe expression evaluated with 'eval' <9> Alphasee: is it? <2> there's a "safe eval" recipe floating around ASPN somewhere <2> safe insofar that it may protect you from most accident. probably defeatable if someone's really determined
<9> Solak: eval can allow execution of arbitrary code, like os.system("rm -fr /") <13> Hey people <9> Alphasee: is that your name on jabber/gtalk as wlel? <10> ironfroggy: ah. I thought is was more like an evaluator for math expressions... <12> Its my name everywhere. <12> Alphasee Alphasee Alphasee <12> ohh hahah <12> I did an rm -r / on an auction computer @ school <12> Nearly got expelled too <1> sproingie: it's not my code, it's some C code thadoes sleep() the gil release is before the sleep() and gets locked back just after ... I mean Can't see how that can mess up anything ... well if the original author adds some stuff in between that access python it could .. but I mean who's that stupid ? Why would he access python in a method that basicly says "wait few secs and return" ?? <12> instead they sent me to therapy :( <9> Alphasee: i rename everyone on my buddy lists as soon as i know their name. <12> Hah. That's cool too. <12> Well, Alphasee is my universal name. <2> Kmirno: if it's in C, it's pretty much atomic to python, so no worries there <9> Alphasee: mine is cooler. <10> sproingie: before I started with Python I looked at C++, Delphi, Java, Icon... I didn't like the OO from the first three at all, but Python looks fine so far. <2> Solak: Icon !! <2> Solak: you must be jonesing for real generators though <14> http://pastebin.com/753635 <- why isnt that giving me base 2? <1> sproingie: In C it is :) <1> Spthank you :) <9> Alphasee: so of the languages you are learning now, which are you taking to the most? <14> anyone <14> its a quick algo <15> Hi there. I've coded a Python XML-RPC server which will be run on something like 5000 computers (Windows, Linux, possibly MacOSX). There are only 4 or 5 clients (possibly a single one), which will connect from time to time to one of the 5000 servers. All works fine but now I want to encrypt all traffic between client and servers. How can I do this ? Should I install a different server certificate on each one of my 5000 servers ? Any hint <15> s about the best way to do this ? <12> iron <16> do you actually need a certificate for that? <15> I don't know. <12> I haven't really started learning anything other than python <12> As soon as I START on C#, I'm going to go full force into it <15> Is it possible to encrypt (securely) all traffic without certificates ? <2> 5000 servers, 4 clients. now that's service. <12> mostly because my college focuses on it <12> Tamere, yes <15> sproingie: can't be done the other way around <17> defcon8, it says Mod 0 <12> it's called "tunneling" <17> shouldn't it be mod 2? <9> Alphasee: i really advocate sticking to python along with it. especially because you can combine forces with python and C# <14> squiggly, u <14> sorry? <15> Alphasee: but I'd need a third party app probably to do this (like stunnel) ? <12> That would be haught == 1 <12> tamere: yes. <14> how is it mod 0? <17> your pastebin <12> Are you trying to byp*** router traffic? <2> stunnel isn't going to do it for http SSL encryption is it? <17> it says, Mod = 0 <15> not all all <15> it's just that p***words will fly in the clear otherwise <12> Oh. <12> Just use a proxy? <2> tamere: why not switch to digest auth? <17> tamere, use MD5 <15> sproingie: no, this is not that sort of p***words <2> heh probably because digest auth is hardly supported anywhere, answering my own q <15> sproingie: I ask an user's p***word, but I MUST receive it in clear form <17> why? <15> but it must not transit in the clear <2> tamere: ah, not http auth ... yeah, that's what SSL is made for. you just need to front-end it with an SSL webserver like apache with mod_python <12> Why is there 303 users in here, when there's 6 in csharp? <2> Alphasee: more in #mono <15> sproingie: how can I frontend 5000 servers ? <2> tamere: with a reverse proxy. squid will do SSL <18> clearly python is better than c# by a factor of 303/6 <9> Alphasee: emphasis on free/open projects here makes microsoft-related channels sparse. <2> tamere: if you don't mind the proxy<->server traffic being unencrypted, you can get away with just about any ol backend <15> sproingie: no it should be encrypted all the time <12> what's mono? <2> only 6 in csharp, goodness... there's probably more in #nemerle. better language anyway ;)
Return to
#python or Go to some related
logs:
deusieeee #centos #nvidia yum localupdate signed cpufreq: change failed with new_state 1 and result 0 #kde xkill fc5 #lisp how to use glxgears in ubuntu multiuniverse in Synaptic for limewire
|
|