Re: GUIs - A Modest Proposal

2010-06-14 Thread Stephen Hansen
On 6/14/10 10:35 PM, rantingrick wrote: > On Jun 14, 11:08 pm, Stephen Hansen wrote: > > >> Does not perform to spec. Quote, "Inside of A, there are four items in a >> vertical line. The bottom which takes up half of the total vertical >> space, and the top three

Re: GUIs - A Modest Proposal

2010-06-14 Thread Stephen Hansen
On 6/14/10 9:08 PM, Stephen Hansen wrote: > On 6/14/10 8:31 PM, rantingrick wrote: >> On Jun 14, 9:41 pm, Stephen Hansen wrote: >> >>> I wasn't aware of [row|column]configure, no: however, I am dubious of >>> how it directly applies. >> >> Mayb

Re: logging = logging.getLogger(__name__)

2010-06-15 Thread Stephen Hansen
would work with the more specific one seamlessly. But such frameworks usually also have a setup/environment sort of file where this is not done, and that's where things like adding handlers belongs. Just as an aside. Renaming "logging = ..." to "logger = ..." is probabl

Re: Possible to make subprocess.Popen jobs run serially rather than in parallel?

2010-06-15 Thread Stephen Hansen
TIME*?? > > That might be useful and avoid crashes and disk swapping. Just call "process.wait()" after you call process = subprocess.Popen(...) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ sig

Re: Overriding "__setattr__" of a module - possible?

2010-06-15 Thread Stephen Hansen
class in sys.modules is really the only way to fake the behavior. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding "__setattr__" of a module - possible?

2010-06-15 Thread Stephen Hansen
On 6/15/10 10:25 PM, John Nagle wrote: > On 6/15/2010 9:33 PM, Stephen Hansen wrote: >> Replacing the module with a class in sys.modules is really the only way >> to fake the behavior. > >OK, working on this. I can make a module make itself into a > fake class

Re: INCONTROVERTIBLE PROOF of the Incompetence of FBI

2010-06-15 Thread Stephen Hansen
Truth of the Zen as Delivered Unto Us by He Who Is The Timbot. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced Dictionary

2010-06-16 Thread Stephen Hansen
e underscores are explicitly reserved for Python to define as Special. They also imply a slightly different calling semantic: normal leading-and-trailing double underscore methods bypass instance lookup. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io

Re: Possible to make subprocess.Popen jobs run serially rather than in parallel?

2010-06-16 Thread Stephen Hansen
On 6/16/10 7:04 AM, Chris Seberino wrote: > On Jun 15, 2:03 pm, Stephen Hansen wrote: > >> Just call "process.wait()" after you call process = subprocess.Popen(...) > > I may have not been clear. > I *don't* want web app to block on Popen.wait. > I *d

Re: Overriding "__setattr__" of a module - possible?

2010-06-16 Thread Stephen Hansen
dule level, too. Well, fine, be that way, all right and correct and shiznit. :) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Advanced Dictionary

2010-06-16 Thread Stephen Hansen
On 6/16/10 9:34 AM, Steven D'Aprano wrote: > On Wed, 16 Jun 2010 09:17:47 -0700, Stephen Hansen wrote: > >> Leading-and-trailing double underscores are explicitly reserved for >> Python to define as Special. > > > That part is correct. But of course Python does

Re: Removing anti-Jewish postings from Python list

2010-06-16 Thread Stephen Hansen
get junked. Maybe the python-list spam filters can be tweaked, who knows. He'll probably always show up on the usenet/Google Groups part of things though. Cuz Google's notoriously bad at controlling spam on Groups(*) -- Stephen Hansen ... Also: Ixokai ... Mail: me+l

Re: Removing anti-Jewish postings from Python list

2010-06-16 Thread Stephen Hansen
rt of stuff never originates from the mailing list) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing anti-Jewish postings from Python list

2010-06-16 Thread Stephen Hansen
o report! Even if it does no good. > Should we ever catch up with him, is there a module in the stdlib or on > pypi that let's you stretch piano wire tightly around his testicles? And > I'm *NOT* joking! Haha. And ow. -- Stephen Hansen ... Also: Ixokai ... Mail:

Re: Writing to open subprocess pipes.

2010-06-16 Thread Stephen Hansen
those file objects to non-blocking and such. I found this useful when I needed to do it: http://code.activestate.com/recipes/440554/ -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digita

Re: Removing anti-Jewish postings from Python list

2010-06-16 Thread Stephen Hansen
s able to be enabled, on the few groups I've been on, it is a lot less effective then what they use at Gmail, anecdotally speaking. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description:

Re: a +b ?

2010-06-16 Thread Stephen Hansen
otional > state". It could certainly do with a little less 'taking oneself too seriously' :) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ P.S. Python-list was more fun when Timbot was around, and <0.2-ly y&#x

Re: a +b ?

2010-06-16 Thread Stephen Hansen
On 6/16/10 9:43 PM, James Mills wrote: > On Thu, Jun 17, 2010 at 2:23 PM, Stephen Hansen > wrote: >> It could certainly do with a little less 'taking oneself too seriously' :) > > You do realize my question was completely rhetorical :) > > --James > > /

Re: Upgrading from Python 2.6.5 w.r.t. matplotlib/numpy?

2010-06-16 Thread Stephen Hansen
Terribly Awfully Long Away (meaning, some indeterminate time probably counted in months and not years), but its not there yet. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digit

Re: gui doubt

2010-06-16 Thread Stephen Hansen
On 6/16/10 10:40 PM, madhuri vio wrote: > if i want to create a button > which performs the transcription of dna to rna > using tkinter in a gui... > can u give me the method... You can not possibly be serious. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python

Re: Serializing functions

2010-06-17 Thread Stephen Hansen
licated sort of code object marshalling and manipulation on the other side. I have no idea where to even begin in that situation (hw do you turn a code object into something you can actually pass arguments to, hmm? I only know how to 'exec' a bare code object) -- Stephen

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Stephen Hansen
y to use "from ... import ..." to pull in classes and (implicitly) constants, and despite how the rules say 'one module per line' its OK to pull in more then one name -from- a module at once. > My understanding is that both forms of the import command require > the e

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Stephen Hansen
On 6/17/10 10:01 AM, Ethan Furman wrote: > Stephen Hansen wrote: >> On 6/17/10 9:12 AM, pyt...@bdurham.com wrote: >> >> Now, this is all IMHO: the style guide does not define any 'guidelines' >> on this, except that its okay to use "from ... import

Re: Efficiency/style issues of import vs. from import , ...

2010-06-17 Thread Stephen Hansen
On 6/17/10 10:22 AM, Jack Diederich wrote: > On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen >> It explicitly states later its entirely OK to import classes. It never >> says anything else directly, except in the example given, it shows you >> importing a constant. So

Re: The inverse of .join

2010-06-17 Thread Stephen Hansen
lit grow an addition keyword argument to specify the desired > behaviour? (Although it's simple enough to define your own function.) Guido finds keyword-arguments-to-change-behavior to be unPythonic, IIRC. It generally means 'make a new API'. But, the question is-- is it w

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
ocking: http://groups.google.com/group/comp.lang.python/browse_thread/thread/066de1c0fd38642f# -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.pyth

Re: how to get bit info

2010-06-17 Thread Stephen Hansen
not byte & BIT_6: ... byte = byte | BIT_6 ... print "Bit 6 wasn't set, BUT NOW IS." Bit 6 wasn't set, BUT NOW IS. >>> byte 99 (I added 'how to set a specific bit' just cuz) Basically, those BIT_X lines are creating numbers which have *only* the s

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
asn't written anything new out yet by the time you call that. You have to try/except looking for that and catch it. That's why I preferred the recipe I linked to in that thread: it uses select to only read when there's something -to- actually read. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
>>>> from asynchronous import * >>>> p = Popen(["python", "increment.py"], stdin=PIPE, stdout=PIPE) >>>> send_all(p, "5\n") >>>> recv_some(p) > '' >>>> send_all(p, "6\n") >>>> recv

Re: how to get bit info

2010-06-17 Thread Stephen Hansen
On 6/17/10 1:29 PM, Grant Edwards wrote: > On 2010-06-17, Stephen Hansen wrote: > >>>>> BIT_1 = 1 << 0 >>>>> BIT_2 = 1 << 1 > > ... > >> Basically, those BIT_X lines are creating numbers which have *only* the >> specified

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
On 6/17/10 2:40 PM, Laurent Verweijen wrote: > Op donderdag 17-06-2010 om 14:36 uur [tijdzone -0700], schreef Stephen > Hansen: >> On 6/17/10 2:09 PM, Laurent Verweijen wrote: >>> It just gives me an empty string. >>> >>> Python 2.6.5 (r265:79063, Apr 16 201

Re: Py_single_input and the side-effects...

2010-06-17 Thread Stephen Hansen
say you don't care about what value ends up there, consider it thrown away. That the interactive interpreter happens to store the last value in a variable of the same name doesn't really mean anything. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT

Re: Running a program from another program.

2010-06-17 Thread Stephen Hansen
tempting to call len() on an integer) if you corrected your arguments. You're getting the EOFError, because you're never sending anything to the subprocess. You're not getting anything from the subprocess because it never receives anything to send back. And apparently there&

Re: constructing an object from another instance of the same class

2010-06-18 Thread Stephen Hansen
sometimes less: but generally, only at the boundry of your program do you need to worry about type-correctness (i.e., where user and data is accepted, you have to convert stuff there.) Anywhere else, its a bug if you pass the wrote thing in: unit tests and exceptions/tracebacks are excellent for findin

Re: List of lists surprising behaviour

2010-06-18 Thread Stephen Hansen
/never/ implicitly copies -- and that it objects are discrete entities and not just names of certain values, it more likely then not will be beneficial to you quite often down the road. You'll -want- that to be how things work. Eventually. When you learn more Python. -- Stephen Hansen ..

Re: creating application specific files?

2010-06-18 Thread Stephen Hansen
g to do with Python. http://letmegoogleforyou.com/?q=how+to+associate+files+in+windows -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python

Re: If Not CGI...

2010-06-19 Thread Stephen Hansen
But then when this project is over, sit down and load up Django (or another of the options: look around, find one that tickles you), and spend a few days re-doing this project in that. Not for real, but for practice, to figure out how you'd do it in a proper framework. See how you like it.

Re: D-CM; Software Testers

2010-06-19 Thread Stephen Hansen
What's it *do*? I don't like downloading software until I have an idea of what its for :) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: D-CM; Software Testers

2010-06-20 Thread Stephen Hansen
e other addons) That's better. :) I would suggest adding a little more: some bullet points of how they work together in a way that's new or efficient or what's compelling about the interaction. And a screenshot or two. Either way, I'm now curious enough to actually download it

OT! Python vs... Objective-C!

2010-06-20 Thread Stephen Hansen
ing me go out of my way to program a hundred lines when only ten (okay, maybe 20— it isn’t /that/ Pythonic) will do. Also strange: its as force-OOP-down-your-throat as Java, and yet I don’t feel a gag reflex. Can’t explain it.""" Anyways. Just curious. Ya'll are all the Python

Re: OT! Python vs... Objective-C!

2010-06-21 Thread Stephen Hansen
On 6/21/10 6:47 AM, Grant Edwards wrote: > On 2010-06-21, Stephen Hansen wrote: > > [...] > >> I'm just learning Objective-C on my spare time, and am having these >> entirely disturbing feelings of familiarity, where strange swirling >> thoughts enter my head

Re: __slot__: what is it good for?

2010-06-21 Thread Stephen Hansen
d reason to do something sneaky (such as add an attribute to an instance at runtime: its actually *extremely* rare for someone to do that, so why try to force it away?) down the road that you might not think of at the time. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixok

Re: __slot__: what is it good for?

2010-06-21 Thread Stephen Hansen
On 6/21/10 8:08 AM, Stephen Hansen wrote: > If you don't want a class to have attributes added at runtime, the > Pythonic way to achieve that is to... simply add attributes at runtime. Errr. The Pythonic way to achieve that is to... simply NOT add attributes at runtime. I.e., choos

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Stephen Hansen
and programs, don't ever get there. And even more fortunately: very, very often when those people who *do* get to that place, they actually can use a library which has already done it and get those major performance gains without writing the assembly themselves. -- Stephen Hansen ... A

Re: Where is the help function defined?

2010-06-21 Thread Stephen Hansen
11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> help.__class__ -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixok

Re: __slot__: what is it good for?

2010-06-21 Thread Stephen Hansen
On 6/21/10 11:06 AM, Terry Reedy wrote: > On 6/21/2010 11:24 AM, Stephen Hansen wrote: >> On 6/21/10 8:08 AM, Stephen Hansen wrote: >>> If you don't want a class to have attributes added at runtime, the > >> The Pythonic way to achieve that is to... simply

Re: What is the difference between 'type' and 'class'?

2010-06-21 Thread Stephen Hansen
ble(i.e., ints, strings), and its awful hard to make an immutable class. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: float from numbers in text file

2010-06-21 Thread Stephen Hansen
ple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> f = open("test.txt", "r") >>> for line in f: ... print float(line) ... 52.2375412 5.1802704 Always include w

Re: float from numbers in text file

2010-06-21 Thread Stephen Hansen
ave that number. Try it in the interactive interpreter. float('51.9449702') works fine. I suspect your "line", for whatever reason, contains the string "not found", as in: >>> float('not found') Traceback (most recent call last): File "&q

Re: float from numbers in text file

2010-06-21 Thread Stephen Hansen
in your data file, or some other logic going on (maybe something related to this 'tel' thing, I don't know). Are you sure there's no lines in out.txt which have, say, some text (on the left end)? Or maybe some blank lines? Maybe you should send the whole file and the data.txt if you don't see where the problem is. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
an academic desire to learn a new language, then learn both. Learning a new language is always a net win. Which first? Whatever you have the vaguest preference for after five minutes. No reason to be picky with adding tools to your mental toolbox. -- Stephen Hansen ... Also: Ixokai ...

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
up as a "book" to sell to naive people for outrageous prices; and put Guido's name on it to give it legitimacy. It also bundles up the *tutorial* for $22. There's a number of very good, large Python books which sell for that. Surely Fred L Drake and Gudio aren't really invo

Re: print line number and source filename

2010-06-22 Thread Stephen Hansen
e 'root' -- you can skip if you only use one), the exact module (test.py), function (run) and line (6). -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
On 6/22/10 11:01 AM, Terry Reedy wrote: > On 6/22/2010 11:49 AM, Stephen Hansen wrote: >> Uhh, that looks like a scam. Someone scraped the Python docs and bundled >> it up as a "book" to sell to naive people for outrageous prices; > > Various people have asked on th

Re: print line number and source filename

2010-06-22 Thread Stephen Hansen
, and so I always use format strings so I don't have to rewrite the line to convert from + to % later. (And in a couple years when I can migrate to Py3, I'll start using .format()) -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
inflict Haskell on anyone). It bends your brain and makes you think in a different way. The mental toolbox expands. New possibilities suddenly occur to you down the road when you return to Python (or Perl, even) for some sane, regular sort of coding. Learning new languages = good. -- Steph

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
llness (okay, no, not really), but we're also quite content and happy for people to use Ruby if they want to. And we're oddly not threatened by its popularity. Good for you, Rubyers. I applaud your success and wish you more of it. -- Stephen Hansen ... Also: Ixokai ... Mail

Re: Uses of a deprecated module 'string'

2010-06-22 Thread Stephen Hansen
/groups.google.com/group/comp.lang.python/browse_thread/thread/7dfa560c675b06b2/47ee7d03aa4c9b09 We really don't have to do it again. :) Everyone knows you don't like unicode, man. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: ht

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
fellow Python-folks possibly getting ripped off makes me an asshat, so be it. Go y'know-what yourself. -- Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
If it looks like a scam, some due-diligence and concern is appropriate. Especially when asked by someone like the OP who is not you, is not sophisticated in their knowledge of the community and the resources available to it. If it looks like a scam, take care personally. If it looks like a scam a

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
On 6/22/10 10:39 PM, Dennis Lee Bieber wrote: > On Tue, 22 Jun 2010 15:55:51 -0700, Stephen Hansen > declaimed the following in > gmane.comp.python.general: > >> I second Forth. Learning and using that was -- slightly painful, but > > Just pick up any advanced HP

Re: Book review / advise

2010-06-23 Thread Stephen Hansen
On 6/22/10 9:45 PM, John Bokma wrote: > Stephen Hansen writes: > >> I *have* seen people burned by confusion over situations *extremely* >> similar to this; > > But is it? You didn't even ask yourself that question. Yes. I did. I don't really make a poin

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
ing errors. Don't summarize them. Third, I *think* the problem is-- though I may be wrong here, because again, just woke up-- that you're not passing the options as a tuple. Consider: ("hello") is not a tuple with one item. This is a slight 'wart' with Python syntax. P

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On 6/23/10 8:16 AM, Victor Subervi wrote: > On Wed, Jun 23, 2010 at 10:25 AM, Stephen Hansen > mailto:pyt...@ixokai.io>> wrote: > > On 6/23/10 6:45 AM, Victor Subervi wrote: > > Hi; > > I have this line: > > > > cursor.execute('

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:12 AM, Paul Rubin wrote: Stephen Hansen writes: On 6/23/10 6:45 AM, Victor Subervi wrote: cursor.execute('select clientEmail from clients where client=%s', ... Do, 'client.replace("_", " ")' instead. Er, look what happened to

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:28 AM, Victor Subervi wrote: Ok, let's start all over again. When I have this code: cursor.execute('select clientEmail from clients where client="%s"', (client.replace('_', ' '),)) clientEmail = cursor.fetchone()[0] Already addressed this. Do not quote inside the SQL.

Re: Does a '_sre.SRE_Pattern' have state,or is it thread-safe?

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:10 AM, John Nagle wrote: > '_sre.SRE_Pattern' is what "re.compile" returns. > > Is that a mutable object, with state that changes > during the parse, or is it an immutable constant? Can > two threads use the same '_sre.SRE_Pattern' at the same time? Ouch. I hope it is

Re: Another MySQL Problem

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 11:20 AM, Victor Subervi wrote: On Wed, Jun 23, 2010 at 12:51 PM, Stephen Hansen wrote: > The problem is not this line but: > > > File "/var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py", line > 38, in mailSpreadsheet > curs

Re: Should I Learn Python or Ruby next?

2010-06-23 Thread Stephen Hansen
> Would you like to present another way of achieving the same code that > makes Python look better, i would love to see it. Here is an even more > interesting example of "Ruby linear-flow" verses "Python lisp-style- > nesting"... > > RUBY: > ["three","one","two"].map{|x| x.capitalize}.sort.join(','

Re: Types missing from "types"module

2010-06-23 Thread Stephen Hansen
Sent from my iPad On Jun 23, 2010, at 9:24 PM, John Nagle wrote: > Here's dir(types), in Python 2.6.5: > > ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', > 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', > 'DictionaryType', 'EllipsisType', 'File

Re: Types missing from "types"module

2010-06-23 Thread Stephen Hansen
On Jun 23, 2010, at 9:24 PM, John Nagle wrote: > Here's dir(types), in Python 2.6.5: > > ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', > 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', > 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType',

Re: Another MySQL Problem

2010-06-24 Thread Stephen Hansen
On Thu, Jun 24, 2010 at 4:47 AM, Victor Subervi wrote: > On Thu, Jun 24, 2010 at 1:56 AM, John Nagle wrote: > Yes. Please post your CREATE statements, so we can see your >> database schema. If you really have one table per client, you're >> doing it wrong. >> > > cursor.execute('create tabl

Re: print line number and source filename

2010-06-24 Thread Stephen Hansen
On Wed, Jun 23, 2010 at 8:07 PM, Peng Yu wrote: > I tried to put the above code in a module. Say in a.b.__init__.py > > %(module)s only print to "__init__". However, I need the fullname > a.b.__init__. I looked at the manual, but I don't see what format > string I should supply. Would you please

Re: Book review / advise

2010-06-24 Thread Stephen Hansen
On Wed, Jun 23, 2010 at 10:22 AM, John Bokma wrote: > Stephen Hansen writes: > > > On 6/22/10 9:48 PM, John Bokma wrote: > > Its when you package it up in such a way that the buyer doesn't realize > > what they're buying, that's where the problem comes-- a

Re: deprecated string module issue

2010-06-24 Thread Stephen Hansen
On Thu, Jun 24, 2010 at 10:06 AM, GrayShark wrote: > In my code I have: > from string import lower, upper > > When I use pylint on the program I get just one warning: > > Uses of a deprecated module 'string'. > > Iv'e noted that many if not all string functions are now in _builtin_. > Where are t

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:15 AM, Jorgen Grahn > wrote: > Am I missing something? If not, I can go back to sleep -- and keep > avoiding SQL and web programming like the plague until that community > has entered the 21st century. > You're not missing anything. Its been the accepted industry pract

Re: deprecated string module issue

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 7:02 AM, GrayShark wrote: > Thanks for the suggestion. I gave it a quick try. Same 'warning'. No, > using the string module is the issue. Perhaps I'll just ignore it. > Perhaps? Why perhaps? The warning is simply factually wrong-- therefore, there's no reason in the world

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Thu, Jun 24, 2010 at 7:52 PM, Peng Yu wrote: > http://psyco.sourceforge.net/ > > The above package can improve python program on 32 bit library. But I > need to run on 64 bit library. Is there any other module that can help > improving the performance of python on 64 bit? > This is a total as

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 6:15 AM, WANG Cong wrote: > 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > this is and should be implemented by inherence. > Others have answered the rest fine, I just wanted to add: Who says we have to follow OOP principles, huh? If you want to follo

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 11:03 AM, WANG Cong wrote: > On 06/25/10 17:25, Steven D'Aprano > wrote: > > > Yes, isn't it wonderful? In other languages, metaprogramming is deepest > > black magic, or even completely impossible. In Python it is so easy that > > anyone can do it, and it is something beg

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:26 PM, rantingrick wrote: > On Jun 25, 12:46 pm, Alan G Isaac wrote: > > On 6/25/2010 1:24 PM, rantingrick wrote: > > > > > the "if __name__ == '__main__' tests" use > > > root.quit instead of root.destroy! > > > > Did you open an issue?http://bugs.python.org/ > > If *I

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence wrote: > On 25/06/2010 16:34, Stephen Hansen wrote: > > Python's slow, sure. But its in practice fast enough for an extremely >> broad >> range of activities. >> >> > What? > What, what? --S -- http://mail.python.org/mailman/listinfo/python-list

Re: deprecated string module issue

2010-06-25 Thread Stephen Hansen
Uhh... On Fri, Jun 25, 2010 at 2:31 PM, GrayShark wrote: > As to your comment about Logilab's pylint. I'v seen a ticket similar to > this from three months back. I assume they're not fixing it because if > you review 'string' via pydoc you'd read this: > > ---

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 3:18 PM, Mark Lawrence wrote: > On 25/06/2010 22:25, Stephen Hansen wrote: > >> On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence> >wrote: >> >> On 25/06/2010 16:34, Stephen Hansen wrote: >>> >>> Python's slow, s

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:00 PM, rantingrick wrote: > However i'm not about to waste my time > if i cannot get the code accepted into the stdlib because "some > people" here hate me. > Please get over yourself, dude. No one believes this martyrdom schtick you've taken on since you snuck away fro

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:49 PM, Lawrence D'Oliveiro wrote: > In message , Jorgen Grahn > wrote: > > > I thought it was well-known that the solution is *not* to try to > > sanitize the input -- it's to switch to an interface which doesn't > > involve generating an intermediate executable. In the

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
[Sent to python-list and CC'd] On Fri, Jun 25, 2010 at 10:31 PM, rantingrick wrote: > Clearly the user is upset and blabbing all sorts of incendiary > nonsense but again and again the good folks at SketchUp stay calm and > always attempt to help. This is how i would like to see this group get >

Re: I strongly dislike Python 3

2010-06-26 Thread Stephen Hansen
On Sat, Jun 26, 2010 at 8:59 AM, Stefan Reich < wertiges.prod...@googlemail.com> wrote: > My complaint is about changing the syntax of "print". > Okay. To reiterate, I am strongly in disfavor of Python 3 and will stick to Python > 2, for as least as long as Python 3 breaks my scripts. > This wi

Test - Ignore, clicketh not on I!

2010-06-26 Thread Stephen Hansen
Please ignore, sorry about wasted post. Having a posting issue, need to test. La de la la. Nothing to see here, move along. -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman

Re: Python dynamic attribute creation

2010-06-26 Thread Stephen Hansen
ou can get things done. But its just plodding along not really drinking whatever kool-aid you are, though its happy you like your flavor and is entirely content with letting you think its playing ball with you on that. -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Test - Ignore, clicketh not on I!

2010-06-26 Thread Stephen Hansen
On 6/26/10 11:11 AM, John Bokma wrote: Stephen Hansen writes: Please ignore, sorry about wasted post. Having a posting issue, need to test. If you mean with post Usenet, there are several groups dedicated to testing... I know. I don't access this forum via usenet, but via python

Re: I strongly dislike Python 3

2010-06-26 Thread Stephen Hansen
when outputting. As Thomas put it: On 6/26/10 9:33 AM, Thomas Jollans wrote: > Also, do you use print *that* much? Really? It was genuine surprise. Oh, I know people do use print, and I know there's bound to be someone who finds the conversion a bit complicated (though 2to3 does it well).

Re: I strongly dislike Python 3

2010-06-26 Thread Stephen Hansen
On 6/26/10 11:41 AM, John Bokma wrote: Stephen Hansen writes: No, "I'm" not trying to kill Python 2 at all. My current estimation is that I'll be using it for at least the next three years -- library conversion momentum is there, but its happening faster in the pure Pyt

Re: I strongly dislike Python 3

2010-06-26 Thread Stephen Hansen
ept to ask: Have you opened bug reports? If not, well... -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: deprecated string module issue

2010-06-26 Thread Stephen Hansen
hing. I don't use pylint -- so don't know -- but surely there has to be a way to specify deprecated functions and have it warn you, instead of whole modules? Since deprecating certain functions seems far more common then modules at large. Not that I've done any sort of study, so

Re: I strongly dislike Python 3

2010-06-26 Thread Stephen Hansen
would be very different today: I too have a number of slightly unique little pseudo-print functions scattered throughout my codebase. That, and various hacks replacing sys.stdout. The rigidness of the statements behavior (and therefore inability to bend it to my whim) is why I always just equa

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
of basically a bunch of interlocking Python scripts, sort of spontaneously evolved into a MCP, and advanced features started spreading around. It wouldn't at all have surprised me if the MCP put various scripts into laser bike races to see which were the best for its purposes. -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
quote me when you respond. If you're going to paraphrase me, do so accurately at least-- or do so after quoting what I actually said, if you wish to reinterpret my words. -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
aybe if no one ever downloads 2.5 -- but as it is, its 11 years since 1.5.2 was released and no one seems inclined to remove it. :) -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Python3

2010-06-27 Thread Stephen Hansen
27;t go back and fix 1.0, physics won't allow him. So we're stuck with the Py3k break. :) -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >