Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Nobody
On Fri, 25 Jun 2010 12:25:56 +1200, Lawrence D'Oliveiro wrote: > Just been reading this article > ... > which says that a lot of security holes are arising these days because > everybody is concentrating on unit testing of their own particular > components, with less attention being devoted to ove

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Cameron Simpson
On 25Jun2010 15:54, I wrote: | The number of times I've had to | fix/remove insert-values-into-SQL-text code ... My point here is that with insert-escaped-values-into-sql-text, you only need to forget to do it once (or do it wrong). By using a parameterised form like that required by SQLalchemy th

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Cameron Simpson
On 25Jun2010 15:38, Lawrence D'Oliveiro wrote: | In message <2010062422432660794-angrybald...@gmailcom>, Owen Jacobson wrote: | > Why would I write this when SQLAlchemy, even without using its ORM | > features, can do it for me? | | SQLAlchemy doesn’t seem very flexible. Looking at the code exam

[ANN] pyparsing 1.5.3 released

2010-06-24 Thread Paul McGuire
I'm happy to announce that a new release of pyparsing is now available, version 1.5.3. It has been almost a year and a half since 1.5.2 was released, but pyparsing has remained pretty stable. I believe I have cleaned up the botch-job I made in version 1.5.2 of trying to support both Python 2.x an

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Lawrence D'Oliveiro
In message <2010062422432660794-angrybald...@gmailcom>, Owen Jacobson wrote: > Why would I write this when SQLAlchemy, even without using its ORM > features, can do it for me? SQLAlchemy doesn’t seem very flexible. Looking at the code examples , they

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > 1) Somebody is running your application (or the database server) with > the locale set to something unexpected. Locales are under program control, so that won’t happen. This is why I use UTF-8 encoding for everything. -- http://mail.python.org/mailman/listinfo/py

improving python performance by extension module (64bit)

2010-06-24 Thread Peng Yu
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? -- Regards, Peng -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Owen Jacobson
On 2010-06-24 21:02:48 -0400, Roy Smith said: In article , Lawrence D'Oliveiro wrote: I construct ad-hoc queries all the time. It really isn’t that hard to do safely. All you have to do is read the documentation I get worried when people talk about how easy it is to do something safely.

Re: Heuristic

2010-06-24 Thread Marcos
On 25 jun, 03:36, geremy condra wrote: > On Thu, Jun 24, 2010 at 9:13 PM, Marcos wrote: > > I have a store, so I want to maximize the profit. I have all the > > suppliers with diferent prices, some providers can send products to a > > client an others not, this has a plus price. Some providers ha

Re: Heuristic

2010-06-24 Thread Marcos
On 25 jun, 03:28, Terry Reedy wrote: > On 6/24/2010 9:13 PM, Marcos wrote: > > > I have a store, so I want to maximize the profit. I have all the > > suppliers with diferent prices, some providers can send products to a > > client an others not, this has a plus price. Some providers has a > > disc

Re: Heuristic

2010-06-24 Thread geremy condra
On Thu, Jun 24, 2010 at 9:13 PM, Marcos wrote: > I have a store, so I want to maximize the profit. I have all the > suppliers with diferent prices, some providers can send products to a > client an others not, this has a plus price. Some providers has a > discount over the tansport if a quantity i

Re: deprecated string module issue

2010-06-24 Thread Benjamin Peterson
GrayShark gmail.com> writes: > Sorry, I meant "from string import lowercase, uppercase" Technically, you should use ascii_lowercase and ascii_uppercase, though I don't know if that's the cause of pylint's complaints. -- http://mail.python.org/mailman/listinfo/python-list

Re: Heuristic

2010-06-24 Thread Terry Reedy
On 6/24/2010 9:13 PM, Marcos wrote: I have a store, so I want to maximize the profit. I have all the suppliers with diferent prices, some providers can send products to a client an others not, this has a plus price. Some providers has a discount over the tansport if a quantity is reached. Someti

Heuristic

2010-06-24 Thread Marcos
I have a store, so I want to maximize the profit. I have all the suppliers with diferent prices, some providers can send products to a client an others not, this has a plus price. Some providers has a discount over the tansport if a quantity is reached. Sometimes its better to me receive the order

Re: Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > I construct ad-hoc queries all the time. It really isn’t that hard to do > safely. All you have to do is read the documentation I get worried when people talk about how easy it is to do something safely. Let me suggest a couple of things you might n

Why Is Escaping Data Considered So Magical?

2010-06-24 Thread Lawrence D'Oliveiro
Just been reading this article which says that a lot of security holes are arising these days because everybody is concentrating on unit testing of their own particular components, with less attention being devoted

Re: Types missing from "types"module

2010-06-24 Thread Terry Reedy
On 6/24/2010 2:29 AM, John Nagle wrote: Does the "types" module go away in 3.x, then? No, but all the duplication (IntType is int, etc) is removed. >>> dir(types) ['BuiltinFunctionType', 'BuiltinMethodType', 'CodeType', 'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType', 'L

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Xianwen Chen
On Thu, Jun 24, 2010 at 2:25 PM, Tim Chase wrote: > On 06/24/2010 04:47 AM, Xianwen Chen wrote: > >> Thanks a lot for your reply! I thought it would be simpler if the >> problem was presented in a brief way. Unfortunately, not for this >> case. >> >> Here is the detail. Free Yahoo! mail accounts c

Re: mod_python and css

2010-06-24 Thread John Nagle
If you send back a content type of "text/plain", your output will not be rendered as HTML by a browser; it will just be displayed as plain text. Try "text/html". John Nagle On 6/24/2010 12:19 PM, Thomas Jollans wrote: On 06/24/2010 09:10 PM, Bradley Hintze

Re: Should I Learn Python or Ruby next?

2010-06-24 Thread Rhodri James
On Wed, 23 Jun 2010 23:47:55 +0100, rantingrick wrote: On Jun 23, 4:43 pm, "Rhodri James" wrote: > And how exactly does your example express itself in a more > "syntactically-correct" "linear-flow" than the two code snippets i > provided earlier, hmmm? You did rather carefully pick an exa

Re: question about multiprocessing

2010-06-24 Thread News123
hywhy wrote: > thanks,friend! > I wanna use Queue to share objects,but on windows, the multiprocessing > module can‘t do this。 Is there any way to solve this problem! > thanks With multiprocessing.SyncManager you should be able to exchange Queues between different processes. -- http://mail.py

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-24 Thread Christian Heimes
> I am attempting to install the GDAL bindings (GDAL-1.7.1) on a > Windows XP Desktop with Python 2.6 and GDAL. During install, the > script finishes with "error: Unable to find vcvarsall.bat". > > What dependencies am I missing? Visual Studio 2008 Christian -- http://mail.python.org/mailman/

GDAL-1.7.1 : vcvarsall.bat missing

2010-06-24 Thread kBob
I am attempting to install the GDAL bindings (GDAL-1.7.1) on a Windows XP Desktop with Python 2.6 and GDAL. During install, the script finishes with "error: Unable to find vcvarsall.bat". What dependencies am I missing? C:\PyPI\GDAL-1.7.1>c:\python26\python setup.py install running install run

Re: mod_python and css

2010-06-24 Thread Bradley Hintze
I had some issues with WSGI install. It was duious at best as it failed and seemed very unstable. Is this a trusted application? On Thu, Jun 24, 2010 at 3:19 PM, Thomas Jollans wrote: > On 06/24/2010 09:10 PM, Bradley Hintze wrote: >> Hi all, > > about your question, no idea. > >> >> the mod_pyth

Re: deprecated string module issue

2010-06-24 Thread Terry Reedy
On 6/24/2010 1:50 PM, Ixokai wrote: On Thu, Jun 24, 2010 at 10:39 AM, GrayShark So if the constants are not deprecated, why is the module? Is some Again: the string module is not deprecated. It simply is not. GrayShark, pylint has a bug. Tell the author that its over-enthusiastic message

Please book now for EuroPython 2010: 17th to 24th July in Birmingham, UK

2010-06-24 Thread Zeth
EuroPython 2010 --- EuroPython is a conference for the Python programming language community, including software written in Python such as Django, Zope and so on. It is aimed at everyone from beginners through to core developers. This year EuroPython will be held from the 17th to 24th

Re: mod_python and css

2010-06-24 Thread Thomas Jollans
On 06/24/2010 09:10 PM, Bradley Hintze wrote: > Hi all, about your question, no idea. > > the mod_python mailing list is pretty dead so I thought I'd try asking > my question here. It comes as no surprise to me that the mod_python mailing list is dead: nobody uses mod_python anymore. For all I

mod_python and css

2010-06-24 Thread Bradley Hintze
Hi all, the mod_python mailing list is pretty dead so I thought I'd try asking my question here. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handl

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-24 Thread Colin J. Williams
On 22-Jun-10 08:03 AM, Jerry Rocteur wrote: On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: If you were able to ask us perhaps a more specific question and describe your problem a little more concisely perhaps I (and we) might have a bit more to offer you. I have a dictionary: users[key

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-24 Thread Thomas Jollans
On 06/24/2010 03:14 PM, Xah Lee wrote: > On Jun 24, 5:41 am, Xah Lee wrote: >> • Emacs Form Feed (^L) Display Suggestion and Tips >> http://xahlee.org/emacs/modernization_formfeed.html > > a follow up question. > > when i was learning python in ~2005, i remember seeing it in python > code, but i

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-24 Thread Tassilo Horn
Xah Lee writes: Hi Xah, > also, besides emacs elisp, does anyone see the form feed char in other > lang source code? It's quite often used in messages in newsgroups and mailing lists. The Gnus news- and mailreader creates nice "Next/Previous page" buttons from them and hides the next/previous

Re: print line number and source filename

2010-06-24 Thread Vinay Sajip
On Jun 24, 4:07 am, Peng Yu wrote: > %(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 let me know? > Did you look at this part of the documentation? http://docs.python.

Re: modifying standard library functionality (difflib)

2010-06-24 Thread Paul Rubin
Bruno Desthuilliers writes: > "patching source code" canonically means "physically" modifying the > original source file. Monkeypatching - which can only be done in some > dynamic languages - is what you're doing above, ie dynamically > replacing a given feature at runtime. I came across a less p

Re: deprecated string module issue

2010-06-24 Thread Thomas Jollans
On 06/24/2010 07:39 PM, GrayShark wrote: > On Jun 24, 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 function

Re: deprecated string module issue

2010-06-24 Thread Ixokai
On Thu, Jun 24, 2010 at 10:39 AM, GrayShark wrote: > Sorry, I meant "from string import lowercase, uppercase" > > As I was joining these two, I just changed the import to 'letters' > > So if the constants are not deprecated, why is the module? Is some > other > state then deprecated needed to des

Re: modifying standard library functionality (difflib)

2010-06-24 Thread Vlastimil Brom
2010/6/24 Bruno Desthuilliers : > Vlastimil Brom a écrit : > > "patching source code" canonically means "physically" modifying the original > source file. Monkeypatching - which can only be done in some dynamic > languages - is what you're doing above, ie dynamically replacing a given > featur

Re: deprecated string module issue

2010-06-24 Thread GrayShark
On Jun 24, 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 the constants?

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: use python as a calculator

2010-06-24 Thread Ian Kelly
On Thu, Jun 24, 2010 at 10:33 AM, ilovesss2004 wrote: > I use python 2.5 > Must change version? Is there any other solution? It works for me: Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more informatio

deprecated string module issue

2010-06-24 Thread GrayShark
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 the constants? Thanks Steven -- http://mail.python.org/mailman/list

Re: use python as a calculator

2010-06-24 Thread Peter Otten
ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 > > How can I make python return 1e-10? If you meant 1/10**10, by default this returns an integer in Python 2.x. With "from __future__ import division" you can opt for the division of integers to return a float: >>> 1/10**10 0

Re: use python as a calculator

2010-06-24 Thread Etienne Rousee
Le 24/06/2010 18:33, ilovesss2004 a écrit : > I use python 2.5 > Must change version? Is there any other solution? With python 2.6.5, I obtain 1e-10. -- Etienne -- http://mail.python.org/mailman/listinfo/python-list

Re: use python as a calculator

2010-06-24 Thread Tim Wintle
On Thu, 2010-06-24 at 09:33 -0700, ilovesss2004 wrote: > On Jun 24, 5:50 pm, Tim Harig wrote: > > On 2010-06-24, ilovesss2004 wrote: > > > > > If I run > > > 1.0/10**10 > > > python will return 0 > > > > Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59) > > [GCC 3.4.6] on linux2 > > Type "help", "

Re: use python as a calculator

2010-06-24 Thread ilovesss2004
On Jun 24, 5:50 pm, Tim Harig wrote: > On 2010-06-24, ilovesss2004 wrote: > > > If I run > > 1.0/10**10 > > python will return 0 > > Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59) > [GCC 3.4.6] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > > >>> 1.0/10**10

Re: Should I Learn Python or Ruby next?

2010-06-24 Thread Default User
On Thu, Jun 24, 2010 at 02:53, Gregory Ewing wrote: > Jean-Michel Pichavant wrote: > > (that makes me think that Perl should be renamed as it outrageously share >> the same 1st character with Python). >> > > +1. I suggest CalcifiedMolluscSecretion. The very awkwardness > of that name will doom th

Re: modifying standard library functionality (difflib)

2010-06-24 Thread Bruno Desthuilliers
Vlastimil Brom a écrit : Many thanks for your insights! Just now, I am the almost the only user of this script, hence the consequences of version mismatches etc. shouldn't (directly) affect anyone else, fortunately. So far so good. However, I'd like to ask for some clarification about monkey

Re: use python as a calculator

2010-06-24 Thread D'Arcy J.M. Cain
On Thu, 24 Jun 2010 08:42:32 -0700 (PDT) ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 > > How can I make python return 1e-10? What version of Python are you using? Python 2.6.4 (r264:75706, Jan 28 2010, 11:26:00) [GCC 4.2.1 20070719 [FreeBSD]] on freebsd7 Type "help", "c

Re: use python as a calculator

2010-06-24 Thread Tim Harig
On 2010-06-24, ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 Python 2.6.4 (r264:75706, Dec 11 2009, 23:02:59) [GCC 3.4.6] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 1.0/10**10 1e-10 >>> What version are you using? > How can I make

Re: use python as a calculator

2010-06-24 Thread Thomas Jollans
On 06/24/2010 05:42 PM, ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 > > How can I make python return 1e-10? It returns 1e-10. -- http://mail.python.org/mailman/listinfo/python-list

Re: use python as a calculator

2010-06-24 Thread David Houston
I believe this is fixed in python3 On Thu, Jun 24, 2010 at 4:42 PM, ilovesss2004 wrote: > If I run > 1.0/10**10 > python will return 0 > > How can I make python return 1e-10? > -- > http://mail.python.org/mailman/listinfo/python-list > -- Dave - Email: r...@crankyadmin.net Web: w

use python as a calculator

2010-06-24 Thread ilovesss2004
If I run 1.0/10**10 python will return 0 How can I make python return 1e-10? -- http://mail.python.org/mailman/listinfo/python-list

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-- and that's what is > > happening quite a

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: Types missing from "types"module

2010-06-24 Thread Thomas Jollans
On 06/24/2010 08:29 AM, John Nagle wrote: > On 6/23/2010 10:08 PM, Stephen Hansen wrote: >> 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', 'Co

Re: modifying standard library functionality (difflib)

2010-06-24 Thread Vlastimil Brom
2010/6/24 Bruno Desthuilliers : > Vlastimil Brom a écrit : >> >> Hi all, >> I'd like to ask about the most reasonable/recommended/... way to >> modify the functionality of the standard library module (if it is >> recommended at all). > > ... >> - I guess, it wouldn't be recommended to directly repl

Re: Another MySQL Problem

2010-06-24 Thread Victor Subervi
On Thu, Jun 24, 2010 at 9:34 AM, Stephen Hansen wrote: > 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 c

Re: Using Classes

2010-06-24 Thread Nathan Rice
As others have mentioned when you would like to encapsulate data and functions together, they're useful. Also, if you find yourself passing lists/tuples/dictionaries around frequently, you might benefit from converting them into classes. This tends to make the code clearer and more readable, you

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Tim Chase
On 06/24/2010 04:47 AM, Xianwen Chen wrote: Thanks a lot for your reply! I thought it would be simpler if the problem was presented in a brief way. Unfortunately, not for this case. Here is the detail. Free Yahoo! mail accounts can be accsessed via IMAP protocal, however, a non-standard shake ha

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > , but I got error messages. Any hint please? Why not just use a proxy server: http://sourceforge.net/projects/imapidproxy/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Michael Torrie
On 06/24/2010 03:47 AM, Xianwen Chen wrote: > . This is what I'm now working for. I tried: > > IMAP4.xatom('','ID ("GUID" "1")','',) > > and > > dest_srv.xatom('ID ("GUID" "1")') > > , but I got error messages. Any hint please? What error messages? -- http://mail.python.org/mailman/listinfo/p

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: question about multiprocessing

2010-06-24 Thread hywhy
thanks,friend! I wanna use Queue to share objects,but on windows, the multiprocessing module can‘t do this。 Is there any way to solve this problem! thanks -- View this message in context: http://old.nabble.com/question-about-multiprocessing-tp28940614p28982744.html Sent from the Python - python-

Re: Problem PIL-1.1.7 & _imagingft

2010-06-24 Thread Christian Heimes
Am 24.06.2010 14:39, schrieb Michel Claveau - MVP: > Hi! > > With PIL-1.1.7.win32-py2.6 and Windows 7, I have this traceback: > raise ImportError("The _imagingft C module is not installed") > ImportError: The _imagingft C module is not installed > > I tested "import _imaging" and several othe

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-24 Thread Xah Lee
On Jun 24, 5:41 am, Xah Lee wrote: > • Emacs Form Feed (^L) Display Suggestion and Tips > http://xahlee.org/emacs/modernization_formfeed.html a follow up question. when i was learning python in ~2005, i remember seeing it in python code, but i haven't done much python since. Does python source c

Re: Using Classes

2010-06-24 Thread Alf P. Steinbach /Usenet
* Mag Gam, on 24.06.2010 13:58: I have been using python for about 1 year now and I really like the language. Obviously there was a learning curve but I have a programing background which made it an easy transition. I picked up some good habits such as automatic code indenting :-), and making my

Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-24 Thread Xah Lee
• Emacs Form Feed (^L) Display Suggestion and Tips http://xahlee.org/emacs/modernization_formfeed.html plain text version follows -- Emacs Form Feed (^L) Display Suggestion and Tips Xah Lee, 2010-06-24 This page discusses some problems involving the Form feed c

Re: Pythonic Idiom For Searching An Include Path

2010-06-24 Thread Tim Daneliuk
On 6/24/2010 2:57 AM, Gregory Ewing wrote: > Tim Daneliuk wrote: >> "If 'includefile' contains one or more path separator characters, >>ignore 'FOOPATH'. > > Are you sure that's exactly what you want? Usually with > such things the distinction is absolute vs. relative, > not whether there is

Problem PIL-1.1.7 & _imagingft

2010-06-24 Thread Michel Claveau - MVP
Hi! With PIL-1.1.7.win32-py2.6 and Windows 7, I have this traceback: raise ImportError("The _imagingft C module is not installed") ImportError: The _imagingft C module is not installed I tested "import _imaging" and several other things, without success. If I re-install PIL-1.1.6 all run OK.

Re: Using Classes

2010-06-24 Thread Neil Cerutti
On 2010-06-24, Bruno Desthuilliers wrote: > Not going into OO when you don't need it IS actually the > "Python way" !-) My most satisfying classes are the ones that gradually coalesce from a functional program. They take actual shape during refactoring. I find classes to be the most successful w

Re: best way to increment an IntVar?

2010-06-24 Thread Bruno Desthuilliers
Dennis Lee Bieber a écrit : (snip - about Tkinter IntVar type) It is NOT a numeric "variable" in Python realms. So var+=increment can't be used because Python would rebind the name var to a new object -- but Tkinter would still be hooked to the original object and never see the

Re: Using Classes

2010-06-24 Thread Bruno Desthuilliers
Mag Gam a écrit : I have been using python for about 1 year now and I really like the language. Obviously there was a learning curve but I have a programing background which made it an easy transition. I picked up some good habits such as automatic code indenting :-), and making my programs more

dbus and properties multivalue

2010-06-24 Thread ste
hello, i want to build a simple script to resize a window of konqueror using the dbus protocol. Normally use the python interface, but the problem is most general because this operation it is impossible for me also if use qdbusviewer and is to complex for me if use dbus-send. If i use the python

Using Classes

2010-06-24 Thread Mag Gam
I have been using python for about 1 year now and I really like the language. Obviously there was a learning curve but I have a programing background which made it an easy transition. I picked up some good habits such as automatic code indenting :-), and making my programs more modular by having fu

Re: Another MySQL Problem

2010-06-24 Thread Victor Subervi
On Thu, Jun 24, 2010 at 1:56 AM, John Nagle wrote: > On 6/23/2010 10:59 PM, Dennis Lee Bieber wrote: > >> On Wed, 23 Jun 2010 11:58:24 -0430, Victor Subervi >> declaimed the following in >> gmane.comp.python.general: >> >> >> When I have this code: >>> >> > > >>And yes -- it IS an

Re: Simple list problem that's defeating me!

2010-06-24 Thread Bruno Desthuilliers
Neil Webster a écrit : Thanks for the help so far. The background to the problem is that the lists come from reading a dbf file. The code that I am trying to write is to merge lines of the dbf based on the first column. So in my example there would be three lines: a 2 3 4 b 10 11 12 a 2 3 4 T

Re: How to send a non-standard IMAP command?

2010-06-24 Thread Xianwen Chen
On 6/24/10, Tim Chase wrote: > On 06/23/2010 05:22 PM, Xianwen Chen wrote: >> I need to send one line of commands to an IMAP server. The commands >> are not standard IMAP protocols, hence it's not specified in >> http://docs.python.org/library/imaplib.html. > > Sounds like you want to use the imap

Re: Simple list problem that's defeating me!

2010-06-24 Thread Sion Arrowsmith
Mark Lawrence wrote: >On 22/06/2010 15:06, Neil Webster wrote: >> I have a list of lists such as [[a,2,3,4],[b,10,11,12], [a,2,3,4]]. I >> need to combine the two lists that have the same first character in >> this example 'a'. In reality there are 656 lists within the list. >> [ ... ] >My simp

Re: Simple list problem that's defeating me!

2010-06-24 Thread Neil Webster
Thanks for the help so far. The background to the problem is that the lists come from reading a dbf file. The code that I am trying to write is to merge lines of the dbf based on the first column. So in my example there would be three lines: a 2 3 4 b 10 11 12 a 2 3 4 The expected output from t

Re: ttk Scale: missing attributes

2010-06-24 Thread eb303
On Jun 23, 7:26 pm, Alan G Isaac wrote: > Tkinter's Scale widget had a `label` and a `resolution` attribute. > These appear to be missing from the Ttk Scale widget. > Is there a reason?  These were important attributes. > > Thanks, > Alan Isaac As you might know, the new ttk widgets are not inten

Re: example of multi threads

2010-06-24 Thread Sandy
On Jun 23, 11:58 am, Stefan Behnel wrote: > Mag Gam, 23.06.2010 12:24: > > > I am looking for a simple multi threaded  example. > > > Lets say I have to ssh to 20 servers and I would like to that in > > parallel. Can someone please provide a an example for that? > > Sounds like you want to run bac

Re: the bugerrd code

2010-06-24 Thread Bruno Desthuilliers
Victoria Hernandez a écrit : The new mision I herits the buggered code (i do not the bugger). How do debugger him? Tahnk you very much. Vikhy :) http://docs.python.org/library/pdb.html#module-pdb http://docs.python.org/library/unittest.html#module-unittest -- http://mail.python.org/mailman/list

Re: modifying standard library functionality (difflib)

2010-06-24 Thread Bruno Desthuilliers
Vlastimil Brom a écrit : Hi all, I'd like to ask about the most reasonable/recommended/... way to modify the functionality of the standard library module (if it is recommended at all). (snip) However, I'd like to ask, how to best maintain this modified functionality in the sourcecode. I tried

Re: Pythonic Idiom For Searching An Include Path

2010-06-24 Thread Gregory Ewing
Tim Daneliuk wrote: "If 'includefile' contains one or more path separator characters, ignore 'FOOPATH'. Are you sure that's exactly what you want? Usually with such things the distinction is absolute vs. relative, not whether there is more than one pathname component. E.g. in a C file, #i

Re: Should I Learn Python or Ruby next?

2010-06-24 Thread Gregory Ewing
Jean-Michel Pichavant wrote: (that makes me think that Perl should be renamed as it outrageously share the same 1st character with Python). +1. I suggest CalcifiedMolluscSecretion. The very awkwardness of that name will doom the language to the obscurity that it deserves relative to the One Tr

Re: Pythonic Idiom For Searching An Include Path

2010-06-24 Thread Nobody
On Wed, 23 Jun 2010 17:27:16 -0500, Tim Daneliuk wrote: > Given a program 'foo' that takes a command line argument '-I > includefile', I want to be able to look for 'includefile' in a path > specified in an environment variable, 'FOOPATH'. > > I'd like a semantic that says: > > "If 'includefil