Re: ElementTree Issue - Search and remove elements
Hi, note that it's best to reply to responses you get, rather than starting a new thread on the same topic. It helps in building up context and in keeping details together at one point in the archive for users who run into similar problems later. Tharanga Abeyseela, 17.10.2012 07:47: I need to remove the parent node, if a particular match found. ex: ?xml version=1.0 encoding=ISO-8859-1 standalone=yes? Feed xmlns=http://schemas..xx/xx/2011/06/13/xx; TVEpisode Provider0x5/Provider ItemIdhttp://fxxl/ItemId TitleWWE/Title SortTitleWWE /SortTitle DescriptionWWE/Description IsUserGeneratedfalse/IsUserGenerated Images Image ImagePurposeBoxArt/ImagePurpose Urlhttps://xx.xx/@006548-thumb.jpg/Url /Image /Images LastModifiedDate2012-10-16T00:00:19.814+11:00/LastModifiedDate Genres Genrex/Genre /Genres ParentalControl System/System RatingM/Rating if i found RatingNC/Rating, i need to remove the TVEpisode from the XML. i have TVseries,Movies,and several items. (they also have Rating element). i need to remove all if i found the NC keyword.inside Ratging im using following code. when i do the following on python shell i can see the result (NC,M,etc) x[1].text 'NC' but when i do this inside the script, im getting the following error. Traceback (most recent call last): File ./test.py, line 10, in ? x = child.find('Rating').text AttributeError: 'NoneType' object has no attribute 'text' but how should i remove the parent node if i found the string NC i need to do this for all elements (TVEpisode,Movies,TVshow etc) how can i use python to remove the parent node if that string found. (not only TVEpisodes, but others as well) #!/usr/bin/env python import elementtree.ElementTree as ET tree = ET.parse('test.xml') root = tree.getroot() for child in root.findall(.//{http://schemas.CCC.com/CCC/2011/06/13/CC}Rating;): x = child.find('Rating').text if child[1].text == 'NC': print found root.remove('TVEpisode') ? tree.write('output.xml') The trick is to search for the parent node, then let your code find out if you need to remove it or not by traversing its subtree. Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
This is my prototype portfolio for freelancing. If you have an honest critique, then what, in your opinion, am I good at? https://www.odesk.com/users/~01710ac049863018eb I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). What I feel safe in assuming is that: * You seemingly have a *want* to learn, which in itself is very important. * Your strength is not design. Using bevel and emboss (and a pattern here and there) does not constitute good design. If you're showcasing logo work, I hope you're ready to supply variations that can be used cross-medium. * You're not a game developer (given what I've seen, I highly doubt that you can readily tackle the complexities in game development even in a team environment, let alone solo) Don't lie (this includes stretching the truth). In doing so, you'll mismanage client expectations and simply drive any future prospective clients away. Under-promise, over-deliver ;) As to not flood the list with OT discussion, if you can stay away from the flame wars (I avoid such things, directly or indirectly as it's childish and entirely unprofessional), I don't mind answering questions here and there (just e-mail me directly). I'm not a genius or a guru, but I've had enough experience that I may be of some help in pointing you in the right directions if you're genuinely interested. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Tue, 16 Oct 2012 21:25:38 -0700, alex23 wrote: I really don't get people who feel they need to share their opinion when that opinion is that other people shouldn't share theirs. +1 QOTW It makes me laugh when newcomers to this group stick their head up to chastise us for arguing about the culture of this group. The irony is that that is *precisely* what they too are doing. In an ideal world, we'd all agree on what counts as acceptable behaviour, and stick to it, and discuss nothing but Python coding problems. But we don't live in an idea world, and there are disagreements and people behaving badly, and arguments about such, and meta-arguments about the arguments. Welcome to humanity. And more importantly, welcome to democracy -- this is not a dictatorship, there is no Supreme Glorious Leader who decides what is on- and off- topic, no Thought Police to ban you for straying from the straight and narrow of what is allowed. And thank goodness for that. I've been on lists that do have such policies, and they tend to give lousy advice badly and have a culture of group-think. Sure, it's frustrating to have to hit delete on a bunch of posts you don't care about. But that's true regardless of the topic or the list. Last night I deleted about 300 emails about designing a new asynchronous library that I had no desire to take part in. Did I post an angry screed calling it BS? No I did not, because I'm aware that even if I'm not interested in it, it is a part of Python culture and *somebody* needs to deal with it. I'm just glad its not me. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: This is my prototype portfolio for freelancing. If you have an honest critique, then what, in your opinion, am I good at? https://www.odesk.com/users/~01710ac049863018eb I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. What I feel safe in assuming is that: * You seemingly have a *want* to learn, which in itself is very important. Want to. I'm the most interdisciplinary learner you might have ever encountered in your life. Like you said, you don't know me that well, and this isn't intended to get mean...I just had to get honest with myself without that much ego. * Your strength is not design. Using bevel and emboss (and a pattern here and there) does not constitute good design. It's simplicity within a symbolism, and now that I need money for medical reasons, the work I've done isn't perfect, but it's on par. I know when I see something aesthetically pleasing, and if I like what I have, I'm using the same mindset. If you're showcasing logo work, I hope you're ready to supply variations that can be used cross-medium. These are all portfolio sites of my own, and I'm slowly revising them, just like any other rough draft, and as you can tell I'm asking other people to critique it. * You're not a game developer Not yet, but wait until you see a translated prototype from python/tkinter turned into blender. I'm fond of games, and I try to not mimic, but keep in the same realm of professional. Remember you're looking at rough drafts, and you haven't seen other developments. (given what I've seen, I highly doubt that you can readily tackle the complexities in game development even in a team environment, let alone solo) You mean a GDK with a story line, points, and scores with little cool graphics. Lowly doubt your opinion of that. Don't lie (this includes stretching the truth). In which case have i lied. I'm capable of many things, and that's confidence, not arrogance. In doing so, you'll mismanage client expectations and simply drive any future prospective clients away. Under-promise, over-deliver ;) This I believe in somewhat, but I want to tell the client I can do it, and they're the final inspector who oversees the project. I just algorithm, develop, and deliver their expectations. As to not flood the list with OT discussion, if you can stay away from the flame wars (I avoid such things, directly or indirectly as it's childish and entirely unprofessional), Defending yourself when attacked is a necessity. In business people will run over you, steal your ideas, and take advantage of you, and I can't let that happen in any forum, no matter how childish it can get. I don't mind answering questions here and there (just e-mail me directly). I'm not a genius or a guru, but I've had enough experience that I may be of some help in pointing you in the right directions if you're genuinely interested. I'm a lonely guy, and I like friends. I only flame up in hostile situations. So we can discuss this off list, and I'll accept any advice I acknowledge as being beneficial, and will argu a point I think is valid. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: ElementTree Issue - Search and remove elements
Tharanga Abeyseela tharanga.abeyse...@gmail.com writes: I need to remove the parent node, if a particular match found. It looks like you can't get the parent of an Element with elementtree (I would love to be proven wrong on this). The solution is to find all nodes that have a Rating (grand-) child, and then test explicitly for the value you're looking for. ?xml version=1.0 encoding=ISO-8859-1 standalone=yes? Feed xmlns=http://schemas..xx/xx/2011/06/13/xx; TVEpisode [...] ParentalControl System/System RatingM/Rating for child in root.findall(.//{http://schemas.CCC.com/CCC/2011/06/13/CC}Rating;): x = child.find('Rating').text if child[1].text == 'NC': print found root.remove('TVEpisode') ? Your code doesn't work because findall() already returns Rating elements, and these have no Rating child (so your first call to find() fails, i.e., returns None). And list indexes starts at 0, btw. Also, Rating is not a child of TVEpisode, it is a child of ParentalControl. Here is my suggestion: # Find nodes having a ParentalControl child for child in root.findall(.//*[ParentalControl]): x = child.find(ParentalControl/Rating).text if x == NC: ... Note that a complete XPath implementation would make that simpler: your query basically is //*[ParentalControl/Rating==NC] -- Alain. -- http://mail.python.org/mailman/listinfo/python-list
Re: ElementTree Issue - Search and remove elements
Alain Ketterlin, 17.10.2012 08:25: It looks like you can't get the parent of an Element with elementtree (I would love to be proven wrong on this). No, that's by design. ElementTree allows you to reuse subtrees in a document, for example, which wouldn't work if you enforced a single parent. Also, keeping parent references out simplifies the tree structure considerably, saves space and time and all that. ElementTree is really great for what it does. If you need to access the parent more often in a read-only tree, you can quickly build up a back reference dict that maps each Element to its parent by traversing the tree once. Alternatively, use lxml.etree, in which Elements have a getparent() method and in which single parents are enforced (also by design). Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On Oct 17, 10:22 am, Terry Reedy tjre...@udel.edu wrote: On 10/16/2012 9:54 PM, Kevin Anthony wrote: I've been teaching myself list comprehension, and i've run across something i'm not able to convert. list comprehensions specifically abbreviate the code that they are (essentially) equivalent to. res = [] for item in source: res.append(f(item)) res == [f(item) for item in source] Matrix multiplication does not fit the pattern above. The reduction is number addition rather than list appending. Dunno why you say that. Heres matrix multiply using list comprehensions: from operator import add def dot(p,q): return reduce(add, (x*y for x,y in zip(p,q))) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] which can then be 'reduced' to a one-liner if that takes your fancy -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Oct 17, 11:15 am, alex23 wuwe...@gmail.com wrote: On Oct 17, 2:43 pm, rusi rustompm...@gmail.com wrote: Let me try to restate alex without the barb. Do you offer this service for hire? :) Hmm now thats an idea… Are you offering to hire? [Considering how many jobs Ive changed, never know whats next!] Rusi -- http://blog.languager.org -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, Oct 17, 2012 at 5:24 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: In an ideal world, we'd all agree on what counts as acceptable behaviour, and stick to it, and discuss nothing but Python coding problems. But we don't live in an idea world, and there are disagreements and people behaving badly, and arguments about such, and meta-arguments about the arguments. Welcome to humanity. Every negative is a corrupted version of a positive. Why are there these sorts of arguments? Because people care about the quality of posts. Why have meta-arguments? Because Python programmers have the sorts of brains that are good at (and enjoy) such. And more importantly, welcome to democracy -- this is not a dictatorship, there is no Supreme Glorious Leader who decides what is on- and off- topic, no Thought Police to ban you for straying from the straight and narrow of what is allowed. And thank goodness for that. I've been on lists that do have such policies, and they tend to give lousy advice badly and have a culture of group-think. Correction: Welcome to anarchy. In a democracy, we'd all vote and anyone voted out would be banned. Otherwise, absolutely agree. Sure, it's frustrating to have to hit delete on a bunch of posts you don't care about. But that's true regardless of the topic or the list. Last night I deleted about 300 emails about designing a new asynchronous library that I had no desire to take part in. Did I post an angry screed calling it BS? No I did not, because I'm aware that even if I'm not interested in it, it is a part of Python culture and *somebody* needs to deal with it. I'm just glad its not me. Heh, I'm skipping all those posts too - but I'm confident Python will be the better for that discussion. I'm on many mailing lists. Some quiet, some noisy, some public, some private (and don't knock the private ones - it's WAY better to use Mailman than huge cc: lists), some courteous, some rude. Not one of them is useless to the world. If you don't like python-list, maybe there's another forum that's more to your liking - Python is big enough to have several. :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Fwd: system tray or notification area in python
Hi folks, So I thought I would write a brand new stand alone system tray or notification area in python. I guess I need to use gtk bindings or some such but don't really know what my options are. Where would I start something like this? Any pointers would be greatly appreciated! Why not look at the source code of the current app your using to get an idea how that application accomplishes said task? I actually did that already it's using the C bindings of gtk. I think you are mistaken - if its this one: http://stalonetray.sourceforge.net/ Yes, that's it. I had a quick look into the sources, it does not use gtk at all, it uses low level X11 calls. Programming in this way is very tedious. Sorry, you are right. I was mixing things up, I just remembered it was gtk, apparently it's not. But I have zero experience with gui programming in python. So any pointers would be much appreciated how to implement a system tray in python. Gtk is I guess just one option, one could use other stuff from python but I wouldn't know what the simplest approach is. I'm not sure it is even possible. Usual GUI applications just need to request certain features from their window manager such as the setting the program icon or requesting a certain position on the screen. That is what is implemented in the usual toolits like Tk, QT, and gtk. That is my impression as well, tk, qt, etc, won't be good for this task but I thought there are some sort of X bindings in python that will make writing low level X applications in python possible. For instance a system tray :) A window manager, on the other hand, must be able to recieve and interpret these messages. For a system tray, they are described here: http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.3.html I have not studied the whole interface of the aforementioned toolkits, but I suspect that there is no way around writing low level Xlib code in order to recieve these messages. Right, but nobody wrote Xlib bindings for python? Don't take it wrong, but when you write that you have no experience with GUI programming, I'd start another projet first - I think you will have a tough way to succeed with this project. I certainly wouldn't start with Xlib in C, but if python bindings would be available that would make life much easier. Cheers, Daniel Christian -- http://mail.python.org/mailman/listinfo/python-list -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: Fwd: system tray or notification area in python
Am 17.10.12 09:49, schrieb Daniel Fetchinson: So I thought I would write a brand new stand alone system tray or notification area in python. I guess I need to use gtk bindings or some such but don't really know what my options are. Where would I start something like this? Any pointers would be greatly appreciated! Why not look at the source code of the current app your using to get an idea how that application accomplishes said task? I actually did that already it's using the C bindings of gtk. I think you are mistaken - if its this one: http://stalonetray.sourceforge.net/ Yes, that's it. I had a quick look into the sources, it does not use gtk at all, it uses low level X11 calls. Programming in this way is very tedious. Right, but nobody wrote Xlib bindings for python? Erm, Google is your friend: python xlib turns up http://python-xlib.sourceforge.net/ as well as http://plwm.sourceforge.net/ which is pretty close to what you are trying to do. Don't take it wrong, but when you write that you have no experience with GUI programming, I'd start another projet first - I think you will have a tough way to succeed with this project. I certainly wouldn't start with Xlib in C, but if python bindings would be available that would make life much easier. Everything is easier in python:) because usually python libs are designed with OO and ease of use in mind. Beware that this will be much tougher than using gtkfriends. Christian -- http://mail.python.org/mailman/listinfo/python-list
Re: overriding equals operation
On 17/10/2012 05:16, 8 Dihedral wrote: What you really want is b=a.copy() not b=a to disentangle two objects. __eq__ is used in the comparison operation. The winner Smartest Answer by a Bot Award 2012 :) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
bad httplib latency due to IPv6 use
Hi! I noticed yesterday that a single HTTP request to localhost takes roughly 1s, regardless of the actually served data, which is way too long. After some digging, I found that the problem lies in socket.create_connection(), which first tries the IPv6 ::1 and only then tries the IPv4 127.0.0.1. The first one times out after 1s, causing the long latency. What I'm wondering is this: 1. The server only serves on IPv4, changing this to IPv6 would probably help. However, I wouldn't consider this a bug, or? 2. I don't even have any IPv6 addresses configured and I'm not using IPv6 in any way, so why does it try those at all? 3. Of course I can optimize the code for IPv4, but then I would be pessimizing IPv6 and vice versa... Any other suggestions? Uli Notes: * Using 127.0.0.1 as host works without the delay. * I'm using Python 2.7 on win7/64bit -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On 17/10/12 09:13:57, rusi wrote: On Oct 17, 10:22 am, Terry Reedy tjre...@udel.edu wrote: On 10/16/2012 9:54 PM, Kevin Anthony wrote: I've been teaching myself list comprehension, and i've run across something i'm not able to convert. list comprehensions specifically abbreviate the code that they are (essentially) equivalent to. res = [] for item in source: res.append(f(item)) res == [f(item) for item in source] Matrix multiplication does not fit the pattern above. The reduction is number addition rather than list appending. Dunno why you say that. Heres matrix multiply using list comprehensions: from operator import add def dot(p,q): return reduce(add, (x*y for x,y in zip(p,q))) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] which can then be 'reduced' to a one-liner if that takes your fancy I can golf it down to two lines without losing readability: def dot(p,q): return sum(x*y for x,y in zip(p,q)) def mm(a,b): return [[dot(ra, rb) for rb in zip(*b)] for ra in a] Hope this helps, -- HansM -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 17/10/2012 07:24, Steven D'Aprano wrote: And more importantly, welcome to democracy -- this is not a dictatorship, Putting my pedantic hat on but there are few if any true democracies in the world. Most governments are run on (mis)representative lines. Which reminds me I must restart my campaign to be the first world president. Seven votes at the last count, another 3.5 billion and I'm first past the post. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Personally, I've never taken an IQ test, so I don't know how well I'd score. But I'm a school dropout, never went to college/uni/TAFE/etc/etc, don't have any certifications of any sort. I'm a pretty uneducated fella, according to my reacute;sumhtmlentitiesdontworkhere; (that's resume when folded into ASCII). So according to how most people think about intelligence, I probably have a sub-par IQ. On the flip side, I'm a professional programmer, I run a server where people play Dungeons and Dragons, and I'm a well-respected wordsmith as Dungeon Master. Plus, I work in theatre (in fact, at the moment I'm posting from the bio box, sitting next to the follow spot that I'll be operating for the next two weeks). So I think I have enough muscle upstairs to get through life... But Dwight (and I'll continue to address you as such until you change your mail headers), a LOT of what you're saying is coming across as over-inflated ego. Maybe you are a majorly interdisciplinary learner; but boasting that you're the most interdisciplinary learner [we] might have ever encountered just comes across poorly. One thing I've learned from various groups is that, no matter how X you are, there's someone else who's even more X - for any X. Maybe it isn't true somewhere, maybe you really are the peak - but more than likely you aren't, and it's much more pleasant to be proved better than your claim than to be proved worse. (There are exceptions, of course. I have absolutely no doubt that I am the person most familiar with the RosMud++ code and thus the person best positioned to maintain that project. This is because I wrote it. But I am not claiming to be the best C++ programmer in the world, because there are a lot of other C++ programmers among the seven billion here.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
On 17/10/12 09:55:13, Ulrich Eckhardt wrote: Hi! I noticed yesterday that a single HTTP request to localhost takes roughly 1s, regardless of the actually served data, which is way too long. After some digging, I found that the problem lies in socket.create_connection(), which first tries the IPv6 ::1 and only then tries the IPv4 127.0.0.1. The first one times out after 1s, causing the long latency. What I'm wondering is this: 1. The server only serves on IPv4, changing this to IPv6 would probably help. However, I wouldn't consider this a bug, or? I'd say it's a bug in your TCP/IP stack. An IP shouldn't take that long to figure out that it is not configured to connect to IPv6 addresses. 2. I don't even have any IPv6 addresses configured and I'm not using IPv6 in any way, so why does it try those at all? I have no experience with win7/64, but on earlier versions of Windows, there's a file named hosts, somewhere in a system directory. When looking up an IP address, this file is consulted first. Removing the ::1 from the entry for localhost might be a sensible work-around. 3. Of course I can optimize the code for IPv4, but then I would be pessimizing IPv6 and vice versa... I'd avoid doing that, if at all possible. Any other suggestions? Try ping localhost on the command line. It that has the same problem, than the problem is not in Python, but in your IP stack. It might be in a FAQ list for some windows-specific forum. Notes: * Using 127.0.0.1 as host works without the delay. That make sense: it's the attempt to connect to ::1 that is the problem. * I'm using Python 2.7 on win7/64bit Hope his helps, -- HansM -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
On Wed, Oct 17, 2012 at 8:37 PM, Hans Mulder han...@xs4all.nl wrote: I have no experience with win7/64, but on earlier versions of Windows, there's a file named hosts, somewhere in a system directory. When looking up an IP address, this file is consulted first. Removing the ::1 from the entry for localhost might be a sensible work-around. It ought to be c:\windows\system32\drivers\etc\hosts if your Widows is installed to default location. If localhost isn't there at all, you can add a line for it. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
What I'm wondering is this: 1. The server only serves on IPv4, changing this to IPv6 would probably help. However, I wouldn't consider this a bug, or? I'd say it's a bug in your TCP/IP stack. An IP shouldn't take that long to figure out that it is not configured to connect to IPv6 addresses. It might also be, that he has a firewall installed that is blocking access to ::1. In that case, it takes much more time to figure out that you cannot connect. Because in that case, it is not a connection refused problem, but a trying to connect to a closed/not responding port problem. -- http://mail.python.org/mailman/listinfo/python-list
Index in a list
Hello, I'm trying to index a text in a list as I'm importing a log file and each line is a list. What I'm trying to do is find the right line which contains the text User : and take the username right after the text User :, but the list.index((User :) is indexing only if all the text matching. How can I have the right position of the line which contains the word ((User :) Thanks Anatoli -- http://mail.python.org/mailman/listinfo/python-list
Re: Index in a list
On Wed, Oct 17, 2012 at 9:10 PM, Anatoli Hristov toli...@gmail.com wrote: Hello, I'm trying to index a text in a list as I'm importing a log file and each line is a list. What I'm trying to do is find the right line which contains the text User : and take the username right after the text User :, but the list.index((User :) is indexing only if all the text matching. How can I have the right position of the line which contains the word ((User :) What you want is a search. Try this: for idx,val in enumerate(list): # if (User: in val: break # if val.startswith((User:): break Pick one or t'other of those conditions; the first one looks for any string _containing_ (User:, while the second will match specifically on the beginning. After this loop, list[idx] is the User line, and the entry after it is in list[idx+1] - but be aware that you'll get an exception if list[idx] is the last entry in the list. By the way, it's generally considered dodgy to use the name list for a list - it stops you from using the list constructor. I'd recommend calling it lst instead or, better, to name it according to what it contains (eg if it's a list of log entries, call it 'log_entries' or something). ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: system tray or notification area in python
So I thought I would write a brand new stand alone system tray or notification area in python. I guess I need to use gtk bindings or some such but don't really know what my options are. Where would I start something like this? Any pointers would be greatly appreciated! Why not look at the source code of the current app your using to get an idea how that application accomplishes said task? I actually did that already it's using the C bindings of gtk. I think you are mistaken - if its this one: http://stalonetray.sourceforge.net/ Yes, that's it. I had a quick look into the sources, it does not use gtk at all, it uses low level X11 calls. Programming in this way is very tedious. Right, but nobody wrote Xlib bindings for python? Erm, Google is your friend: python xlib turns up http://python-xlib.sourceforge.net/ as well as http://plwm.sourceforge.net/ which is pretty close to what you are trying to do. Great, thanks a lot! Don't take it wrong, but when you write that you have no experience with GUI programming, I'd start another projet first - I think you will have a tough way to succeed with this project. I certainly wouldn't start with Xlib in C, but if python bindings would be available that would make life much easier. Everything is easier in python:) because usually python libs are designed with OO and ease of use in mind. Beware that this will be much tougher than using gtkfriends. I guess so :) But it's a good excuse to get familiar with X :) Cheers, Daniel Christian -- http://mail.python.org/mailman/listinfo/python-list -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
In article 1s42l9-9al@satorlaser.homedns.org, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Hi! I noticed yesterday that a single HTTP request to localhost takes roughly 1s, regardless of the actually served data, which is way too long. After some digging, I found that the problem lies in socket.create_connection(), which first tries the IPv6 ::1 and only then tries the IPv4 127.0.0.1. The first one times out after 1s, causing the long latency. What I'm wondering is this: 1. The server only serves on IPv4, changing this to IPv6 would probably help. However, I wouldn't consider this a bug, or? This is most likely a configuration problem on your server. You don't say what kind of system you're using, so I can only guess at the exact answer, but here's some suggestions. Look at your /etc/hosts file. What entries do you have for localhost? For example, on my OSX laptop, I've got: 127.0.0.1 localhost ::1 localhost fe80::1%lo0 localhost which gives three IP addresses (one IPv4, two IPv6) for localhost. This works because the box is properly configured for IPv6 (i.e. all services of interest listen on both protocols). On the other hand, this is on a linux box I have: 127.0.0.1 localhost ::1 ip6-localhost ip6-loopback Now, localhost only gives me the IPv4 address. If I want to connect to localhost with IPv6, I have to explicitly say ip6-localhost. My guess is that you have some variation of the first example, and what you need is some variation on the second. In the alternative, you need to fix up your HTTP server to listen on both protocols. For sure, in the long term, that's the right solution, because Real Soon Now, we're going to run out of IPv4 addresses and everybody is going to switch to IPv6. Of course, that's been true for about the past 15 years, but now it's really, really true. -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On 10/17/2012 12:43 AM, Kevin Anthony wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. (Please don't top-post; it ruins the ordering. In these forums, put your response after the part you quote from earlier messages. Or even better, after each part you quote. Then trim off the parts you didn't reference.) list comprehensions CAN be much faster, but not necessarily. The most complex a loop, the less likely it'll help much. In any case, only the inner loop will be affected. Nesting two list comprehensions will make a trivial difference. On the other hand, Hans Mulder shows some other factoring which seems much more readable than yours. Studying (and testing) those could teach you a lot about comprehensions, as well as about the libraries that can help. Note especially what zip(*b) yields, and think about what it means. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: Index in a list
Thanks a lot this solved my issue:) Regards Anatoli On Wed, Oct 17, 2012 at 12:23 PM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 17, 2012 at 9:10 PM, Anatoli Hristov toli...@gmail.com wrote: Hello, I'm trying to index a text in a list as I'm importing a log file and each line is a list. What I'm trying to do is find the right line which contains the text User : and take the username right after the text User :, but the list.index((User :) is indexing only if all the text matching. How can I have the right position of the line which contains the word ((User :) What you want is a search. Try this: for idx,val in enumerate(list): # if (User: in val: break # if val.startswith((User:): break Pick one or t'other of those conditions; the first one looks for any string _containing_ (User:, while the second will match specifically on the beginning. After this loop, list[idx] is the User line, and the entry after it is in list[idx+1] - but be aware that you'll get an exception if list[idx] is the last entry in the list. By the way, it's generally considered dodgy to use the name list for a list - it stops you from using the list constructor. I'd recommend calling it lst instead or, better, to name it according to what it contains (eg if it's a list of log entries, call it 'log_entries' or something). ChrisA -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
Some updates on the issue: The etc/hosts file contains the following lines: # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost As I understand it, those effectively mean that localhost is not resolved via this hosts file but within DNS itself, whatever that exactly means. Concerning the question whether ping works, the result is that ping localhost works and that it uses the IPv6 (sic!) address. I also tried ping ::1 and ping 127.0.0.1 and both work. Weird, as ipconfig doesn't list any IPv6 addresses. Concerning the question whether a firewall blocks and unnecessarily delays connection attempts to ::1, I haven't determined that yet. I'll ask our admins here to verify whether that is the case. Lastly, I tried the same using Python 3.2.3/64bit (the other was actually the 32-bit version), and the same issues are there. In summary, I guess that it's a problem with the IP configuration not one in Python's or my code. Sorry for the noise... Uli -- http://mail.python.org/mailman/listinfo/python-list
Re: easy_install says not a recognized archive type Windows Py3
On Tue, Oct 16, 2012 at 1:41 PM, Noah Coad n...@coad.net wrote: error: Not a recognized archive type: c:\users\noahco~1\appdata\local\temp\easy_ install-gpekqc\PyMySQL-0.5.tar.gz Nobody seems to have responded to this (or I haven't seen it), but it looks like your system can't extract gzip files. Suggestions found on other fora (at the opposite end of a Google search) point to possibly using pip instead of easy_install; alternatively, you may be able to install a Windows gzip utility, though I don't know anything about linking that up with easy_install. Sorry I can't be of more help! But maybe bumping this thread will bring it to someone's attention who actually knows. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
On Wed, Oct 17, 2012 at 11:40 PM, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Concerning the question whether a firewall blocks and unnecessarily delays connection attempts to ::1, I haven't determined that yet. I'll ask our admins here to verify whether that is the case. It would only be a software firewall on the local machine that could be doing that; anything on any other machine can't. If you have no particular reason to do otherwise, I would recommend removing all firewalling from localhost - you won't lose much security (two programs running on your computer are allowed to communicate freely in plenty of other ways anyway), and it'll make all sorts of things easier/simpler. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: cx_Oracle clause IN using a variable
Il giorno martedì 16 ottobre 2012 19:23:22 UTC+2, Hans Mulder ha scritto: On 16/10/12 15:41:58, Beppe wrote: Hi all, I don't know if it is the correct place to set this question, however, I'm using cx_Oracle to query an Oracle database. I've a problem to use the IN clause with a variable. My statement is sql = SELECT field1,field2,field3 FROM my_table WHERE field_3 IN (:arg_1) where arg_1 is retrive by a dictionary that is build so my_dict = {'location':X, 'oracle_user':'user', 'oracle_password':'pass', 'dsn':'dsn', 'mailto':'some...@somewhere.org', 'codes':CNI,CNP} args = (dict['codes'],) con = cx_Oracle.connect(my_dict[oracle_user], my_dict[oracle_password], my_dict[dsn]) cur = con.cursor() cur.execute(sql,args) rs = cur.fetchall() but it doesn't work in the sense that doesn't return anything If i use the statment without variable SELECT field1,field2,field3 FROM my_table WHERE field_3 IN ('CNI','CNP') the query works what is wrong? You only have a single placeholder variable, so your statement is equivalent to SELECT field1,field2,field3 FROM my_table WHERE field_3 IN ('CNI,CNP') Presumably 'CNI,CNP' is not a valid value for field_3, thus your query finds no records. suggestions? To verify that you have the correct syntax, try it with a single value first: my_dict = {'location':X, 'oracle_user':'user', 'oracle_password':'pass', 'dsn':'dsn', 'mailto':'some...@somewhere.org', 'codes':CNI} It that produces some of the records you want, then the question is really: can you somehow pass a list of values via a single placeholder variable? I'm, not a cx_Oracle expert, but I think the answer is no. If you want to pass exactly two values, then the work-around would be to pass them in separate variables: my_dict = {'location':X, 'oracle_user':'user', 'oracle_password':'pass', 'dsn':'dsn', 'mailto':'some...@somewhere.org', 'code1':CNI, 'code2':CNP} sql = SELECT field1,field2,field3 FROM my_table WHERE field_3 IN (:arg_1, :arg_2) args = (my_dict['code1'],my_dict['code2']) If the number of codes can vary, you'll have to generate a query with the correct number of placholders in it. Mabye something like this (untested): my_dict = {'location':X, 'oracle_user':'user', 'oracle_password':'pass', 'dsn':'dsn', 'mailto':'some...@somewhere.org', 'codes':Ornhgvshy,vf,orggre,guna,htyl} args = my_dict['codes'].split(,) placeholders = ','.join(:x%d % i for i,_ in enumerate(args)) sql = SELECT field1,field2,field3 FROM my_table WHERE field_3 IN (%s) % placeholders con = cx_Oracle.connect(my_dict[oracle_user], my_dict[oracle_password], my_dict[dsn]) cur = con.cursor() cur.execute(sql,args) rs = cur.fetchall() Hope this helps, -- HansM Thanks a lot of to ian and hans for your explanations that have allowed me to resolve my problem and above all to understand the why I was wrong. regards beppe -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On Oct 17, 5:33 pm, Dave Angel d...@davea.name wrote: On 10/17/2012 12:43 AM, Kevin Anthony wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. list comprehensions CAN be much faster, but not necessarily. The most complex a loop, the less likely it'll help much. One-lining the comprehension seems to make a difference of about 10% out here. Maybe Ive missed something? Seems too large… # My original suggestion def dot(p,q): return sum (x*y for x,y in zip(p,q)) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] # One-liner (Thanks Hans for reminding me of sum) def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] t1=Timer(res=mm1(m,m), setup=from __main__ import mm1, m) t1.timeit(1000) 12.276363849639893 t0=Timer(res=mm(m,m), setup=from __main__ import mm, m) t0.timeit(1000) 13.453603029251099 -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On 2012-10-17, Dwight Hutto dwightdhu...@gmail.com wrote: No I'm not a troll. I like to answer, as well as ask, and sometimes things get heated, and you get called a name, and the name takes the argument out of context sometimes. Uh, what? How can a name take an argument out of context? Taking something out of context is something done by a somebody who is reading or quoting somebody else. -- Grant Edwards grant.b.edwardsYow! I own seven-eighths of at all the artists in downtown gmail.comBurbank! -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 2012-10-17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 16 Oct 2012 21:25:38 -0700, alex23 wrote: I really don't get people who feel they need to share their opinion when that opinion is that other people shouldn't share theirs. +1 QOTW It makes me laugh when newcomers to this group stick their head up to chastise us for arguing about the culture of this group. The irony is that that is *precisely* what they too are doing. In an ideal world, we'd all agree on what counts as acceptable behaviour, and stick to it, and discuss nothing but Python coding problems. I disagree! I think occasional off-topic meta-arguments can be interesting and entertaining. Yow! Am I having a meta-meta-discussion yet? -- Grant Edwards grant.b.edwardsYow! -- I love KATRINKA at because she drives a gmail.comPONTIAC. We're going away now. I fed the cat. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 2012-10-17, Terry Reedy tjre...@udel.edu wrote: On 10/16/2012 11:47 PM, Kristen J. Webb wrote: I will say that my perusal of this list has been informative. I also receive more email from this list than any other I subscribe to. You could instead access it as a newsgroup via news.gmane.org. That keeps posts isolated and you only download those item you request. News readers should collapse threads to a single line and allow you to mark all as read. I'm a big fan of gmane (though I happen to read this forum as comp.language.python from a Usenet server). Newsreaders often have more sophisticated mechanisms to allow you to filter out certain people/topics/whaterver that don't interest you. -- Grant Edwards grant.b.edwardsYow! ... this must be what at it's like to be a COLLEGE gmail.comGRADUATE!! -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On 17-Oct-2012 11:31, Chris Angelico wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Personally, I've never taken an IQ test, so I don't know how well I'd score. But I'm a school dropout, never went to college/uni/TAFE/etc/etc, don't have any certifications of any sort. I'm a pretty uneducated fella, according to my reacute;sumhtmlentitiesdontworkhere; (that's resume when folded into ASCII). So according to how most people think about intelligence, I probably have a sub-par IQ. On the flip side, I'm a professional programmer, I run a server where people play Dungeons and Dragons, and I'm a well-respected wordsmith as Dungeon Master. Plus, I work in theatre (in fact, at the moment I'm posting from the bio box, sitting next to the follow spot that I'll be operating for the next two weeks). So I think I have enough muscle upstairs to get through life... But Dwight (and I'll continue to address you as such until you change your mail headers), a LOT of what you're saying is coming across as over-inflated ego. Maybe you are a majorly interdisciplinary learner; but boasting that you're the most interdisciplinary learner [we] might have ever encountered just comes across poorly. One thing I've learned from various groups is that, no matter how X you are, there's someone else who's even more X - for any X. Maybe it isn't true somewhere, maybe you really are the peak - but more than likely you aren't, and it's much more pleasant to be proved better than your claim than to be proved worse. (There are exceptions, of course. I have absolutely no doubt that I am the person most familiar with the RosMud++ code and thus the person best positioned to maintain that project. This is because I wrote it. But I am not claiming to be the best C++ programmer in the world, because there are a lot of other C++ programmers among the seven billion here.) ChrisA An excellent response Chris :-) -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On Oct 17, 7:06 pm, rusi rustompm...@gmail.com wrote: On Oct 17, 5:33 pm, Dave Angel d...@davea.name wrote: On 10/17/2012 12:43 AM, Kevin Anthony wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. list comprehensions CAN be much faster, but not necessarily. The most complex a loop, the less likely it'll help much. One-lining the comprehension seems to make a difference of about 10% out here. Maybe Ive missed something? Seems too large… # My original suggestion def dot(p,q): return sum (x*y for x,y in zip(p,q)) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] # One-liner (Thanks Hans for reminding me of sum) def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] t1=Timer(res=mm1(m,m), setup=from __main__ import mm1, m) t1.timeit(1000) 12.276363849639893 t0=Timer(res=mm(m,m), setup=from __main__ import mm, m) t0.timeit(1000) 13.453603029251099 In case anyone wants to try out with the same data, I used: m = [range(i,i+30) for i in range(30)] -- http://mail.python.org/mailman/listinfo/python-list
Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8), over the vowels? Thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 1:29 AM, Grant Edwards invalid@invalid.invalid wrote: I disagree! I think occasional off-topic meta-arguments can be interesting and entertaining. Yow! Am I having a meta-meta-discussion yet? Now we get to the meat of the discussion... It's like I was explaining to one of my brothers the other week: When in doubt, go meta. He had a whole lot of data and he had to give a presentation about it (for a course he was doing, and I'm not wholly sure the 'o' belongs in there). He wanted to do something that everyone else wouldn't be doing, so I suggested going meta. He said everyone else would be doing that, so I advised him to add another meta-level - for instance, do a presentation on how many people go meta in their presentations. I still don't know whether he dared to do so :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On 10/17/2012 10:06 AM, rusi wrote: On Oct 17, 5:33 pm, Dave Angel d...@davea.name wrote: On 10/17/2012 12:43 AM, Kevin Anthony wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. list comprehensions CAN be much faster, but not necessarily. The most complex a loop, the less likely it'll help much. One-lining the comprehension seems to make a difference of about 10% out here. Maybe Ive missed something? Seems too large… # My original suggestion def dot(p,q): return sum (x*y for x,y in zip(p,q)) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] # One-liner (Thanks Hans for reminding me of sum) def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] t1=Timer(res=mm1(m,m), setup=from __main__ import mm1, m) t1.timeit(1000) 12.276363849639893 t0=Timer(res=mm(m,m), setup=from __main__ import mm, m) t0.timeit(1000) 13.453603029251099 And I'd wager all the improvement is in the inner loop, the dot() function. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
Dave Angel於 2012年10月17日星期三UTC+8下午10時37分01秒寫道: On 10/17/2012 10:06 AM, rusi wrote: On Oct 17, 5:33 pm, Dave Angel d...@davea.name wrote: On 10/17/2012 12:43 AM, Kevin Anthony wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. list comprehensions CAN be much faster, but not necessarily. The most complex a loop, the less likely it'll help much. One-lining the comprehension seems to make a difference of about 10% out here. Maybe Ive missed something? Seems too large� # My original suggestion def dot(p,q): return sum (x*y for x,y in zip(p,q)) def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] # One-liner (Thanks Hans for reminding me of sum) def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] t1=Timer(res=mm1(m,m), setup=from __main__ import mm1, m) t1.timeit(1000) 12.276363849639893 t0=Timer(res=mm(m,m), setup=from __main__ import mm, m) t0.timeit(1000) 13.453603029251099 And I'd wager all the improvement is in the inner loop, the dot() function. -- DaveA Thanks for the tips of matrix operations over some fields or rings other than the real field and the complex field. -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On Oct 17, 7:37 pm, Dave Angel d...@davea.name wrote: And I'd wager all the improvement is in the inner loop, the dot() function. Sorry -- red herring! Changing def mm1(a,b): return [[sum(x*y for x,y in zip(ra,rb)) for rb in zip(*b)] for ra in a] to def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] makes the speed diff vanish -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On 10/17/2012 10:31 AM, nwaits wrote: I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8), over the vowels? Thank you. if you can construct a list of illegal characters, then you can simply check each character of the word against the list, and if it succeeds for all of the characters, it's a winner. If that's not fast enough, you can build a translation table from the list of illegal characters, and use translate on each word. Then it becomes a question of checking if the translated word is all zeroes. More setup time, but much faster looping for each word. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
rusi於 2012年10月17日星期三UTC+8下午10時50分11秒寫道: On Oct 17, 7:37 pm, Dave Angel d...@davea.name wrote: And I'd wager all the improvement is in the inner loop, the dot() function. Sorry -- red herring! Changing def mm1(a,b): return [[sum(x*y for x,y in zip(ra,rb)) for rb in zip(*b)] for ra in a] to def mm1(a,b): return [[sum([x*y for x,y in zip(ra,rb)]) for rb in zip(*b)] for ra in a] makes the speed diff vanish I think a lot people don't work on computations over fields other real and complex. That is why a lot people keep complaining about the speeds of python programs executed. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a way to configure IDLE to use spaces instead of tabs for indenting?
On Thu, Sep 6, 2012 at 10:43 AM, Alex foo@email.invalid wrote: Ramchandra Apte wrote: On Saturday, 25 August 2012 04:03:52 UTC+5:30, Alex wrote: I'm new to Python and have been using IDLE 3.2.3 to experiment with code as I learn. Despite being configured to use a 4 space indentation width, sometimes IDLE's smart indentation insists upon using width-8 tabs. From what I've been able to find on Google, this is due to a shortcoming in Tk. While it's not that big a deal in the grand scheme of things, I think it looks like poop, and I'd like to change IDLE to use 4-space indentation instead of tabs for all indentation levels. Is there any way for me to achieve what I want in IDLE, or do I have to start up my full-blown IDE if I want consistent 4-space indentation? Alex I think an IDE is better than IDLE. Try NINJA IDE. http://ninja-ide.org Agreed. I like PyDev in Eclipse, but sometimes I just want to try out something quick in the interpreter, to ensure I understand it or do a quick experiment. Since indentation is syntactically significant in Python, I think fixing the interpreter to produce good, readable, cut-and-pasteable, and Pythonic code is more important than a cosmetic feature, but less important than true bugs. -- Actually, if you're in PyDev/Eclipse already, you can just use the interactive shell that PyDev provides: http://pydev.org/manual_adv_interactive_console.html Cheers, Fabio -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
Le mercredi 17 octobre 2012 17:00:46 UTC+2, Dave Angel a écrit : On 10/17/2012 10:31 AM, nwaits wrote: I'm very impressed with python's wordlist script for plain text. Is there a script for finding words that do NOT have certain diacritic marks, like acute or grave accents (utf-8), over the vowels? Thank you. if you can construct a list of illegal characters, then you can simply check each character of the word against the list, and if it succeeds for all of the characters, it's a winner. If that's not fast enough, you can build a translation table from the list of illegal characters, and use translate on each word. Then it becomes a question of checking if the translated word is all zeroes. More setup time, but much faster looping for each word. -- DaveA Lazy way. Py3.2 import unicodedata def HasDiacritics(w): ... w_decomposed = unicodedata.normalize('NFKD', w) ... return 'no' if len(w) == len(w_decomposed) else 'yes' ... HasDiacritics('éléphant') 'yes' HasDiacritics('elephant') 'no' HasDiacritics('\N{LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON}') 'yes' HasDiacritics('U') 'no' Should be ok for the CombiningDiacriticalMarks unicode range (common diacritics) jmf -- http://mail.python.org/mailman/listinfo/python-list
Re: Is there a way to configure IDLE to use spaces instead of tabs for indenting?
Fabio Zadrozny wrote: On Thu, Sep 6, 2012 at 10:43 AM, Alex foo@email.invalid wrote: Ramchandra Apte wrote: On Saturday, 25 August 2012 04:03:52 UTC+5:30, Alex wrote: I'm new to Python and have been using IDLE 3.2.3 to experiment with code as I learn. Despite being configured to use a 4 space indentation width, sometimes IDLE's smart indentation insists upon using width-8 tabs. From what I've been able to find on Google, this is due to a shortcoming in Tk. While it's not that big a deal in the grand scheme of things, I think it looks like poop, and I'd like to change IDLE to use 4-space indentation instead of tabs for all indentation levels. Is there any way for me to achieve what I want in IDLE, or do I have to start up my full-blown IDE if I want consistent 4-space indentation? Alex I think an IDE is better than IDLE. Try NINJA IDE. http://ninja-ide.org Agreed. I like PyDev in Eclipse, but sometimes I just want to try out something quick in the interpreter, to ensure I understand it or do a quick experiment. Since indentation is syntactically significant in Python, I think fixing the interpreter to produce good, readable, cut-and-pasteable, and Pythonic code is more important than a cosmetic feature, but less important than true bugs. -- Actually, if you're in PyDev/Eclipse already, you can just use the interactive shell that PyDev provides: http://pydev.org/manual_adv_interactive_console.html Cheers, Fabio Awesome. Exactly what I was looking for. Thanks. -- http://mail.python.org/mailman/listinfo/python-list
zip_longest_by
While working through Project Euler, a fun source of exercises, I composed the following iterator recipe to yield from multiple iterators in fixed-length groups: import itertools def zip_longest_by(*args, fillvalue=None, n=1, grouper=tuple): Yield n at a time from each of the args, with padding. It terminates when the longest iterator is exhausted. for i, j in zip_longest_by(ABCDEFGH, HIJKL, ... fillvalue=-, n=3, grouper=''.join): ... print(i, j) ABC HIJ DEF KL- GH- --- for n1, n2 in zip_longest_by(reversed('1234'), reversed('678'), ... fillvalue='0', n=3, grouper=lambda a: ''.join(reversed(a))): ... print(n1, n2) 234 678 001 000 it = itertools.zip_longest(*args, fillvalue=fillvalue) while True: accum = list() try: for i in range(n): accum += zip(*next(it)) except StopIteration: for i in range(n - i): accum.append(tuple(itertools.repeat(fillvalue, len(args yield tuple(grouper(item) for item in zip(*accum)) break yield tuple(grouper(item) for item in zip(*accum)) The interface could stand improvement. I find the grouper argument very convenient, but none of the other grouping iterators find it needful. Forcing n to be a keyword argument is unfortunate as well. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list
RE: OT Questions
David Hutto wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: * Your strength is not design. Using bevel and emboss (and a pattern here and there) does not constitute good design. It's simplicity within a symbolism, and now that I need money for medical reasons, the work I've done isn't perfect, but it's on par. I know when I see something aesthetically pleasing, and if I like what I have, I'm using the same mindset. If you're showcasing logo work, I hope you're ready to supply variations that can be used cross-medium. These are all portfolio sites of my own, and I'm slowly revising them, just like any other rough draft, and as you can tell I'm asking other people to critique it. Aesthetics and web design are relative to the eye of the beholder. The question is whose opinion matters. Yours? Mine? Others? Personally, I heartily second the recommendation to get professional advice on site design. Your site reminds me of something I would create in the '90s with FrontPage (do people even use that anymore?) as an amateur or hobbyist; not something I would create as a professional attempting to market my services. Now I do not say this in order to be mean, but to provide constructive criticism. Not because I do not like the site; but because I think *other* people will not like the site layout and ultimately my opinion does not matter; it matters what your prospective clients think. That is unless you can afford to turn away business by sticking to your design principles. Several top level links did not work and that is a bad sign for a portfolio. At the very least, take a few minutes to setup a blank page so the visitor does not get a 404 error. The background of your logo page should match the color scheme of the rest of the website. Oh, and your logo for your main page is incomprehensible to me. I am not sure if it is a artistic design or some text, but it is too hard to make out. It is hard to say much more since the site is so bare. I will reiterate what others have said regarding background sounds (especially ones that start by default). If you take a look at some famous websites and you will notice that they rarely have sound and for good reason. Another thing to note is wasted space. Network bandwidth is a commodity. You pay for it and your visitor pays for it. You pay for it in terms of hosting or internet service while the visitor pays for it in internet service and possibly even in their data cap. I cannot imagine loading your website from a phone (nor would I ever try to). You want to be as efficient as possible. Have you ever taken a look at Google's home page source? Now they are an extreme example of keeping a site lean, but maybe that will give you an idea of how important it is. An overly giant GIF and sound files are poor choices. It should be easy to compress the GIF to a *much* smaller file size while keeping the animation. You can probably use a midi file for the same effect with regards to sounds. I hope that helps, Ramit This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email. -- http://mail.python.org/mailman/listinfo/python-list
Re: Index in a list
On 17/10/12 12:10:56, Anatoli Hristov wrote: I'm trying to index a text in a list as I'm importing a log file and each line is a list. What I'm trying to do is find the right line which contains the text User : and take the username right after the text User :, but the list.index((User :) is indexing only if all the text matching. How can I have the right position of the line which contains the word ((User :) Perhaps something like: target = (User : for line in your_list: position = line.find(target) if position = 0: print line[position+len(target):] Hope this helps, -- HansM -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 10/16/2012 08:45 PM, Steven D'Aprano wrote: On Tue, 16 Oct 2012 14:10:17 -0700, rurpy wrote: On 10/16/2012 10:49 AM, Steven D'Aprano wrote: On Tue, 16 Oct 2012 09:27:48 -0700, rurpy wrote about trolls and dicks: No, I wrote about trolls. dicks is a highly emotive and almost totally subjective word As opposed to troll, which is unemotional and objective? Not. Not not. Please be careful of binary thinking. I did not say troll is unemotional and objective; I said it was much less so than dick. It has a fairly specific meaning (see the wikipedia article for example.) that I would not use in a rational discussion. I would. If someone is acting like a dick, why not call them by the word that most accurately describes their behaviour? Because (as I said) it is highly subjective and hence describes not their behavior but rather your opinion of their behavior. I see nothing troll like in Dwight call me David, but I can't be bothered changing my signature Hutto's behaviour. He doesn't seem to be trolling, in either sense: he doesn't appear to be making provocative statements for the purpose of making people think, nor does he seem to be making inflammatory statements to get a rise out of people. He seems to genuinely want to help people, in a clumsy, aggressive, and I believe often intoxicated way. So it seems to me that you are wrongly applying the term troll as a meaningless pejorative to anyone who behaves badly. Hardly meaningless. It seems to me there is a spectrum ranging from those who post for the pure enjoyment of starting an argument, through those who have a on-topic reason to post but have a lot of attitude, through those who usually keep their attitude under control but go off when provoked to those who really are clueless and have no idea that their attitude is offensive to anyone. This is further complicated by the fact that some offensive behaviors are offensive to some and not to others, and worse, some people are offended by any opinion they disagree with. Finally there are lots of people, some drive-by, some with lots of python knowledge and regulars here, who just enjoy arguing. That trait is not restricted to trolls. So regardless of the category of troll, telling them to stop is more likely to result in a response ranging from a repetition of what they already said to go screw yourself, followed by dozens of more responses telling them everything from stop to you're an asshole. You are right that I lumped them all under the label troll. I will do so through the rest of this post since I don't have any other good labels. Perhaps you were trying to be amusing? Certainly not. The best advise is to ignore such posts and encourage others to do the same. [...] How should somebody distinguish between I am being shunned for acting like a dick, and I have not received any responses because nobody has anything to add? Because you sent them private email telling them that? My, what a ... unique ... concept of ignore such posts you have. What's so unique about it? I have seen such advice dozens of times including in this list. (Oh wait, I just read ahead. I'll respond below). So far, this has been the best advice you have given so far. My opinion is that there is a graduated response to dickish behaviour: * send a message telling the person they are acting unacceptably, preferably privately on a first offence to avoid public shaming (when possible -- lots of people aren't privately contactable for many reasons other than that they are trolls); * if the behaviour continues, make a public comment condemning that behaviour generally without engaging directly in a debate or tit-for-tat argument with the person. That's great except that, * Many people feel compelled to make the same public comment * Tit-for-tat arguments usually do ensue. And for those who value their own peace and quiet over the community benefit: * block or killfile posts from that person so they don't have to be seen, preferably publicly. * And all too often that is followed up with a public **plonk**. (I really don't care that you (generic) killfiled someone. I'm quite capable of deciding who to read on my own.) When I killfile someone, I tend to make it expire after a month or three, just in case they mend their ways. Call me Mr Softy if you like. [...] If I believe that your behaviour (giving lousy advice) is causing great harm to this community, and *I don't say anything*, how will you know to change your behaviour? If that was how you thought, then you would be someone I hope would follow my advice. Because you would clearly seem to be unable to distinguish between difference of opinion on a subject relevant to the newsgroup, and inflammatory trolling. Further you see the situation in extreme terms (*great harm*) and one in which only a single point of view (your's) is
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Wed, Oct 17, 2012 at 9:32 AM, wxjmfa...@gmail.com wrote: import unicodedata def HasDiacritics(w): ... w_decomposed = unicodedata.normalize('NFKD', w) ... return 'no' if len(w) == len(w_decomposed) else 'yes' ... HasDiacritics('éléphant') 'yes' HasDiacritics('elephant') 'no' HasDiacritics('\N{LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON}') 'yes' HasDiacritics('U') 'no' Is there something wrong with True and False that you had to replace them with strings? return len(w) != len(w_decomposed) is all you need. -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Wed, Oct 17, 2012 at 1:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote: return len(w) != len(w_decomposed) is all you need. Thanks for helping, but I already knew that. -- http://mail.python.org/mailman/listinfo/python-list
Re: Change computername
On Wed, Oct 17, 2012 at 8:07 AM, Anatoli Hristov toli...@gmail.com wrote: Hello, Can you please help me out how can I change the computername of windows XP with or without the WIN32 module ? Untested: from ctypes import * ComputerNamePhysicalDnsHostname = 5 computer_name = u'COMPUTER' success = windll.kernel32.SetComputerNameExW(ComputerNamePhysicalDnsHostname, computer_name) if success: print(Name changed) else: print(Failed) The process will need admin rights, and the computer will need to be rebooted before the change will take effect. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 3:48 AM, ru...@yahoo.com wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. Impenetrability! ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
Le mercredi 17 octobre 2012 19:07:43 UTC+2, Ian a écrit : On Wed, Oct 17, 2012 at 9:32 AM, wxjmfa...@gmail.com wrote: import unicodedata def HasDiacritics(w): ... w_decomposed = unicodedata.normalize('NFKD', w) ... return 'no' if len(w) == len(w_decomposed) else 'yes' ... HasDiacritics('éléphant') 'yes' HasDiacritics('elephant') 'no' HasDiacritics('\N{LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON}') 'yes' HasDiacritics('U') 'no' Is there something wrong with True and False that you had to replace them with strings? return len(w) != len(w_decomposed) is all you need. Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False jmf -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Thu, Oct 18, 2012 at 5:17 AM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False Yes but why? When you're returning a boolean concept, why not return a boolean value? You don't even use values with one that compares-as-true and the other that compares-as-false (for instance, you could write the function so that it returns just the diacritic-containing characters, meaning it'll return if there aren't any). To what benefit? Puzzled. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Wed, Oct 17, 2012 at 12:17 PM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False It's just bad style, because both 'yes' and 'no' evaluate true. if HasDiacritics('éléphant'): print('Correct!') if HasDiacritics('elephant'): print('Error!') Prints: Correct! Error! You could replace the test with if HasDiacritics('elephant') == 'yes':, but why force the caller to write that out when the former test is more natural and less prone to error (e.g. typoing 'yes')? -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
Le mercredi 17 octobre 2012 20:28:21 UTC+2, Ian a écrit : On Wed, Oct 17, 2012 at 12:17 PM, wxjmfa...@gmail.com wrote: Not at all, I knew this. In this I decided to program like this. Do you get it? Yes/No or True/False It's just bad style, because both 'yes' and 'no' evaluate true. if HasDiacritics('éléphant'): print('Correct!') if HasDiacritics('elephant'): print('Error!') Prints: Correct! Error! You could replace the test with if HasDiacritics('elephant') == 'yes':, but why force the caller to write that out when the former test is more natural and less prone to error (e.g. typoing 'yes')? I *know* all this. In my prev. msg, the goal was to emph. the usage of *unicode.normalize(). jmf -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 10/17/2012 12:16 PM, Chris Angelico wrote: On Thu, Oct 18, 2012 at 3:48 AM, rurpy wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. I thought (and think now) that it was quite clear in context that ignore was to be taken relative to what was being discussed -- responding in this list. Did you seriously think I meant you weren't supposed even read it? That you must not print it out and burn it in effigy? That you can't mention it to a friend as an example of something that pissed you off that day? That you can't write a blog entry about it? That you can't report it to law enforcement if you thought it was threatening? I see responding privately to the poster in exactly the same vein. Ignore it *on the list*. I hope that makes it clear enough? -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wednesday, October 17, 2012 1:20:15 PM UTC-6, rurpy wrote: On 10/17/2012 12:16 PM, Chris Angelico wrote: [...] Ignore it *on the list*. Quick addendum: I wrote earlier (in some post in this thread I don't have time to dig up now) that the above possibly should not apply when one is the target of (a perceived) offensive post. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 17 October 2012 19:16, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 18, 2012 at 3:48 AM, ru...@yahoo.com wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. I would also assume that ignoring a post means not replying on or off list. Moreover, I think it's unfortunate for you to make this comment with an irrelevant reference to Asperger's syndrome. I'll give you the benefit of the doubt that you didn't mean it this way but the comment is easily interpreted as being disparaging to people with Asperger's. Generally I think that using psychological disorders or medical conditions as part of ad hominem risks offending people for no good reason. If you mean to accuse Steven of pedantry then why not use words like pedantic rather then words like autistic. Oscar -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 10/17/2012 02:28 PM, Oscar Benjamin wrote: On 17 October 2012 19:16, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 18, 2012 at 3:48 AM, ru...@yahoo.com wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. I would also assume that ignoring a post means not replying on or off list. Then I hope my reply to Chris clarified that for you as well. Moreover, I think it's unfortunate for you to make this comment with an irrelevant reference to Asperger's syndrome. I'll give you the benefit of the doubt that you didn't mean it this way but the comment is easily interpreted as being disparaging to people with Asperger's. Yes, on rereading that, I agree it was uncalled for and I retract it and apologize to any who may have been offended by it. -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On 10/17/2012 3:13 AM, rusi wrote: On Oct 17, 10:22 am, Terry Reedy tjre...@udel.edu wrote: On 10/16/2012 9:54 PM, Kevin Anthony wrote: I've been teaching myself list comprehension, and i've run across something i'm not able to convert. My response is to the part Kevin could *not* convert, not the parts he did convert. I attempted to explain why he could not convert that part. list comprehensions specifically abbreviate the code that they are (essentially) equivalent to. res = [] for item in source: res.append(f(item)) res == [f(item) for item in source] Matrix multiplication does not fit the pattern above. The reduction is number addition rather than list appending. Dunno why you say that. Because it is true and because it makes an essential point about what one can and cannot sensibly do with comprehensions. They are not intended to be a replacement for *all* loops. The essential inner reduction by addition of products that Kevin was 'not able to convert' cannot be converted (with out some obnoxious trickery and *some* extra helper), so his request for a sensible conversion is futile. Heres matrix multiply using list comprehensions: plus a helper function that does the inner reduction otherwise, as I implied it should be from operator import add def dot(p,q): return reduce(add, (x*y for x,y in zip(p,q))) Right, this is the addition reduction that the OP was trying to convert to a list comp. It cannot be done and you have not done it either. Note the the vector of products is produced as a comprehension. That you left it as a 'generator expression' is not relevant. The important point is the the addition combines the products of different iterations and list comps, by their nature, cannot directly do that. def transpose(m): return zip(*m) def mm(a,b): return mmt(a, transpose(b)) def mmt(a,b): return [[dot(ra, rb) for rb in b] for ra in a] This is the repeated append part of the original nested loops and that, as I said, can be re-expressed as a list comp. But that was not the part Kevin was having difficulty with and not the part I was talking about. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 5:31 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Someone insulted my intelligence, and stated how they worked with much smarter people...this was just a confidence statement that I'm intelligent as well, so don't get uppity with me. Personally, I've never taken an IQ test, so I don't know how well I'd score. But I'm a school dropout, never went to college/uni/TAFE/etc/etc, don't have any certifications of any sort. Me too, I was tested earlier in life, and took others. Dropped out in ninth grade, and went to the library to self learn, which isn't always the best path, but the one I took as well. I'm a pretty uneducated fella, according to my reacute;sumhtmlentitiesdontworkhere; (that's resume when folded into ASCII). So according to how most people think about intelligence, I probably have a sub-par IQ. There are many aspects to 'sub-par I.Q.', because I like to think everyone has a savant skill in them. On the flip side, I'm a professional programmer, I run a server where people play Dungeons and Dragons, and I'm a well-respected wordsmith as Dungeon Master. Plus, I work in theatre (in fact, at the moment I'm posting from the bio box, sitting next to the follow spot that I'll be operating for the next two weeks). So I think I have enough muscle upstairs to get through life... Bench pressing those molecules, and problem solving is just like bench pressing some weight...it gives you the ability to do a little heavy mental lifting when necessary. But Dwight (and I'll continue to address you as such until you change your mail headers), I'll get to that eventually. a LOT of what you're saying is coming across as over-inflated ego. No, just stating to another I'm intelligent as well, so don't push the subject if you don't want the actual response of who I am. Maybe you are a majorly interdisciplinary learner; but boasting that you're the most interdisciplinary learner [we] might have ever encountered just comes across poorly. Not a boast. I'm forgetful sometimes because I OCD crash coursing everything, so I just say that with confidence, not arrogance. One thing I've learned from various groups is that, no matter how X you are, there's someone else who's even more X - for any X. Maybe it isn't true somewhere, maybe you really are the peak - but more than likely you aren't, Probably not, I've met many who I can tell you are greater, but I have my pride as well when I enter into a conversation, and get insulted. and it's much more pleasant to be proved better than your claim than to be proved worse. (There are exceptions, of course. I have absolutely no doubt that I am the person most familiar with the RosMud++ code and thus the person best positioned to maintain that project. This is because I wrote it. But I am not claiming to be the best C++ programmer in the world, because there are a lot of other C++ programmers among the seven billion here.) Went to write my own language as well, but got caught up in a million more I liked better. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 10:19 AM, Grant Edwards invalid@invalid.invalid wrote: On 2012-10-17, Dwight Hutto dwightdhu...@gmail.com wrote: No I'm not a troll. I like to answer, as well as ask, and sometimes things get heated, and you get called a name, and the name takes the argument out of context sometimes. Uh, what? How can a name take an argument out of context? Taking something out of context is something done by a somebody who is reading or quoting somebody else. -- I meant that you get called a name when someone reads something that has been taken out of the context of several arguments between a few people in several threads, and call you something like a racist. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 12:38 PM, Prasad, Ramit ramit.pra...@jpmorgan.com wrote: David Hutto wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: * Your strength is not design. Using bevel and emboss (and a pattern here and there) does not constitute good design. It's simplicity within a symbolism, and now that I need money for medical reasons, the work I've done isn't perfect, but it's on par. I know when I see something aesthetically pleasing, and if I like what I have, I'm using the same mindset. If you're showcasing logo work, I hope you're ready to supply variations that can be used cross-medium. Well, all of these are my domain names, and works in progress/revision. The client would get several versions, and know what they want me to do, I just have to be able to do it for them, and add in a little extra to show my worth to them. These are all portfolio sites of my own, and I'm slowly revising them, just like any other rough draft, and as you can tell I'm asking other people to critique it. Aesthetics and web design are relative to the eye of the beholder. It's a statistic. I see things that lots of others like, so when I design, I say tomyself do I like that enough? But it's always in revision for perfection of the piece being worked on, just like apps have revisions, so do logos and artwork. The question is whose opinion matters. Yours? Mine? Others? Personally, I heartily second the recommendation to get professional advice on site design. Your site reminds me of something I would create in the '90s with FrontPage (do people even use that anymore?) as an amateur or hobbyist; not something I would create as a professional attempting to market my services. I'm moving toward the smaller devices, but I'm a desktop guy, and so are a lot of others. And what site doesn't have a frontpage? Now I do not say this in order to be mean, but to provide constructive criticism. Not because I do not like the site; but because I think *other* people will not like the site layout and ultimately my opinion does not matter; it matters what your prospective clients think. That goes back to stats. You might not be the demographic I attract, but others will like it...hopefully That is unless you can afford to turn away business by sticking to your design principles. No, the client is the main opinionator. If they like some of my stuff, and have an idea they need implemented, I just showcae I can do it. Several top level links did not work and that is a bad sign for a portfolio. At the very least, take a few minutes to setup a blank page I thought there were blank pages, and within the next week or so, there will be more. I'm looking toward other programmers for peer review to refine my main site. so the visitor does not get a 404 error. The background of your logo page should match the color scheme of the rest of the website. Oh, and your logo for your main page is incomprehensible to me. I am not sure if it is a artistic design or some text, but it is too hard to make out. It is hard to say much more since the site is so bare. I will reiterate what others have said regarding background sounds (especially ones that start by default). If you take a look at some famous websites and you will notice that they rarely have sound and for good reason. It's more of a commercial to me. In the end it doesn't show the webcrawlers for SEO my text, and it's a rough draft. It'll eventually be just a banner ad, and there will be a more static design. Another thing to note is wasted space. Network bandwidth is a commodity. You pay for it and your visitor pays for it. You pay for it in terms of hosting or internet service while the visitor pays for it in internet service and possibly even in their data cap. I cannot imagine loading your website from a phone (nor would I ever try to). You want to be as efficient as possible. Have you ever taken a look at Google's home page source? Now they are an extreme example of keeping a site lean, but maybe that will give you an idea of how important it is. An overly giant GIF and sound files are poor choices. It should be easy to compress the GIF to a *much* smaller file size while keeping the animation. You can probably use a midi file for the same effect with regards to sounds I'm working on the reduction right now, and that's the reason for asking for reviews. . I hope that helps, Don't worry, it does. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On 10/17/12 11:05 PM, Dwight Hutto wrote: On Wed, Oct 17, 2012 at 5:31 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Someone insulted my intelligence, and stated how they worked with much smarter people...this was just a confidence statement that I'm intelligent as well, so don't get uppity with me. No, you misread his sentence. That's not at all what he was saying. He was saying that one of the benefits that a person may get from working with people smarter than said person is that they can ascertain said person's strengths. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: list comprehension question
On 17 October 2012 06:09, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 12:43 AM, Kevin Anthony kevin.s.anth...@gmail.com wrote: Is it not true that list comprehension is much faster the the for loops? If it is not the correct way of doing this, i appoligize. Like i said, I'm learing list comprehension. I thought it was matrix multiplication mixed with list comprehension. Check this out real quick from the docs for list comprehension, but if it's a mixture of matrix multi, and list comp, then reply back. http://docs.python.org/tutorial/datastructures.html#list-comprehensions If you're looking for a fast solution then you should follow David's suggestion and use numpy: http://www.scipy.org/FAQ#head-045cba7978d75ec54882150fa6ad308e325a www.python-course.eu/matrix_arithmetic.php The most relevant numpy function is numpy.dot: http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html Oscar P.S. David, it was a bit fiddly for me to quote your response because the relevant part was in a post that had no context. Also your name is listed as Dwight above. That is automatically added by gmail because of the settings in your own email client. You may need to change your account settings if you want it to say David when people quote you. -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, 17 Oct 2012 18:05:12 -0400, Dwight Hutto wrote: On Wed, Oct 17, 2012 at 5:31 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Someone insulted my intelligence, and stated how they worked with much smarter people... Much smarter people than *himself*, not smarter than you. Demian made no comment about *your* intelligence. this was just a confidence statement that I'm intelligent as well, so don't get uppity with me. Please tone down the aggression. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
On Wed, 17 Oct 2012 13:16:43 -0400, David Robinow wrote: On Wed, Oct 17, 2012 at 1:07 PM, Ian Kelly ian.g.ke...@gmail.com wrote: return len(w) != len(w_decomposed) is all you need. Thanks for helping, but I already knew that. David, Ian was directly responding to wxjmfa...@gmail.com, whose suggestion included an entirely unnecessary conversion from a bool flag to the strings 'yes' and 'no'. That can be seen in the part of Ian's post that you deleted. Regardless of whether *you personally* already knew that jmf's function was unidiomatic and a poor design, you weren't directly the target of the comment. I'm glad you already knew what Ian said, but you're not the only person reading this thread. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, 17 Oct 2012 14:10:34 -0700, rurpy wrote: On 10/17/2012 02:28 PM, Oscar Benjamin wrote: On 17 October 2012 19:16, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 18, 2012 at 3:48 AM, ru...@yahoo.com wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. I would also assume that ignoring a post means not replying on or off list. Then I hope my reply to Chris clarified that for you as well. Moreover, I think it's unfortunate for you to make this comment with an irrelevant reference to Asperger's syndrome. I'll give you the benefit of the doubt that you didn't mean it this way but the comment is easily interpreted as being disparaging to people with Asperger's. Yes, on rereading that, I agree it was uncalled for and I retract it and apologize to any who may have been offended by it. Excuse me, I think that anybody who was offended by it needs to take a long, hard look at themselves. Would you be offended if Rurpy asked Are you diabetic? There's no more shame in being Aspie than there is in being diabetic, or allergic to wheat, or colour blind. -- Steven -- http://mail.python.org/mailman/listinfo/python-list
Re: OT Questions
On Wed, Oct 17, 2012 at 7:12 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 17 Oct 2012 18:05:12 -0400, Dwight Hutto wrote: On Wed, Oct 17, 2012 at 5:31 AM, Chris Angelico ros...@gmail.com wrote: On Wed, Oct 17, 2012 at 5:27 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 2:06 AM, Demian Brecht demianbre...@gmail.com wrote: I can't ascertain what your strengths are as I don't work with you on a daily basis (one of the many benefits of working with people smarter than you ;)). Doubt that, unless they have 160+ I.Q.'s(been seeing psychiatrists since I was 13). I'm very secure in my childlike intellectualism. A high IQ just proves ability to score well on IQ tests. On the whole, your statement strikes me as reminiscent of Sheldon Cooper's insistence that I'm not crazy, my mother had me tested!. Someone insulted my intelligence, and stated how they worked with much smarter people... Much smarter people than *himself*, not smarter than you. Demian made no comment about *your* intelligence. this was just a confidence statement that I'm intelligent as well, so don't get uppity with me. Please tone down the aggression. It's email, things get misinterpreted sometimes. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: where to view range([start], stop[, step])'s C implementation source code ?
On Monday, October 1, 2012 11:42:26 PM UTC+8, Ian wrote: On Mon, Oct 1, 2012 at 9:28 AM, iMath redstone-c...@163.com wrote: where to view range([start], stop[, step])'s C implementation source code ? http://hg.python.org/cpython/file/3f739f42be51/Objects/rangeobject.c thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, Oct 17, 2012 at 5:17 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Excuse me, I think that anybody who was offended by it needs to take a long, hard look at themselves. Would you be offended if Rurpy asked Are you diabetic? If the question were sincere, no. On the other hand, if it were a rhetorical question with the implication that only diabetics could possibly be so obtuse, then yes, it would be offensive. Instead of diabetic, try inserting the word black or female. There's no shame in those either, yet I think that the offensiveness of either of those words used in that context should be obvious. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
: On 17 October 2012 19:17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: [on Asperger's] Excuse me, I think that anybody who was offended by it needs to take a long, hard look at themselves. Would you be offended if Rurpy asked Are you diabetic? There's no more shame in being Aspie than there is in being diabetic, or allergic to wheat, or colour blind. In the culture in which I grew up, at least, dropping do you have developmental disorder X? into a fairly combative reply like the one under discussion would definitely be considered rude, not because there's any shame in having developmental disorder X, but because it's a plausible assumption that the questioner thinks there is [and that that's why they used the question as a retort]. I don't mean to imply that this was rurpy's intent [especially given that he's withdrawn the comment]. But to me it did initially feel more like Are you blind? than Are you diabetic? ... and the former is more commonly used as an insult than a genuine enquiry. -[]z. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
Instead of diabetic, try inserting the word black or female. There's no shame in those either, yet I think that the offensiveness of either of those words used in that context should be obvious. To take it a little further, what if I said I got gypped. I think it goes to gypsy's. Was it racist? Reneged has always been renegotiable, yet one time I accidently said to a good black friend of mine that something was nig rigged, and thought it meant negotiably rigged, but it wasn't racist. Recently, I told a guy to ramit, because his name or pseudo name, I thought, was ramit, and got called a racist for it. It seems that we get too politically correct when we want to cherry pick a comment for propaganda against someone. Sometimes it's just ridiculous. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
: On 17 October 2012 19:53, Dwight Hutto dwightdhu...@gmail.com wrote: To take it a little further, what if I said I got gypped. I think it goes to gypsy's. Was it racist? Racist is a word with competing definitions, and intent is a factor in some of them ... but yes, many people are offended by such use of the word gyp, just as they would be by similar use of jew as a verb. -[]z. -- http://mail.python.org/mailman/listinfo/python-list
unittest for system testing
Hi, Currently, I use a shell script to test how my system behaves before I deploy an application. For instance, I check if fileA, fileB, and fileC exist and if they do I go and start up my application. This works great BUT I would like to use python and in particular unittest module to test my system and then deploy my app. I understand unittest is for functional testing but I think this too would be a case for it. Any thoughts? I am not looking for code in particular but just some ideas on how to use python better in situations like this. -- --- Get your facts first, then you can distort them as you please.-- -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 10/17/2012 05:39 PM, Ian Kelly wrote: On Wed, Oct 17, 2012 at 5:17 PM, Steven D'Aprano wrote: Excuse me, I think that anybody who was offended by it needs to take a long, hard look at themselves. Would you be offended if Rurpy asked Are you diabetic? If the question were sincere, no. On the other hand, if it were a rhetorical question with the implication that only diabetics could possibly be so obtuse, then yes, it would be offensive. Instead of diabetic, try inserting the word black or female. There's no shame in those either, yet I think that the offensiveness of either of those words used in that context should be obvious. The question *was* sincere. Some people with Asberger's tend to take words and expressions too literally. I know because it it is a problem I often have. Nevertheless I should not have raised the issue in the newsgroup, especially when criticizing Steven for not just asking, but asserting, that someone else's writings were the products of excessive drug use. This list is not the place to ask or speculate about personal traits of posters; rather only on message contents. -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
In article eil2l9-nhm@satorlaser.homedns.org, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Some updates on the issue: The etc/hosts file contains the following lines: # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost As I understand it, those effectively mean that localhost is not resolved via this hosts file but within DNS itself, whatever that exactly means. The path from hostname to IP address is a long and tangled one. It starts with a call to getaddrinfo(). From there, the details depend on a wide variety of decisions made by whatever idiots designed, installed, and configured your operating system. One likely path is to check in /etc/nsswitch.conf to see what data sources the resolver should consult. On the box I'm using at the moment, it says: hosts: files dns which is pretty typical. That means, first look in [some set of static files, which usually, but not always, means /etc/hosts], and if you don't find it there, ask DNS. Other possibilities include NIS, NISPLUS, and maybe some other perverse things. And, finally, you get to DNS, so now you have to look in (probably) /etc/resolv.conf. I see on my linux box, even that has grown more tendrils; there's a whole /etc/resolvconf *directory* full of more config files which describe additional ways somebody could have misconfigured this mess. Personally, if I were you (and assuming you don't have some corporate IT nazis to deal with), I would just put localhost in /etc/hosts and be done with it. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 18 October 2012 00:17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 17 Oct 2012 14:10:34 -0700, rurpy wrote: On 10/17/2012 02:28 PM, Oscar Benjamin wrote: On 17 October 2012 19:16, Chris Angelico ros...@gmail.com wrote: On Thu, Oct 18, 2012 at 3:48 AM, ru...@yahoo.com wrote: On 10/16/2012 08:45 PM, Steven D'Aprano wrote: Except that you've made a 180- degree turn from your advice to ignore bad behaviour, but apparently didn't notice that *sending private emails* is not by any definition ignoring. So apparently you don't actually agree with your own advice. Do you have Asberger's by any chance? Can you understand that I said ignore in the context of public discussions in this newsgroup/maillist? That's nothing to do with Asperger's. Ignoring something/someone does not include sending a private message. What you may be trying to say is that we should refrain from publicly responding to bad behaviour, which is not the same thing. If you want to pull a Humpty Dumpty and use ignore to mean not respond to in public, then go ahead, I'm not stopping you - but do please make it clear somewhere in your post. I would also assume that ignoring a post means not replying on or off list. Then I hope my reply to Chris clarified that for you as well. Moreover, I think it's unfortunate for you to make this comment with an irrelevant reference to Asperger's syndrome. I'll give you the benefit of the doubt that you didn't mean it this way but the comment is easily interpreted as being disparaging to people with Asperger's. Yes, on rereading that, I agree it was uncalled for and I retract it and apologize to any who may have been offended by it. Excuse me, I think that anybody who was offended by it needs to take a long, hard look at themselves. Would you be offended if Rurpy asked Are you diabetic? There's no more shame in being Aspie than there is in being diabetic, or allergic to wheat, or colour blind. (rurpy, I know you already regret what you said so I'm not trying to rub it in but I want to respond to what Steven said) Steven, I almost followed that up with a post pointing out that it was also quite offensive to you. But then I thought: No, Steven can look after himself! You're right, of course. There is nothing wrong with Asperger's. I don't see much wrong with saying Do you have Asberger's by any chance? (apart from the South-Park style mis-spelling) but I do see something wrong with following it up with a patronising Can you understand... as if only the other party having Asperger's can explain your inability to understand one another. To put it another way, I could say: You're an idiot. Why can't you understand the simple things I say? which is rude but it's rude at one (relevant) person. Instead I could choose to say: Do you have Down's? Can your mongoloid brain just not understand me? which is rude at so many irrelevant people (I find it difficult to write that since my cousin and some other very lovely people I know have Down's but I that's roughly how I interpreted rurpy's comment the *first* time I read it). It came across to me as an offensive comment both to you and to people with Asperger's that I would not tolerate generally. It is retracted so I hold no ill will and don't want to dwell on it. In fact the very quick retraction is a good thing to happen in relation to the many things discussed above in this thread. Oscar -- http://mail.python.org/mailman/listinfo/python-list
Re: unittest for system testing
On 18/10/2012 01:22, Rita wrote: Hi, Currently, I use a shell script to test how my system behaves before I deploy an application. For instance, I check if fileA, fileB, and fileC exist and if they do I go and start up my application. This works great BUT I would like to use python and in particular unittest module to test my system and then deploy my app. I understand unittest is for functional testing but I think this too would be a case for it. Any thoughts? I am not looking for code in particular but just some ideas on how to use python better in situations like this. Plenty of options here http://wiki.python.org/moin/PythonTestingToolsTaxonomy and an active mailing list that I read via gmane.comp.python.testing.general -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On 18/10/2012 01:44, Oscar Benjamin wrote: It came across to me as an offensive comment both to you and to people with Asperger's that I would not tolerate generally. It is retracted so I hold no ill will and don't want to dwell on it. In fact the very quick retraction is a good thing to happen in relation to the many things discussed above in this thread. Oscar Can we drop this please guys? Being diagnosed earlier this year with Asperger was the best thing that ever happened to me, but being constantly reminded about my younger son who has the condition far worse than me and is partially deaf to boot is getting up my nose. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Oct 18, 9:53 am, Dwight Hutto dwightdhu...@gmail.com wrote: To take it a little further, what if I said I got gypped. I think it goes to gypsy's. Was it racist? Ignorant racism is still racism. Historical racism is still racism. It seems that we get too politically correct when we want to cherry pick a comment for propaganda against someone. I think a person who tells others not to be sensitive to his actions towards them shouldn't post so many complaints about how other people are acting toward him. -- http://mail.python.org/mailman/listinfo/python-list
By this program, you get full access to any account SkypeHackers 2013 and FacebookHackers 2013
By this program, you get full access to any account SkypeHackers 2013 you can enjoy a http://www.mediafire.com/?1d3o9sum1wbepvr By this program, you get full access to any account FacebookHackers 2013 you can enjoy a http://www.mediafire.com/?1zfu43i2jrryrau -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, Oct 17, 2012 at 9:02 PM, alex23 wuwe...@gmail.com wrote: On Oct 18, 9:53 am, Dwight Hutto dwightdhu...@gmail.com wrote: To take it a little further, what if I said I got gypped. I think it goes to gypsy's. Was it racist? Ignorant racism is still racism. No it's not, that 's why it's called ignorant...you just didn't know what it meant at the time, and correct yourself afterwards. Historical racism is still racism. No shit Sherlock. It seems that we get too politically correct when we want to cherry pick a comment for propaganda against someone. I think a person who tells others not to be sensitive to his actions towards them shouldn't post so many complaints about how other people are acting toward him. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: unittest for system testing
thanks. I suppose I would need a simple example from one of these libraries. ( i typed too soon for , no code needed ) On Wed, Oct 17, 2012 at 8:49 PM, Mark Lawrence breamore...@yahoo.co.ukwrote: On 18/10/2012 01:22, Rita wrote: Hi, Currently, I use a shell script to test how my system behaves before I deploy an application. For instance, I check if fileA, fileB, and fileC exist and if they do I go and start up my application. This works great BUT I would like to use python and in particular unittest module to test my system and then deploy my app. I understand unittest is for functional testing but I think this too would be a case for it. Any thoughts? I am not looking for code in particular but just some ideas on how to use python better in situations like this. Plenty of options here http://wiki.python.org/moin/** PythonTestingToolsTaxonomyhttp://wiki.python.org/moin/PythonTestingToolsTaxonomyand an active mailing list that I read via gmane.comp.python.testing. **general -- Cheers. Mark Lawrence. -- http://mail.python.org/**mailman/listinfo/python-listhttp://mail.python.org/mailman/listinfo/python-list -- --- Get your facts first, then you can distort them as you please.-- -- http://mail.python.org/mailman/listinfo/python-list
Deployment tools using Python (was: unittest for system testing)
Rita rmorgan...@gmail.com writes: Currently, I use a shell script to test how my system behaves before I deploy an application. For instance, I check if fileA, fileB, and fileC exist and if they do I go and start up my application. The operating system shell, or the deployment framework of choice, is best suited to that I think. This works great BUT I would like to use python and in particular unittest module to test my system and then deploy my app. I understand unittest is for functional testing Well, unittest is for unit testing (testing of small isolated units of the code). There are many definitions of “functional testing”, and I don't think ‘unittest’ is a good choice for any of them. but I think this too would be a case for it. Reserve the term “testing” for testing the code of your application, I'd recommend. Libraries designed for “testing” are not good outside that domain. Any thoughts? If a shell program isn't up to the job, look at deployment tools like Fabric URL:http://pypi.python.org/pypi/Fabric/ or Salt URL:http://pypi.python.org/pypi/salt/. -- \ “Two hands working can do more than a thousand clasped in | `\ prayer.” —Anonymous | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: Deployment tools using Python (was: unittest for system testing)
On Wed, Oct 17, 2012 at 11:30 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Rita rmorgan...@gmail.com writes: Currently, I use a shell script to test how my system behaves before I deploy an application. For instance, I check if fileA, fileB, and fileC exist and if they do I go and start up my application. The operating system shell, or the deployment framework of choice, is best suited to that I think. This works great BUT I would like to use python and in particular unittest module to test my system and then deploy my app. I understand unittest is for functional testing 10 Well, unittest is for unit testing (testing of small isolated units of the code). There are many definitions of “functional testing”, and I don't think ‘unittest’ is a good choice for any of them. but I think this too would be a case for it. Reserve the term “testing” for testing the code of your application, I'd recommend. Libraries designed for “testing” are not good outside that domain. Any thoughts? The unittests are just a basic framework to build upon. Logging and testing your own functions/classes is something that come in the pre-algorithm of the app you wish to deploy. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: bad httplib latency due to IPv6 use
On Thu, Oct 18, 2012 at 11:28 AM, Roy Smith r...@panix.com wrote: One likely path is to check in /etc/nsswitch.conf to see what data sources the resolver should consult. On the box I'm using at the moment, it says: hosts: files dns This is true on Linux, and presumably on various other Unices, but the OP is on Windows. I think it's hard-coded on Windows to just use the hosts file and then DNS. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Deployment tools using Python (was: unittest for system testing)
On Oct 18, 1:39 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Logging and testing your own functions/classes is something that come in the pre-algorithm of the app you wish to deploy. What is a pre-algorithm? -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, Oct 17, 2012 at 11:47 PM, wu wei wuwe...@gmail.com wrote: On Thu, Oct 18, 2012 at 1:10 PM, Dwight Hutto dwightdhu...@gmail.com wrote: It's intended to be involved, witty, and as informed as I can be You fail on every level here. According to your opinion. No, I'm fine a s a monk until recently, when medical, and faith issues arose, and for your information, I've been laid quite a few times, and won't have a problem doing so again. Yeah, you're full of confidence in yourself, you're not defensive at all. Confidence is a defence against individuals who want to cherry pick, and bring you down with propaganda that lacks anymore than a textbook approach...show some innovation please. I've been out here 6-7 years getting my life together without chasing pussy. When you use terms like chasing pussy, that's probably a good indication of why it's been 7 years since you last had any satisfying interaction with a woman. That was a character flaw i had...doc. I had to rid an addiction to saving women who were in bad situations, and clarify my mind as to who I want as a prime mate. Not self righteous, again wrong. I've been the bad guy, and now I have to watch out for them, which seems self righteous, but it's merely the fact that I have to have a good public persona now. But you _don't_ have a good public persona. You come across as someone desperately trying to convince people that you're smarter and better than you are. Again, just your opinion of a few threads. When insulted, you either insult back, or ascert your intelligence. I took the higher ground. Go get to know a real few arrogant individuals, with superiority complexes before you comment. I have. I'm speaking from direct experience here, and you demonstrate a lot in common with such people. You lack serious perspective n this subject, so stop trying to say I'm arrogant. If anything, I have an inferiority complex that comes out when I'm downed by someone. Then don't react the way you do, because it doesn't do you any favours. It's been that way in my socioeconomic upbringing I'm trying to overcome, so you're preaching to the choir. Oh boo hoo, you've had pain in your life, you're surely the only person on the planet. I give myself the same fucking thought everytime I have to feel symptoms which I',m trying to afford the cost to diagnose , and fix. So cry me a fucking river, and boohoo about my vulgar language. Doubt it. After 6-7 years of leaving sluts, and whores alone, I've realized I need to be secure emotionally, physically, financially, and spiritually. You don't see the hypocrisy in claiming you're after _spiritual_ and _emotional_ security and calling women sluts and whores? You should have met them. They may have become more, but that's who I was trying to save from other bad relationships. Use the little psychology you understand, and you'll see I was trying to save my mother. You're going to die alone with that attitude. Go insult a troll, because I like to fish off the top of the bridge. Things like this really aren't as witty as you think. Your ego couldn't take the insult, could it? Well above trash such as yourself who like to bring people down for fun due to their own superiority complexes. No, I just like highlighting the huge discrepancies between what people think say they are and how they behave, especially when that person is a hugely disruptive asshole who thinks the incomprehensible crap they write assists people in learning Python. Provide some references please, instead of a blanketed insult. You're in serious need of self-reflection at a level I'm not convinced you're capable of. You should hear some thought projection I have about my own past behaviour then. Maybe you should start another crybaby thread on the You mean a request for social critique that improves myself, then I'll throw a temper tantrum. Maybe you wanna come watch, or maybe you have the balls to participate(but that would be just my old behaviour). Python list to find out whether everyone else agrees. Or hell, you're the CEO of your company, I'm sure you have dozens if not hundreds of employees you can lean on for moral support, right? Just started, so I'm a startup, and you just insulted the majority of the list with good dreams of being a productive citizen of society. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Deployment tools using Python (was: unittest for system testing)
On Wed, Oct 17, 2012 at 11:59 PM, alex23 wuwe...@gmail.com wrote: On Oct 18, 1:39 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Logging and testing your own functions/classes is something that come in the pre-algorithm of the app you wish to deploy. What is a pre-algorithm? -- http://mail.python.org/mailman/listinfo/python-list Pseudo code that shows what the actual algorithm will have. Like a rough draft algorithm. Tossing the idea around in your mind is what I meant. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Wed, Oct 17, 2012 at 11:50 PM, wu wei wuwe...@gmail.com wrote: Did you really forward a private email to a public mailing list without permission? Are you really that fucking ignorant of the law? This is a public discussion. Maybe you just need to stand behind a loophole in the law, but the first amendment overrides that. Plus, that is the standard. We discuss this as a community. You never stated you wanted it private, ad if you had, it would have remained that way. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Oct 18, 2:02 pm, Dwight Hutto dwightdhu...@gmail.com wrote: [a public response to a private email] I really don't appreciate you pushing public a *private email exchange*, especially when it has nothing whatsoever to do with this list. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Oct 18, 2:05 pm, Dwight Hutto dwightdhu...@gmail.com wrote: This is a public discussion. Maybe you just need to stand behind a loophole in the law, but the first amendment overrides that. I'm not in America, so your constitution means nothing to me. Plus, that is the standard. We discuss this as a community. You never stated you wanted it private, ad if you had, it would have remained that way. I *sent you a private response* because it wasn't relevant to the list. You chose to re-include the list, which is an active decision you had to make. That is not acceptable behaviour, nor is it the standard. -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 12:06 AM, alex23 wuwe...@gmail.com wrote: On Oct 18, 2:02 pm, Dwight Hutto dwightdhu...@gmail.com wrote: [a public response to a private email] I really don't appreciate you pushing public a *private email exchange*, especially when it has nothing whatsoever to do with this list. Usually, etiquette dictates, that we hit reply all. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 3:05 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Wed, Oct 17, 2012 at 11:50 PM, wu wei wuwe...@gmail.com wrote: Did you really forward a private email to a public mailing list without permission? Are you really that fucking ignorant of the law? This is a public discussion. Maybe you just need to stand behind a loophole in the law, but the first amendment overrides that. Common misconception. The First Amendment to the United States Constitution prohibits the *making of any law* that restricts certain freedoms. It does not have ANYTHING to do with I have first amendment rights to say whatever I like. It is restrictions on Congress and the state governments in the US of A. Even if python-list were purely US-based, it still wouldn't apply. Deliberately forwarding a private email without permission is a breach of courtesy, more than of the law. It may be possible to make a civil case of the breach of privacy in some jurisdictions, but mainly it's just a gross discourtesy. (Assuming, that is, that the email wasn't actually intended to be public. I've at times responded on-list to a private email, but with a tag at the top explaining that.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Oct 18, 2:21 pm, Dwight Hutto dwightdhu...@gmail.com wrote: Usually, etiquette dictates, that we hit reply all. Then why did you actively re-add the list as a recipient when I had removed it? -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 3:21 PM, Dwight Hutto dwightdhu...@gmail.com wrote: On Thu, Oct 18, 2012 at 12:06 AM, alex23 wuwe...@gmail.com wrote: On Oct 18, 2:02 pm, Dwight Hutto dwightdhu...@gmail.com wrote: [a public response to a private email] I really don't appreciate you pushing public a *private email exchange*, especially when it has nothing whatsoever to do with this list. Usually, etiquette dictates, that we hit reply all. That's not actually true either. The convention is to reply to the list with material that is edifying to the list, or to the author alone if the situation calls for it. Using reply-all sends the author a copy as well as putting it on-list, which is unnecessary (unless it's likely the author isn't subscribed). It's completely unnecessary to include the list in what's not of interest. And here I am, posting on-list something that's completely necessary. (sigh* Alex, Dwight, can you two please cool down a bit? A little calmness would improve this discussion significantly, methinks. ChrisA -- http://mail.python.org/mailman/listinfo/python-list
Re: Aggressive language on python-list
On Thu, Oct 18, 2012 at 12:11 AM, alex23 wuwe...@gmail.com wrote: On Oct 18, 2:05 pm, Dwight Hutto dwightdhu...@gmail.com wrote: This is a public discussion. Maybe you just need to stand behind a loophole in the law, but the first amendment overrides that. I'm not in America, so your constitution means nothing to me. But you apparently want freedom of speech. Plus, that is the standard. We discuss this as a community. You never stated you wanted it private, ad if you had, it would have remained that way. I *sent you a private response* because it wasn't relevant to the list. You chose to re-include the list, No, lots of people hit 'reply' instead of 'reply all'. Read around, it gets stated all the time. The main response is don't reply privately, keep it on list, unless otherwise stated. which is an active decision you had to make. Based on certain list's rules. Hit 'reply all' That is not acceptable behaviour, nor is it the standard. That's debatable, unless you implied that was your intention. As I've mentioned before...people can start arguing, and one replies off list, and then goes back on the list after a private e-mail, and says ahah, see how they're acting, and they never saw the private reply you sent. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com -- http://mail.python.org/mailman/listinfo/python-list