Re: JUST GOT HACKED

2013-10-04 Thread Wayne Werner
On Tuesday, October 1, 2013 5:06:38 PM UTC-5, Ben Finney wrote: This is an unmoderated forum, so we have occasional spates of persistent nuisances, and those who respond with the maturity level and impulse control of an average six-year-old. Hey! That's so degrading! I don't know many

Re: JUST GOT HACKED

2013-10-04 Thread Wayne Werner
On Wednesday, October 2, 2013 5:43:32 AM UTC-5, Ferrous Cranus wrote: I only re-ask the same thing if: 1. Di not understood what was provided or proposed to me as being a solution 2. Still feel that that the solution provided to me doesn't meet my needs and should have been

Re: better and user friendly IDE recommended?

2013-09-12 Thread Wayne Werner
On Thu, 12 Sep 2013, Ben Finney wrote: Better to learn these once, in a single powerful tool that can be maintained independent of any one vendor for as long as its community is interested. And if you're a developer, even a community of one is enough ;) -W --

Re: print function and unwanted trailing space

2013-09-11 Thread Wayne Werner
On Sat, 31 Aug 2013, candide wrote: # - for i in range(5): print(i, end=' ') # - The last ' ' is unwanted print() # - Then why not define end='' instead? -W -- https://mail.python.org/mailman/listinfo/python-list

Re: Language design

2013-09-11 Thread Wayne Werner
On Tue, 10 Sep 2013, Ben Finney wrote: The sooner we replace the erroneous “text is ASCII” in the common wisdom with “text is Unicode”, the better. I'd actually argue that it's better to replace the common wisdom with text is binary data, and we should normally look at that text through

Re: Moving to Python for web

2013-09-05 Thread Wayne Werner
On Thu, 29 Aug 2013, Andreas Ecaz wrote: I've decided to go with Flask! It's now running on UWSGI with NGINX. Hopefully I can get some stuff done :) @Chris “Kwpolska” Warrick I just don't like the big frameworks, for me there is too much magic going on. I'm a huge fan of Flask - I also

Re: PEP8 79 char max

2013-08-03 Thread Wayne Werner
On Wed, 31 Jul 2013, Joshua Landau wrote: To explain, I tend to take the HTML form of alignment by wrapping: open stuff stuff stuff close to open     stuff     stuff     stuff close Depending on how much 'stuff' I have, I, for one, prefer a third: open stuff stuff stuff

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

2013-08-03 Thread Wayne Werner
On Thu, 1 Aug 2013, Gilles wrote: On Wed, 24 Jul 2013 10:38:52 -0400, Kevin Walzer k...@codebykevin.com wrote: Thanks. hMailServer was one of the apps I checked, and I was just making sure there weren't something simpler, considering my needs, ideally something like Mongoose MTA. Have you

Re: Does Python 'enable' poke and hope programming?

2013-08-03 Thread Wayne Werner
On Thu, 1 Aug 2013, CM wrote: (My subject line is meant to be tongue and cheek inflammatory) I've been thinking about why programming for me often feels like ice skating uphill. I think part of the problem, maybe the biggest part, is what now strikes me as a Very Bad Habit, which is poke

Re: Logging help

2013-08-03 Thread Wayne Werner
On Thu, 1 Aug 2013, Joseph L. Casale wrote: I have a couple handlers applied to a logger for a file and console destination. Default levels have been set for each, INFO+ to console and anything to file. How does one prevent logging.exception from going to a specific handler when it falls

Re: Python performance

2013-08-03 Thread Wayne Werner
On Fri, 2 Aug 2013, Schneider wrote: Hi list, I have to write a small SMTP-Relay script (+ some statistic infos) and I'm wondering, if this can be done in python (in terms of performance, of course not in terms of possibility ;) ). It has to handle around 2000 mails per hour for at least

Re: Newbie: Python 3 and web applications?

2013-07-30 Thread Wayne Werner
On Fri, 26 Jul 2013, Rui Maciel wrote: I'm currently learning Python, and I've been focusing on Python3. To try to kill two birds with one stone, I would also like to learn the basics of writing small web applications. These web applications don't need to do much more than provide an

Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Wayne Werner
On Sat, 13 Jul 2013, Νικόλας wrote: But then how do you explain the fact that http://www.maxmind.com/en/geoip_demo pinpointed Thessaloníki and not Athens and for 2 friends of mine that use the same ISP as me but live in different cities also accurately identified their locations too? If you

Re: Dihedral

2013-07-15 Thread Wayne Werner
On Mon, 15 Jul 2013, Devyn Collier Johnson wrote: On 07/15/2013 08:36 AM, Steven D'Aprano wrote: On Mon, 15 Jul 2013 06:06:06 -0400, Devyn Collier Johnson wrote: On 07/14/2013 02:17 PM, 8 Dihedral wrote: [...] Do we want volunteers to speed up search operations in the string module in

Re: UTF-EBCDIC encoding?

2013-07-15 Thread Wayne Werner
On Mon, 15 Jul 2013, Kev Dwyer wrote: Joel Goldstick wrote: On Fri, Jul 12, 2013 at 3:12 PM, Skip Montanaro s...@pobox.com wrote: I can't help you. I'm astonished. Trying to imagine the work environment where this technology would be necessary

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Wayne Werner
On Sat, 13 Jul 2013, Νικόλας wrote: But it works for me, How can it be impossible and worked for me at the same time? 2 + 2 = 4 2 + 6 = 8??? Why can't I make 2 and 6 equal 4? It worked for 2, so I know it's not impossible! I don't care what everyone says, I was able to make one case work so

Re: Ideal way to separate GUI and logic?

2013-07-13 Thread Wayne Werner
On Sat, 13 Jul 2013, fronag...@gmail.com wrote: Well, I'm a newcome to Python, but I'm developing a program with a GUI in tkinter, and I'm wondering what is the best, 'most pythonic' way of doing this? I could, obviously, write a monolithic block of code. True, you could, but don't do that.

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

2013-07-12 Thread Wayne Werner
On Thu, 4 Jul 2013, Νίκος Γκρ33κ wrote: Στις 4/7/2013 6:10 μμ, ο/η MRAB έγραψε: What do you mean I don't know how to catch the exception with OSError? You've tried except socket.gaierror and except socket.herror, well just write except OSError instead! try: host =

UTF-EBCDIC encoding?

2013-07-12 Thread Wayne Werner
Is anyone aware of a UTF-EBCDIC[1] decoder? While Python does have a few EBCDIC dialects in the codecs, it does not have the (relatively new?) UTF-EBCDIC one. Additionally, if anyone is aware of a Python tool that can unpack a mainframe PDS file, that would also be worthwhile. Thanks,

Re: Default scope of variables

2013-07-07 Thread Wayne Werner
On Fri, 5 Jul 2013, Chris Angelico wrote: Oh. Uhm... ahh... it would have helped to mention that it also has a commit() method! But yes, that's correct; if the object expires (this is C++, so it's guaranteed to call the destructor at that close brace - none of the Python vagueness about when

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-04 Thread Wayne Werner
On Wed, 3 Jul 2013, Dennis Lee Bieber wrote: Consider that the Powershell default is to /prevent/ execution of script files unless some security settings have been changed; even local script files need to be signed to be executed. Protip: No they don't - wrap it in a cmd/bat file and

Re: Default scope of variables

2013-07-04 Thread Wayne Werner
On Thu, 4 Jul 2013, Steven D'Aprano wrote: [1] Based on empirical evidence that Python supports names with length at least up to one million characters long, and assuming that each character can be an ASCII letter, digit or underscore. The specification *does* state unlimited length:

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Wayne Werner
On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING WAS ASSIMULATED BY THE PYTHON COMMUNITY. OF COURSE PYTHON IS A GOOD LANGUAGE FOR DEVELOPING ARTIFICIAL INTELEGENT ROBOT PROGRAMS NOT SO BRAIN DAMAGES, OR SO SLAVERY AS C/C++ OR ASEMBLY PARTS. Best.

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Wayne Werner
On Fri, 28 Jun 2013, Joel Goldstick wrote: On Fri, Jun 28, 2013 at 2:52 PM, Wayne Werner wa...@waynewerner.com wrote: On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING WAS ASSIMULATED BY THE PYTHON COMMUNITY

Re: Determine actually given command line arguments

2013-05-15 Thread Wayne Werner
On Wed, 15 May 2013, Henry Leyh wrote: Yes, I was trying that and it sort of works with strings if I use something sufficiently improbable like __UNSELECTED__ as default. But it gets difficult with boolean or even number arguments where you just may not have valid improbable defaults. You

Re: object.enable() anti-pattern

2013-05-13 Thread Wayne Werner
On Mon, 13 May 2013, Greg Ewing wrote: Wayne Werner wrote: On Fri, 10 May 2013, Gregory Ewing wrote: f = open(myfile.dat) f.close() data = f.read() To clarify - you don't want a class that has functions that need to be called in a certain order with *valid input* in order

Re: object.enable() anti-pattern

2013-05-12 Thread Wayne Werner
On Fri, 10 May 2013, Robert Kern wrote: On 2013-05-10 12:00, Steven D'Aprano wrote: But either way, that's fine. You've found an object where it does make sense to have an explicit make it go method: first one entity has permission to construct the object, but not to open the underlying file.

Re: object.enable() anti-pattern

2013-05-12 Thread Wayne Werner
On Fri, 10 May 2013, Gregory Ewing wrote: Wayne Werner wrote: You don't ever want a class that has functions that need to be called in a certain order to *not* crash. That seems like an overly broad statement. What do you think the following should do? f = open(myfile.dat) f.close

Re: object.enable() anti-pattern

2013-05-09 Thread Wayne Werner
On Wed, 8 May 2013, Steven D'Aprano wrote: I'm looking for some help in finding a term, it's not Python-specific but does apply to some Python code. This is an anti-pattern to avoid. The idea is that creating a resource ought to be the same as turning it on, or enabling it, or similar. For

Re: Encoding NaN in JSON

2013-04-22 Thread Wayne Werner
be converted back into a floating point NaN object. I infer that you were proposing a JSON null value and not the string 'null'? Not me, Wayne Werner proposed to use the JSON null value. I parsed the backticks (`) used by him as a way to delimit it from text and not as a string. That was, in fact, my

Re: dynamic forms generation

2013-04-18 Thread Wayne Werner
On Tue, 16 Apr 2013, andrea crotti wrote: This is not really scalable, and we want to make the whole thing more generic. So ideally there could be a DSL (YAML or something else) that we could define to then generate the forms, but the problem is that I'm quite sure that this DSL would soon

Re: anyone know pandas ? Don't understand error: NotImplementedError...

2013-04-18 Thread Wayne Werner
On Wed, 17 Apr 2013, someone wrote: File /usr/lib/pymodules/python2.7/pandas/tseries/offsets.py, line 214, in rule_code raise NotImplementedError NotImplementedError Can anyone tell why this error appears and how to fix it? I don't know anything about pandas, but my

Re: Encoding NaN in JSON

2013-04-18 Thread Wayne Werner
On Wed, 17 Apr 2013, Miki Tebeka wrote: I'm trying to find a way to have json emit float('NaN') as 'N/A'. No. There is no way to represent NaN in JSON. It's simply not part of the specification. I know that. I'm trying to emit the *string* 'N/A' for every NaN. Why not use `null` instead?

Re: Problems with sockets and threads

2013-04-11 Thread Wayne Werner
On Thu, 11 Apr 2013, Dexter Deejay wrote: When i try to run this code and to connect to server (server is written in java that part of code is ok) everything stalls. Thread that i created here occupies processor all the time and GUI freezes. It's supposed to be waiting for message from

Re: Problems with sockets and threads

2013-04-11 Thread Wayne Werner
On Thu, 11 Apr 2013, Dexter Deejay wrote: Yeah, that seems to be problem. Waiting for message is in theory infinite. But why doesn't this separate thread leave processor while it is sleeping? As far as I've been able to tell? Magic ;) But I haven't really dug into it. If you're really doing

Re: monty python

2013-03-21 Thread Wayne Werner
On Thu, 21 Mar 2013, Roy Smith wrote: In article mailman.3582.1363853304.2939.python-l...@python.org, Terry Reedy tjre...@udel.edu wrote: On 3/20/2013 10:03 AM, franzferdinand wrote: Ok, thanks everybody! Threads are like the Sorcerer's Apprentice. You can start 'em, but you cannot stop

Re: Jinja2 installation help

2013-02-08 Thread Wayne Werner
On Fri, 8 Feb 2013, Robert Iulian wrote: Hello, I recently started learning Python. Just finished learning the basis of it, and now I think I'm ready to start working on a simple website but I am having some difficulties installing Jinja2. Can anyone post a dummy guide on how to install it,

Re: The best, friendly and easy use Python Editor.

2013-01-31 Thread Wayne Werner
On Thu, 24 Jan 2013, Tim Chase wrote: On 01/24/13 13:34, Leonard, Arah wrote: All true (especially the holy wars bit!). OP didn't (as far as I can see) even say which OS he is using. Anyway, my suggestion is generally that people use the editor with which they are already comfortable. Sound

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-06 Thread Wayne Werner
On Fri, 4 Jan 2013, Roy Smith wrote: In article mailman.105.1357349909.2939.python-l...@python.org, Cameron Simpson c...@zip.com.au wrote: On 01/04/13 01:34, Anssi Saari wrote: | Just curious since I read the same thing in a programming book recently | (21st century C). So what's the

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-02 Thread Wayne Werner
On Wed, 2 Jan 2013, Michael Torrie wrote: On 01/01/2013 11:43 AM, Mitya Sirenef wrote: Therefore, deleting 3 WORDs is 3daW (mnemonic: del a WORD 3 times). Interesting. I typically use just d3w. 3daW seems to delete 3 lines for me, the same result as d3enter. Another favorite command is d

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-02 Thread Wayne Werner
On Tue, 1 Jan 2013, Mitya Sirenef wrote: On 01/01/2013 02:02 PM, Roy Smith wrote: That's true with Vim, as well, especially when I'm making a custom mapping and I can NEVER remember what some combination does, even though if I actually needed to use it, it pops right out, so to find out, I have

Re: New to python, do I need an IDE or is vim still good enough?

2013-01-02 Thread Wayne Werner
On Tue, 1 Jan 2013, Ramchandra Apte wrote: On Friday, 28 December 2012 01:31:16 UTC+5:30, mogul wrote: 'Aloha! I'm new to python, got 10-20 years perl and C experience, all gained on unix alike machines hacking happily in vi, and later on in vim. Now it's python, and currently mainly

Re: context aware execution

2012-12-19 Thread Wayne Werner
On Thu, 20 Dec 2012, Chris Angelico wrote: On Thu, Dec 20, 2012 at 2:57 AM, Bart Thate feedbackf...@gmail.com wrote: I want in a function or method determine the context of my caller and adapt the functionality accordingly. First off, please don't! Your code will be *extremely* confusing.

Re: Why Doesn't This MySQL Statement Execute?

2012-12-18 Thread Wayne Werner
On Tue, 18 Dec 2012, Tom Borkin wrote: Hi; I have this test code:       if i_id == 1186:   sql = 'insert into interactions values(Null, %s, Call Back, %s)' % (i_id, date_plus_2)   cursor.execute(sql)   db.commit()   print sql It prints the sql statement, but it doesn't execute.

Posix call (execve) breaks mercurial?

2012-10-11 Thread Wayne Werner
So... this is certainly the deepest I've got to dig into any source code. I'm experimenting with Review Board for code reviews, and trying to get it set up/working here at work. When using post-review, however, I started getting issues with untrusted users - even though they were set to

Re: Posix call (execve) breaks mercurial?

2012-10-11 Thread Wayne Werner
On Thu, 11 Oct 2012, Wayne Werner wrote: So here's where things got weird. I could call `subprocess.check_output(['hg', 'root'])`, and things worked just fine. But when I added the env parameter, I got the untrusted issues. So if I did: import os, subprocess # Works just fine

Re: print or write on a text file ?

2012-09-28 Thread Wayne Werner
On Fri, 28 Sep 2012, Franck Ditter wrote: Hi ! Here is Python 3.3 Is it better in any way to use print(x,x,x,file='out') or out.write(x) ? Any reason to prefer any of them ? There should be a printlines, like readlines ? Thanks, The print function automatically appends newlines to the end of

Re: Article on the future of Python

2012-09-27 Thread Wayne Werner
On 9/27/2012 9:05 PM, Jason Friedman wrote: Fair enough, but it's the M in the LAMP stack I object to. I'd much rather have P. +1 I know this isn't the list for database discussions, but I've never gotten a decent answer. I don't know much about either, so I'm kind of curious why

Re: Algorithms using Python?

2012-09-26 Thread Wayne Werner
On Fri, 21 Sep 2012, Dennis Lee Bieber wrote: On Fri, 21 Sep 2012 14:26:04 +0530, Mayuresh Kathe mayur...@kathe.in declaimed the following in gmane.comp.python.general: Is there a good book on foundational as well as advanced algorithms using Python? Depends on what you mean by

Re: One of my joomla webpages has been hacked. Please help.

2012-09-26 Thread Wayne Werner
On Sat, 22 Sep 2012, Νίκος Γκρεεκ wrote: Okey i'll ask this to the officila joomla forum, one last thing though. Is there a way to somehow embed(or utilize) python code, for example my python counter code script you have seen last week inside my Joomla/WordPress cms sites? For example:

Re: One of my joomla webpages has been hacked. Please help.

2012-09-26 Thread Wayne Werner
On Sun, 23 Sep 2012, Dwight Hutto wrote: snip We're the borg. Oh, so you *are* a robot. That does explain your posts ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Who's laughing at my responses, and who's not?

2012-09-26 Thread Wayne Werner
On Tue, 25 Sep 2012, Dwight Hutto wrote: It sounds pretentious, but over the past several days, I've been slammed on every post almost. All because of an argument over me not posting a little context in a conversation, that seemed short and chatty. Your being slammed has nothing to do with