Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread Michael Torrie
On 06/08/2013 10:56 AM, Νικόλαος Κούρας wrote: its very tedious to always triming everything for me and i know it is for you to ead it assuc. Damn google groups, why is it behaving as such? Dont the programmers know about it? Most of us on the list don't use google groups. A number of us use

Re: Re-using copyrighted code

2013-06-09 Thread Michael Torrie
On 06/09/2013 11:18 AM, Mark Janssen wrote: I understand that I have to pick a license for my package. You actually do not. Attaching a legal document is purely a secondary protection from those who would take away right already granted by US copyright. You are correct, except that the OP

Re: Re-using copyrighted code

2013-06-09 Thread Michael Torrie
On 06/09/2013 02:32 PM, Mark Janssen wrote: PyPi. But if you are *publishing*, there's no court which can protect your IP afterwards from redistribution, unless you explicitly *restrict* it. I am not a lawyer, and I haven't read the copyright act in its entirety, nor have I studied all the

Re: Re-using copyrighted code

2013-06-09 Thread Michael Torrie
On 06/09/2013 08:30 PM, Mark Janssen wrote: Can you provide any citations for your interpretation? Besides that's what the law should be, I mean. I don't think I even have to: the legal code you're citing above is not very clear, consistent, or well-defined at all. As such, it shows that

Re: A certainl part of an if() structure never gets executed.

2013-06-11 Thread Michael Torrie
On 06/11/2013 02:20 PM, Νικόλαος Κούρας wrote: [code] if not re.search( '=', name ) and not re.search( '=', month ) and not re.search( '=', year ): What do each of these functions return? When you print out re.search('=', name) what happens? When you're debugging you should

Re: A certainl part of an if() structure never gets executed.

2013-06-11 Thread Michael Torrie
On 06/11/2013 10:49 PM, Michael Torrie wrote: --- my_cgi_script.py --- import do_something # handle cgi stuff # get name, month year dosomething.dosomething(name, month, year) Make that do_something.do_something -- http://mail.python.org/mailman/listinfo/python

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Michael Torrie
On 06/14/2013 03:50 AM, Nick the Gr33k wrote: print(name or month or year) abcd print(name and month and year) ijkl Interesting. I'd have thought a boolean expression would return True or False, not a string. Learn something new every day. --

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Michael Torrie
On 06/14/2013 10:49 AM, Steven D'Aprano wrote: Correct. In Python, all boolean expressions are duck-typed: they aren't restricted to True and False, but to any true-ish and false-ish value, or as the Javascript people call them, truthy and falsey values. snip There are a couple of anomalies

Re: A certainl part of an if() structure never gets executed.

2013-06-15 Thread Michael Torrie
On 06/15/2013 07:07 AM, Nick the Gr33k wrote: result = mylist (since its a no-emoty list) result.append('bar') result is mylist True Never seen the last statement before. What does that mean? result is mylist Yes. Surprisingling good question.

Re: A certainl part of an if() structure never gets executed.

2013-06-15 Thread Michael Torrie
On 06/15/2013 10:18 AM, Nick the Gr33k wrote: a and b you say are names, which still are memory chunks Yes no matter how you look at it, a dictionary of names and objects is memory and variables in that sense. But at a higher level, we can consider the differences with how a language like C

Re: Don't feed the troll...

2013-06-15 Thread Michael Torrie
On 06/15/2013 11:30 AM, Nick the Gr33k wrote: You are spamming my thread. No he's not. The subject is changed on this branch of the thread, so it's easy to see in any good e-mail reader that this sub-thread or branch is diverting. This is proper list etiquette. --

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-17 Thread Michael Torrie
On 06/17/2013 05:34 AM, Simpleton wrote: So is it safe to say that in Python a == a ? ( stands for memory address) is the above correct? It might be partially equivalent inside the interpreter, but it's not something you should concern yourself with. And in general, no it's not safe to say,

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-19 Thread Michael Torrie
On 06/18/2013 03:51 AM, Νίκος wrote: Στις 18/6/2013 12:05 μμ, ο/η Steven D'Aprano έγραψε: Names are *always* linked to objects, not to other names. a = [] b = a # Now a and b refer to the same list a = {} # Now a refers to a dict, and b refers to the same list as before I see, thank you

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-19 Thread Michael Torrie
On 06/19/2013 11:16 PM, Michael Torrie wrote: It turns out that lists, hashes (dicts), and classes can pretty much do anything with having to much about with C-style pointers and such. Oh wow. Parse error. should read, pretty much do anything without having to muck about with C-style pointers

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-20 Thread Michael Torrie
On 06/19/2013 11:48 PM, Steven D'Aprano wrote: On Wed, 19 Jun 2013 23:16:51 -0600, Michael Torrie wrote: The real power and expressivity of Python comes from embracing the abstractions that Python provides to your advantage. There's a certain elegance and beauty that comes from such things

Re: Default Value

2013-06-21 Thread Michael Torrie
On 06/21/2013 07:41 PM, Chris Angelico wrote: While we're at it, I would like to petition for a function terminates(f, args) that I can use to determine whether a function will terminate before I actually call it. Nice idea from a theoretical point of view, but practicality beats purity,

Re: Python development tools

2013-06-23 Thread Michael Torrie
On 06/23/2013 02:40 PM, cutems93 wrote: What else do I need? Also, which software is used in daily base? I know version control software and bug tracking software are used almost everyday by developers. Which software is used less often? Phew that's quite a list you have there. Are you coming

Re: Making a pass form cgi = webpy framework

2013-06-23 Thread Michael Torrie
On 06/23/2013 07:44 PM, Νίκος wrote: Why use mako's approach which requires 2 files(an html template and the actual python script rendering the data) when i can have simple print statements inside 1 files(my files.py script) ? After all its only one html table i wish to display. Sooner or

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 05:44 AM, cts.private.ya...@gmail.com wrote: Alas, one reason it's a weak workaround is that it doesn't work - at least, not how I wish it would: $ cat ptrs x = 34 def p1 (a1): a1[0] += 12 p1 ([x]) print (x) $ python ptrs 34 you'll have to use it

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 05:21 AM, cts.private.ya...@gmail.com wrote: Thank you. You reminded me of the (weak) workaround of using arrays and confirmed my suspicion that I although I can read the variable, I won't be able to write to it. I still don't understand why not, though... The real problem

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 11:02 AM, Antoon Pardon wrote: Op 29-06-13 16:02, Michael Torrie schreef: The real problem here is that you don't understand how python variables work. And in fact, python does not have variables. It has names that bind to objects. I don't understand why members

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 07:56 AM, Michael Torrie wrote: x = [ 34, ] def test_func( out ): out[0] += 12 test_func(x) print (x) Well, actually print (x[0]) -- http://mail.python.org/mailman/listinfo/python-list

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 12:37 PM, cts.private.ya...@gmail.com wrote: :) Thank you guys for saying what I was biting my tongue about (thanks everybody for the help, BTW!). Sometimes it's best to state the actual problem you're trying to solve and see if there's a pythonic solution that fits it rather

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 12:51 PM, Steven D'Aprano wrote: You are absolutely correct in principle. But in practice, there are ten bazillion C, Pascal, COBOL, and BASIC programmers who understand the word variable to mean a named memory location, for every Smalltalk or Lisp programmer who understands a

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 01:19 PM, Steven D'Aprano wrote: Python's basic data types are not necessarily immutable. Lists and dicts are not immutable. Being a high-level language, the idea of primitives like int, double, float, etc from C doesn't really apply. A Python dict is not made up from Python

Re: Closures in leu of pointers?

2013-06-29 Thread Michael Torrie
On 06/29/2013 01:20 PM, cts.private.ya...@gmail.com wrote: exactly that. Without wanting to analyze it in too much depth now, I would want a local keyword to allow me to know I was protecting my variables, and a way to specify other scopes, without so much implied scoping in non-intuitive

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Michael Torrie
On 07/04/2013 02:25 PM, Ferrous Cranus wrote: try: host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] except: host = Reverse DNS Failed Is there a way to write the above so i cna print the error return when it fails? Do you know what IP address causes the failure?

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Michael Torrie
On 07/10/2013 06:22 AM, Mats Peterson wrote: You're showing by these examples what regular expressions mean to you. Chris is showing no such thing. And you are simply trolling. What do you want us to do, fall down and worship you and admit that Python is a horrible language and we should all

Re: Stack Overflow bans Mats Peterson (was Re: Stack Overflow moderator “animuson”)

2013-07-10 Thread Michael Torrie
On 07/10/2013 06:06 AM, Mats Peterson wrote: I haven't provided a real-world example, since I expect you Python Einsteins to be able do an A/B test between Python and Perl yourselves (provided you know Perl, of course, which I'm afraid is not always the case). And why would I use any custom

Re: Stack Overflow moderator “animuson”

2013-07-11 Thread Michael Torrie
On 07/10/2013 02:43 AM, Mats Peterson wrote: I fear you don’t even know what a regular expression is. Then this will of course not affect you. Hmm, and your stack exchange posts had a similar tone, hmm? I for one have never ready any of your posts on this forum before, so it looks like you've

Re: RE Module Performance

2013-07-12 Thread Michael Torrie
On 07/12/2013 09:59 AM, Joshua Landau wrote: If you're interested, the basic of it is that strings now use a variable number of bytes to encode their values depending on whether values outside of the ASCII range and some other range are used, as an optimisation. Variable number of bytes is a

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Michael Torrie
On 07/13/2013 12:23 PM, Νικόλας wrote: Do you know a way of implementing anyone of these methods to a script? Yes. Modern browsers all support a location API in the browser for javascript. See this: http://diveintohtml5.info/geolocation.html --

Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Michael Torrie
On 07/12/2013 10:32 AM, Νικόλας wrote: So, my question now is, if there is some way we can get an accurate Geo City database. As has been said pretty much by every other poster, there is no way to do get an accurate location database. Period. The databases that do exist were built by hand,

Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Michael Torrie
On 07/15/2013 06:34 PM, Dennis Lee Bieber wrote: I have no idea how to implement the solution you proposed. These are nice ideas we need to have a way of implement them within a script. I have no way of grasping a map of cell towers of a map of wi-fi hotspots. You don't... The phone

Re: tkinter redraw rates

2013-07-17 Thread Michael Torrie
On 07/17/2013 05:08 AM, fronag...@gmail.com wrote: Ok. Well, what I'm currently doing, based on advice from this thread, is to create a new thread that handles the downloading, as well as updating a variable for text display on the GUI, and in the main thread, just after the thread is created,

Re: Why on CentOS, python consumes too much memory ?

2013-07-18 Thread Michael Torrie
On 07/18/2013 03:13 AM, William Bai wrote: I found that it was caused by not by python but by /usr/lib/locale/locale-archive, the same problem as that described in http://illiterat.livejournal.com/4615.html. Too funny. So in other words there isn't a problem at all. What you thought was RAM

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-18 Thread Michael Torrie
On 07/17/2013 11:39 PM, Eric S. Johansson wrote: Not discourage you but this is a been there, done that kind of project. You could learn more from reading somebody else is code. What hasn't been done, and this would be very cool, is a chat program that works peer-to-peer with no central

Re: What does it take to implement a chat system in Python (Not asking for code just advice before I start my little project)

2013-07-18 Thread Michael Torrie
On 07/18/2013 12:19 PM, Owen Marshall wrote: Huh - I (foolishly) didn't realize gmane actually had NNTP, I've always used it to search mailing lists. If the list dumped to usenet (much like c.l.python) I'd post through sunsite.dk, which is a very nice usenet provider. But that still meant

Re: How can I make this piece of code even faster?

2013-07-21 Thread Michael Torrie
On 07/21/2013 04:19 AM, pablobarhamal...@gmail.com wrote: Thank's for all the replies! I've tried some of the imporovements you suggested (using math.exp() and sum() or math.fsum()). None of that made the code faster, because they are functions you are calling lots of times, and function

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Michael Torrie
On 07/21/2013 10:19 AM, Gilles wrote: So, does someone know of a good, SMTP server just to send e-mails? What you're looking for is not an SMTP server but a Mail Transfer Agent, called an MTA. Pretty much all distros ship with an MTA by default, even if the SMTP server part of it isn't

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-21 Thread Michael Torrie
On 07/21/2013 02:34 PM, Gilles wrote: Thanks for the infos. Ideally, I was looking for a simple Windows app as MTA, but a Python script is OK. The Sendmail MTA has been ported to many platforms including windows. But... I'm not sure my ISP blocks outbound port 25 connections. I'll experiment

Re: Beginner - GUI devlopment in Tkinter - Any IDE with drag and drop feature like Visual Studio?

2013-07-21 Thread Michael Torrie
On 07/21/2013 05:20 AM, Chris “Kwpolska” Warrick wrote: On Sun, Jul 21, 2013 at 1:14 PM, Dave Cook davec...@nowhere.net wrote: On 2013-07-20, Aseem Bansal asmbans...@gmail.com wrote: Do I need to use QtCreator with PySide if I want drag-and-drop feature for GUI development? No, you just

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Michael Torrie
On 07/22/2013 06:51 AM, Chris Angelico wrote: Thanks for the tip. I didn't know about SPF http://en.wikipedia.org/wiki/Sender_Policy_Framework It's a great way of detecting legit vs forged mail. If anyone tries to send mail purporting to be from anyth...@kepl.com.au and the receiving mail

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Michael Torrie
On 07/22/2013 06:19 AM, Gilles wrote: On Sun, 21 Jul 2013 21:01:09 + (UTC), Grant Edwards invalid@invalid.invalid wrote: Unless you've got a static IP address, a domain name, and a valid MX record that will match up when they do a reverse DNS lookup, it's pretty unlikely that you're going

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Michael Torrie
On 07/22/2013 06:11 AM, Gilles wrote: On Sun, 21 Jul 2013 18:28:27 -0600, Michael Torrie torr...@gmail.com wrote: The Sendmail MTA has been ported to many platforms including windows. But... Thanks for the tip. Since I couldn't find a good, basic, native Windows app, I was indeed about

Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-22 Thread Michael Torrie
On 07/22/2013 08:15 AM, Chris Angelico wrote: If legit mail is rejected for failing an SPF check, it's the sending admin's problem, not yours. You should never have problems with it if it's set up correctly. And since rejected mail gets reported to the transmitting MTA, you don't need to drop

[OT] SPF - was Re: Simple Python script as SMTP server for outgoing e-mails?

2013-07-23 Thread Michael Torrie
On 07/23/2013 03:30 AM, Chris Angelico wrote: On Tue, Jul 23, 2013 at 7:19 PM, Chris Angelico ros...@gmail.com wrote: Ah, there's a solution to this one. You simply use your own envelope-from address; SPF shouldn't be being checked for the From: header. There's an example, by the way, of

Re: PyWart: Python's import statement and the history of external dependencies

2014-11-21 Thread Michael Torrie
On 11/21/2014 11:24 AM, Rick Johnson wrote: Why am *i* the fool when it's obvious that the creators of Python were either shortsighted and/or careless with the designs? The only people who suffer are those who put their trust in the designer, and not the designer himself -- something is wrong

Re: PyWart: Python's import statement and the history of external dependencies

2014-11-21 Thread Michael Torrie
On 11/21/2014 01:29 PM, Rick Johnson wrote: Not personally. But how will we *ever* know if he refuses to participate in these discussions? Why should he participate in these discussions? Why should you be in charge of said discussions? By the way, Python has more than certainly borne fruit,

Re: GUI toolkit(s) status

2014-11-21 Thread Michael Torrie
On 11/20/2014 02:17 AM, Chris Angelico wrote: But I agree about the issues with tkinter. So, let's see. Shall we wait for Tcl/Tk Unicode support? Recommend people switch to PyGTK? To PyQt? To wxPython? To something else? Personally, I'm quite happy with GTK2 (though that's with Pike, not

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread Michael Torrie
On 11/22/2014 08:54 PM, llanitedave wrote: Well that DID make a difference! I used the %r marker, and the logger line gave me back: INFO:Related borehole_id is u'testbh3', of_borehole is 'testbh3' So it looks like I need to change my foreign key string to a unicode string. I'll be working

Re: Why do I keep getting emails from Dennis?

2014-11-23 Thread Michael Torrie
On 11/23/2014 08:21 PM, Sayth Renshaw wrote: I keep receiving emails from Dennis and it appears Dennis only on this list, I am signed up to comp.lang.python and am unsure why I keep getting Dennis' s emails. If you post to the newsgroup, using your e-mail address as the from address, when

Re: Python Signal/Slot + QThred code analysis

2014-11-24 Thread Michael Torrie
On 11/24/2014 06:25 AM, Juan Christian wrote: Oh, and this code I made by myself, I didn't copy. That's why I want you guys to see if everything is ok. Looks alright. Does it work? -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Michael Torrie
On 11/25/2014 02:36 PM, Juan Christian wrote: So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: snip So, let's see the problems: Traceback (most recent

Re: GUI toolkit(s) status

2014-11-26 Thread Michael Torrie
On 11/26/2014 02:40 AM, Dave Cook wrote: On 2014-11-22, Michael Torrie torr...@gmail.com wrote: I can't speak for wxWidgets, but when I last looked at it years ago it fairly reeked of MFC-style GUI programming with event tables instead of a nice, flexible signal/callback interface. Has

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 02:55 PM, Juan Christian wrote: On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie torr...@gmail.com wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult if not impossible to assist with, resulting

Re: Issues installing Python 2.7

2014-11-26 Thread Michael Torrie
To further explain my terse post from before (from my phone), see below. On 11/26/2014 10:09 AM, billyfurl...@gmail.com wrote: Now the installation worked fine but shouldn't I see that it's using the correct version??? I also did try to run /opt/python2.7/bin/python2.7 and it give me this.

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-26 Thread Michael Torrie
On 11/26/2014 08:57 PM, Michael Torrie wrote: On 11/26/2014 02:55 PM, Juan Christian wrote: On Wed Nov 26 2014 at 1:16:11 AM Michael Torrie torr...@gmail.com wrote: You're going to have to post a complete, but small, code example, I think. Working with fragments of code is very difficult

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:58 AM, Juan Christian wrote: What I have in mind is simple (I think), have the Outpost get the data using QThread, and when it got everything needed emit a signal. So when I have something like 'var = Outpost('123')', when I get the signal I'll know that I can call

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: So, instantly I found one issue, you said that this code won't block the GUI, only the thread event loop, but if we keep moving the window while it's open, every time new info is printed the GUI freezes for like 1-2 seconds. Correct. The thread

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: Is that right? But I don't think that always calling the site this way is good for them and for me, sometimes I may not get new users for like 10~15 minutes, so I would have wasted a lot of calls for nothing. That's why I only instantiate/call the

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-27 Thread Michael Torrie
On 11/27/2014 04:29 PM, Juan Christian wrote: Is that right? But I don't think that always calling the site this way is good for them and for me, sometimes I may not get new users for like 10~15 minutes, so I would have wasted a lot of calls for nothing. That's why I only instantiate/call the

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-28 Thread Michael Torrie
On 11/28/2014 06:06 AM, Juan Christian wrote: Which one would be better in performance, having a single 'Worker' to call all URLs, having inside this worker functions for each stuff, or having 3~5 different workers doing different stuff. In the end I'll only print the data when I have them

Re: Iterate over text file, discarding some lines via context manager

2014-11-28 Thread Michael Torrie
On 11/28/2014 08:04 AM, fetchinson . wrote: Hi all, I have a feeling that I should solve this by a context manager but since I've never used them I'm not sure what the optimal (in the python sense) solution is. So basically what I do all the time is this: I'd personally do it with a

Re: [Python-Dev] Unicode decode exception

2014-11-30 Thread Michael Torrie
On 11/30/2014 09:19 PM, balaji marisetti wrote: The default encoding is UTF-8. It works if I do: with open(filename, errors=ignore) as f: So I think Python2, by default, ignores all errors whereas Python3 doesn't Do you mean that the file is supposed to be utf-8 but isn't?

Re: Python and GUI development

2014-12-01 Thread Michael Torrie
On 12/01/2014 08:49 PM, Ganesh Pal wrote: Thanks for the bunch of suggestion , I have decided to go with PYQt for now : ) If the licensing of PyQt is not appropriate for you (it's GPL only, unless you buy a license), you can use PySide, which is almost a drop-in replacement for it, that's

Re: Proposed new conditional operator: or else

2014-12-02 Thread Michael Torrie
On 12/02/2014 10:18 AM, Roy Smith wrote: In the process of refactoring some code, I serendipitously created what I think is an essential new bit of Python syntax. The “or else” statement. I ended up with: sites_string = args.sites or else self.config['sites'] But isn't that

Re: Python handles globals badly.

2014-12-02 Thread Michael Torrie
On 12/02/2014 07:27 PM, Skybuck Flying wrote: Excuse is: bad programming style. I don't need snot telling me how to program after 20 years of programming experience. This is so far the only thing pissing me off in python. Now I have to declare global in front of these variables every

Re: Python handles globals badly.

2014-12-02 Thread Michael Torrie
On 12/02/2014 09:32 PM, Skybuck Flying wrote: Some issues I'd like to address to you: 1. Structured programming requires more programming time. 2. Structured programming implies structure which might be less flexible. 3. Python objects require self keyword to be used everywhere, and other

Re: Python handles globals badly.

2014-12-03 Thread Michael Torrie
On 12/03/2014 08:57 PM, Dennis Lee Bieber wrote: On Wed, 3 Dec 2014 10:16:18 -0800 (PST), sohcahto...@gmail.com declaimed the following: I'm surprised other people haven't picked up on how obvious of a troll this Skybuck Flying guy is. He claims 20 years programming experience, then

Re: Python docs disappointing

2014-12-04 Thread Michael Torrie
On 12/04/2014 03:27 AM, Albert van der Horst wrote: That doesn't help. I'm a very experienced programmer and work in routinely a dozen languages. Sometimes I do python. I want to do numeric work. I remember the name numpy. It is important, everybody knows it, it is all over the place. So I

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-05 Thread Michael Torrie
On 12/05/2014 07:31 PM, Ned Batchelder wrote: This is a perfect example! The code (with tabs as --- and leading spaces as .) is: ---if (!list_empty(pending)) --ret = list_first_entry(pending, struct async_entry, ...domain_list)-cookie;

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 01:40 AM, Marko Rauhamaa wrote: Michael Torrie torr...@gmail.com: In fact a decent editor that is auto-indenting code would, at least in C or C++ mode, do that automatically. A decent editor frees you from this dilemma entirely: (custom-set-variables '(indent

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 09:57 AM, Marko Rauhamaa wrote: And one of the OP's points is that by using tabs for indent, and spaces for alignment, you can have the best of both worlds. I certainly doesn't sound that way. Why is that? Programmers can set their tab size to anything they want, and it

Re: Tabs for indentation Spaces for alignment in Python 3?

2014-12-06 Thread Michael Torrie
On 12/06/2014 10:12 AM, Simon Ward wrote: Not every programmer is as conscientious in the first of place, and that's far easier to get wrong than just agreeing to stick to one thing. This is why (often more rigid) style guides (or rather policies) exist. Sure, but in the world of braces

Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-10 Thread Michael Torrie
On 12/10/2014 09:52 PM, iMath wrote: I think the user interface shouldn't be freezed when using concurrent.futures.ThreadPoolExecutor here,as it executes asynchronously , but it doesn't meet my expectations,anyone can explain why ? any other solutions here to not let user interface freezed?

Re: beautifulsoup VS lxml

2014-12-11 Thread Michael Torrie
On 12/11/2014 07:02 PM, iMath wrote: which is more easy and elegant for pulling data out of HTML? Beautiful Soup is specialized for HTML parsing, and it can deal with badly formed HTML, but if I recall correctly BeautifulSoup can use the lxml engine under the hood, so maybe it's the way to go

Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-11 Thread Michael Torrie
On 12/11/2014 08:20 PM, iMath wrote: 在 2014年12月11日星期四UTC+8下午1时25分41秒,Michael Torrie写道: On 12/10/2014 09:52 PM, iMath wrote: when it comes to I/O and GUIs, asynchronous calls are always better than threads. I cannot grasp your meaning here, IMO, asynchronous calls are done by using

Re: encrypt the http request url on the local machine

2014-12-12 Thread Michael Torrie
On 12/12/2014 08:53 AM, iMath wrote: After some retinking on my question ,I found what I am really want is not let any other guys using packet analyzer software know the server name (host name) my software is sending data to . so I translate the host name to IP address format, it somewhat

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Michael Torrie
On 12/14/2014 07:47 PM, Mark Lawrence wrote: I didn't realise that Python was so smart. It can indicate a syntax error at the final 't' in print before it gets to the opening bracket that is required for the print function in Python 3 (and Python 2 if you're using from __future__ import

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-14 Thread Michael Torrie
On 12/14/2014 10:32 PM, Chris Angelico wrote: Did you actually test that? Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32 Type copyright, credits or license() for more information. print(hello) hello Since print is a keyword when not imported from

Re: PyQt: user interface freezed when using concurrent.futures.ThreadPoolExecutor

2014-12-18 Thread Michael Torrie
On 12/18/2014 04:16 AM, Mark Summerfield wrote: It looks to me that what you are doing is sharing a single core between your GUI and your processing. Threading isn't usually a good approach to Python concurrency that is CPU-bound. Except that his code was not CPU-bound to begin with. His real

Re: Python console rejects an object reference, having made an object with that reference as its name in previous line

2014-12-18 Thread Michael Torrie
On 12/18/2014 09:19 AM, Simon Evans wrote: @Steven D'Aprano, I input the following to Python 2.7, which got the following:- from bs4 import BeautifulSoup with open(ecologicalpyramid.html,r) as ecological_pyramid:

Re: Is there a way to schedule my script?

2014-12-18 Thread Michael Torrie
On 12/17/2014 01:42 PM, Juan Christian wrote: On Wed Dec 17 2014 at 6:25:39 PM John Gordon gor...@panix.com wrote: If you want to solve your problem entirely within Python, look at the scheduler module. (Although even this isn't a complete solution, as you still have to make sure the program

Re: [ANN] EasyGUI_Qt version 0.9

2015-01-03 Thread Michael Torrie
On 01/03/2015 10:11 AM, André Roberge wrote: Would you care to elaborate? All the code I have written works correctly on all the tests I have done. I do have reports from a user using a Mac with Python 2.7 for which some widgets did not quite work properly ... but that's all I have heard

[issue1205] urllib fail to read URL contents, urllib2 crash Python

2007-10-16 Thread Michael Torrie
Michael Torrie added the comment: I had a situation where I was talking to a Sharp MFD printer. Their web server apparently does not serve chunked data properly. However the patch posted here put it in an infinite loop. Somewhere around line 525 in the python 2.4 version of httplib.py, I had

Re: HTTP over Asynchronous AF_UNIX Socket in python

2015-01-26 Thread Michael Torrie
On 01/26/2015 06:32 AM, Norah Jones wrote: Now my problem is the HTTP request which to be sent must go through AF_UNIX socket. The Python Twisted framework may be of use to you. It's got a very steep learning curve, but it's fairly easy to change the underlying byte transport for any protocol

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-02-04 Thread Michael Torrie
On 02/04/2015 05:19 PM, sohcahto...@gmail.com wrote: They can take your computer and it doesn't matter if you've got your files on Dropbox. My dog ate my USB stick. :-) I never used a USB stick for school work. At this point, I'm probably sounding like a shill for Dropbox, but I'm

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be beyond the reach of the standard RAII infrastructure. Of course this only brings up one side of memory-mgmt problems viz. unreclaimable memory. What

Re: Downloading videos (in flash applications) using python

2015-02-02 Thread Michael Torrie
On 02/02/2015 12:30 PM, Gabriel Ferreira wrote: Hi Paul, I presume the stream operator doesn't want to prevent me from downloading or recording the videos. I just wanna know more about some lib that could be used to deal with Flash Player Applications... Or possibly, anything that could lead

Re: Downloading videos (in flash applications) using python

2015-02-02 Thread Michael Torrie
On 02/02/2015 04:21 PM, Gabriel Ferreira wrote: The problem is that this particular website uses a flash player application do broadcast the live images of the urban areas. I'm not too familiar with Flash Applications. I don't know how to deal with them using Python. I was wondering if someone

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 12:39 AM, Marko Rauhamaa wrote: Michael Torrie torr...@gmail.com: http://en.cppreference.com/w/cpp/utility/functional/function Thus if we were to shoehorn your example into C++, the result would be idiomatically very similar to what you have in your Python code. I can

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 10:57 AM, Marko Rauhamaa wrote: I really don't understand why you are taking all of this so personally. We are just discussing different aspects of different programming languages. Fair enough. You raise good points. I am not taking it personally; your emails, lacking emotional

Re: Ghost vulnerability

2015-02-03 Thread Michael Torrie
On 02/03/2015 04:19 AM, Steven D'Aprano wrote: Anssi Saari wrote: Rustom Mody rustompm...@gmail.com writes: How many people (actually machines) out here are vulnerable? http://security.stackexchange.com/questions/80210/ghost-bug-is-there-a-simple-way-to-test-if-my-system-is-secure shows

Re: lambdak: multi-line lambda implementation in native Python

2015-01-16 Thread Michael Torrie
On 01/15/2015 10:29 PM, Ian Kelly wrote: On Thu, Jan 15, 2015 at 9:00 PM, Chris Angelico ros...@gmail.com wrote: My first response was going to be Well, you can always add another layer of indirection to try to solve your problem, but then I went and looked up builders on Wikipedia. Now I'm

Re: Hello World

2015-01-17 Thread Michael Torrie
On 01/17/2015 07:51 AM, Albert van der Horst wrote: In article mailman.17471.1420721626.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: SNIP But sure. If you want to cut out complication, dispense with user accounts altogether and run everything as root. That's WAY

Re: Trees

2015-01-19 Thread Michael Torrie
On 01/19/2015 04:08 PM, Steven D'Aprano wrote: Zachary Gilmartin wrote: Why aren't there trees in the python standard library? Possibly because they aren't needed? Under what circumstances would you use a tree instead of a list or a dict or combination of both? That's not a rhetorical

Re: What killed Smalltalk could kill Python

2015-01-21 Thread Michael Torrie
On 01/21/2015 04:37 PM, Tim Daneliuk wrote: On 01/21/2015 10:34 AM, Steven D'Aprano wrote: In 2009, Robert Martin gave a talk at RailsConf titled What Killed Smalltalk Could Kill Ruby. (No cheering, that sort of attitude is one of the things that killed Smalltalk.) Although Martin discusses

Re: Hello World

2015-01-17 Thread Michael Torrie
On 01/17/2015 11:47 AM, Michael Ströder wrote: sudo makes administrators careless, lazy and it is not simple at all. Admins must have separate accounts with separate credentials for administrative work and must be careful when using an administrative account. Right. This is not a bad idea

Re: lambdak: multi-line lambda implementation in native Python

2015-01-15 Thread Michael Torrie
On 01/15/2015 06:34 PM, Roy Smith wrote: The ebb and flow of technology has recently brought me someplace I never thought I'd be. Java-land. And what I've discovered is that factories are so last year. Apparently builders are the new thing. It's never clear to me whether all these fancy

<    3   4   5   6   7   8   9   10   11   12   >