[ANN] Struqtural: High level database interface library

2010-07-16 Thread Nathan Rice
Struqtural makes it easy to get data into a database, and easy to work with it once it's there. Some of the big features include: * Automatically generate all tables and relations needed to represent XML in a database, including one to one, one to many, many to one and many to many relationships

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread Terry Reedy
On 7/16/2010 9:42 PM, Peng Yu wrote: On Fri, Jul 16, 2010 at 5:42 PM, Terry Reedy wrote: On 7/16/2010 1:01 PM, Peng Yu wrote: I mean to get the man page for '[' like in the following code. x=[1,2,3] You might find my Python symbol glossary useful. https://code.google.com/p/xploro/downloads

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread python
Tim, > 2.x?! You were lucky. We lived for three months with Python 1.x in a septic > tank. We used to have to get up at six in the morning, write our 1.x code > using ed, eat a crust of stale bread, go to work down in machine language, > fourteen hours a day, week-in week-out, for sixpence a w

Where is a module usually installed?

2010-07-16 Thread Peng Yu
My Python is installed in the following location. ~/utility/linux/opt/Python-2.6.5/ I then installed SCons (http://www.scons.org/) using the command "python setup.py install", which install it at ~/utility/linux/opt/Python-2.6.5/lib/scons-2.0.0.final.0 sys.path doesn't have the above directory. I

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread Tim Chase
On 07/16/2010 09:08 PM, MRAB wrote: Peng Yu wrote: You might find my Python symbol glossary useful. https://code.google.com/p/xploro/downloads/detail?name=PySymbols.html This is for Python 3. Is there one for Python 2.x? Is anyone /still/ using Python 2.x? ;-) 2.x?! You were lucky. We liv

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread MRAB
Peng Yu wrote: On Fri, Jul 16, 2010 at 5:42 PM, Terry Reedy wrote: On 7/16/2010 1:01 PM, Peng Yu wrote: I mean to get the man page for '[' like in the following code. x=[1,2,3] You might find my Python symbol glossary useful. https://code.google.com/p/xploro/downloads/detail?name=PySymbols.h

Re: timing

2010-07-16 Thread Jia Hu
Thank you, it is so straightforward. On Fri, Jul 16, 2010 at 9:58 PM, Chris Rebert wrote: > On Fri, Jul 16, 2010 at 5:52 PM, Jia Hu wrote: > > Hello: > > > > If I want to calculate the runtime of a section of a program. How can I > do > > it? > > Taking you extremely literally: > from time impo

Re: timing

2010-07-16 Thread Chris Rebert
On Fri, Jul 16, 2010 at 5:52 PM, Jia Hu wrote: > Hello: > > If I want to calculate the runtime of a section of a program. How can I do > it? Taking you extremely literally: from time import time start = time() run_section_here() end = time() runtime = end-start Assuming you're doing this in orde

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread Peng Yu
On Fri, Jul 16, 2010 at 5:42 PM, Terry Reedy wrote: > On 7/16/2010 1:01 PM, Peng Yu wrote: >> >> I mean to get the man page for '[' like in the following code. >> >> x=[1,2,3] > > You might find my Python symbol glossary useful. > https://code.google.com/p/xploro/downloads/detail?name=PySymbols.ht

Re: Subsets of Python implemented in Python

2010-07-16 Thread Steven D'Aprano
On Sat, 17 Jul 2010 01:34:48 +0200, candide wrote: > I don't understand why some parts of the Python language (or the Python > standard library too) are implemented in C while some other parts are > implemented in the Python language itself. For instance, lists and > dictionnaries are implemented

Re: Splitting numeric litterals

2010-07-16 Thread Steven D'Aprano
On Fri, 16 Jul 2010 15:41:45 +0100, MRAB wrote: >> It always makes me laugh when I receive an invoice from some company, >> and the account number or invoice number is (e.g.) 100023456789. >> Who do they think they're fooling? >> > It's possible that they're splitting it into fields. Anythin

Re: Splitting numeric litterals

2010-07-16 Thread Steven D'Aprano
On Fri, 16 Jul 2010 18:30:38 +0100, bart.c wrote: >> It always makes me laugh when I receive an invoice from some company, >> and the account number or invoice number is (e.g.) 100023456789. >> Who do they think they're fooling? > > I used to do that. Giving someone an invoice number, or prod

timing

2010-07-16 Thread Jia Hu
Hello: If I want to calculate the runtime of a section of a program. How can I do it? Thank you, Jia -- http://mail.python.org/mailman/listinfo/python-list

Re: Subsets of Python implemented in Python

2010-07-16 Thread Richard Thomas
On Jul 17, 12:34 am, candide wrote: > I don't understand why some parts of the Python language (or the Python > standard library too) are implemented in C while some other parts are > implemented in the Python language itself. For instance, lists and > dictionnaries are implemented in C but sets a

Subsets of Python implemented in Python

2010-07-16 Thread candide
I don't understand why some parts of the Python language (or the Python standard library too) are implemented in C while some other parts are implemented in the Python language itself. For instance, lists and dictionnaries are implemented in C but sets are not. Wouldn't be better to implement

Re: Splitting numeric litterals

2010-07-16 Thread Terry Reedy
On 7/16/10 12:30 PM, bart.c wrote: they have to be exact. So if you wanted to hardcode 1000! for some reason, you'd need some 2568 digits which is a little awkward on one line. No, only 20 digits >>> math.factorial(1000) 402387260077093773543702433923003985719374 ... Most big ints people w

Re: About problems that I have with learning wxPython in Macintosh

2010-07-16 Thread David Bolen
"ata.jaf" writes: > import wx > > class MainWindow(wx.Frame) : > def __init__(self, parent, title) : >wx.Frame.__init__(self, parent, title=title, size=(200, 100)) >self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE) >self.CreateStatusBar() > >filemenu = wx.Menu() > >file

os.times values under Windows

2010-07-16 Thread python
Python 2.6 under Windows: are the two non-zero values returned by this function of any practical use? The documentation [1] is vague and points to the Windows Platform API which I'm not sure maps 1:1 to the help description. In looking at the values returned on my system (Windows 7, 64-bit), I won

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread Terry Reedy
On 7/16/2010 1:01 PM, Peng Yu wrote: I mean to get the man page for '[' like in the following code. x=[1,2,3] You might find my Python symbol glossary useful. https://code.google.com/p/xploro/downloads/detail?name=PySymbols.html -- http://mail.python.org/mailman/listinfo/python-list

Re: pattern matching with multiple lists

2010-07-16 Thread Tim Chase
On 07/16/2010 02:20 PM, Chad Kellerman wrote: Greetings, I have some code that I wrote and know there is a better way to write it. I wonder if anyone could point me in the right direction on making this 'cleaner'. I have two lists: liveHostList = [ app11, app12, web11, web12, hos

Re: Nested loop not working

2010-07-16 Thread Alf P. Steinbach /Usenet
* Johann Spies, on 16.07.2010 16:34: I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops throu

Re: How to list all the python help topics that are capitalized?

2010-07-16 Thread MRAB
Peng Yu wrote: On Fri, Jul 16, 2010 at 3:10 PM, MRAB wrote: Peng Yu wrote: Hi, I see that there are help topics that are capitalized, which I think in general are related with languages syntax. I want to see the complete list of such help topics. Would you please let me know if there is a com

Re: pattern matching with multiple lists

2010-07-16 Thread MRAB
Chad Kellerman wrote: Greetings, I have some code that I wrote and know there is a better way to write it. I wonder if anyone could point me in the right direction on making this 'cleaner'. I have two lists: liveHostList = [ app11, app12, web11, web12, host11 ]

Re: How to list all the python help topics that are capitalized?

2010-07-16 Thread Thomas Jollans
On 07/16/2010 10:21 PM, Peng Yu wrote: > On Fri, Jul 16, 2010 at 3:10 PM, MRAB wrote: >> Peng Yu wrote: >>> >>> Hi, >>> >>> I see that there are help topics that are capitalized, which I think >>> in general are related with languages syntax. I want to see the >>> complete list of such help topics

Re: Identify the Color of an Image

2010-07-16 Thread Rami Chowdhury
On Wednesday 14 July 2010 23:56:27 Monyl wrote: > > I will be using a automation tool called Sikuli and select the text or > an Image. It sounds to me like this is a question not about Python, but about Sikuli. I suggest you ask the question at https://answers.launchpad.net/sikuli or on their

Re: How to list all the python help topics that are capitalized?

2010-07-16 Thread Peng Yu
On Fri, Jul 16, 2010 at 3:10 PM, MRAB wrote: > Peng Yu wrote: >> >> Hi, >> >> I see that there are help topics that are capitalized, which I think >> in general are related with languages syntax. I want to see the >> complete list of such help topics. Would you please let me know if >> there is a

Re: How to list all the python help topics that are capitalized?

2010-07-16 Thread MRAB
Peng Yu wrote: Hi, I see that there are help topics that are capitalized, which I think in general are related with languages syntax. I want to see the complete list of such help topics. Would you please let me know if there is a command to do so? help('SUBSCRIPTS') Related help topics: SEQU

Re: Identify the Color of an Image

2010-07-16 Thread Thomas Jollans
On 07/15/2010 09:13 AM, Monyl wrote: >> Please be clearer about what you want. >> >> 1. Animagedoes not "have" acolor, although each pixel in animage >> does have acolor. >> >> 2. Text in a web page does not (necessarily) have a font, although the >> display engine will use a font of its choice t

pattern matching with multiple lists

2010-07-16 Thread Chad Kellerman
Greetings, I have some code that I wrote and know there is a better way to write it.  I wonder if anyone could point me in the right direction on making this 'cleaner'. I have two lists:   liveHostList = [ app11, app12, web11, web12, host11 ]     stageHos

How to list all the python help topics that are capitalized?

2010-07-16 Thread Peng Yu
Hi, I see that there are help topics that are capitalized, which I think in general are related with languages syntax. I want to see the complete list of such help topics. Would you please let me know if there is a command to do so? >>> help('SUBSCRIPTS') Related help topics: SEQUENCEMETHODS1 >

( . ) ( . ) ( . ) ( . ) ( . ) Nude desi videos and pictures ( . ) ( . ) ( . ) ( . ) ( . ) ( . )

2010-07-16 Thread ssssssssssssss
Click here for nude desi videos >>> http://ukpinkgirls.co.cc/ http://uk-worldwebhosting.co.cc/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting numeric litterals

2010-07-16 Thread Robert Kern
On 7/16/10 12:30 PM, bart.c wrote: "Steven D'Aprano" wrote in message news:4c4069de$0$11101$c3e8...@news.astraweb.com... On Fri, 16 Jul 2010 14:49:21 +0100, MRAB wrote: Not only that, but it only takes 73 digits to write out the total number of particles in the entire universe: 100

Re: rstrip()

2010-07-16 Thread Novocastrian_Nomad
On Jul 16, 10:58 am, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>> "x.vsd-dir".rstrip("-dir") > > 'x.vs' > > I expected 'x.vsd' as a return value. One way to

Re: Why doesn't python's list append() method return the list itself?

2010-07-16 Thread John Nagle
On 7/13/2010 4:22 AM, Gregory Ewing wrote: John Nagle wrote: Arguably, if a function just does a "return", it should be an error to try to use its return value. It's been suggested at least once before that the default return value for a function should be some special value that raises an exc

Re: Is '[' a function or an operator or an language feature?

2010-07-16 Thread Robert Kern
On 7/16/10 12:01 PM, Peng Yu wrote: I then checked help('LISTLITERALS'), which gives some description that is available from the language reference. So '[' in "x=[1,2,3]" is considered as a language feature rather than a function or an operator? Yes. It is part of the list literal syntax of th

Re: Splitting numeric litterals

2010-07-16 Thread bart.c
"Steven D'Aprano" wrote in message news:4c4069de$0$11101$c3e8...@news.astraweb.com... On Fri, 16 Jul 2010 14:49:21 +0100, MRAB wrote: Not only that, but it only takes 73 digits to write out the total number of particles in the entire universe: 10

Re: rstrip()

2010-07-16 Thread MRAB
Jason Friedman wrote: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") 'x.vs' I expected 'x.vsd' as a return value. .strip, .lstrip and .rstrip treat their argumen

Re: Code generator and visitor pattern

2010-07-16 Thread Thomas Jollans
On 07/16/2010 11:00 AM, Jean-Michel Pichavant wrote: > Karsten Wutzke wrote: >>> Yes, typo, I meant strictly. >>> >>> >> >> Damn, I mean strongly. At least not for identifying which methods to >> call depending on the type/s. >> >> Karsten >> > Stringly is the perfect combination of strictl

Re: rstrip()

2010-07-16 Thread Ken Watford
On Fri, Jul 16, 2010 at 12:58 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value.

py2app with weave fails

2010-07-16 Thread Soren
Hi, I'm trying to create a standalone app using py2app, but it seems no matter what I do I get this error: Traceback (most recent call last): File "/Users/soren/Documents/workspace/bioxtasraw/dist/RAW.app/ Contents/Resources/__boot__.py", line 158, in _run('RAW.py') File "/Users/soren/Do

Re: rstrip()

2010-07-16 Thread Thomas Jollans
On 07/16/2010 06:58 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value. >>> "x-vs

Re: rstrip()

2010-07-16 Thread Shashwat Anand
On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value.

Re: Python Imaging Library available for Python 3.1 ? Fractals

2010-07-16 Thread John Hammink
On Jun 6, 12:40 am, pdlemper@earthlink.net wrote: > On the site >    http://code.activestate.com/recipes/langs/python/ > there are several scripts for fractals.  See page five. > These begin >                         from PIL import Image > > This fails in my python 3.1.2 > > Google reveals PIL is

Is '[' a function or an operator or an language feature?

2010-07-16 Thread Peng Yu
I mean to get the man page for '[' like in the following code. x=[1,2,3] But help('[') doesn't seem to give the above usage. ### Mutable Sequence Types ** List objects support additional operations that allow in-place modification of the object. Other mutable sequen

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Andreas Waldenburger
On Fri, 16 Jul 2010 17:26:05 +0200 Daniel Fetchinson wrote: > >>> I'm pleased to announce the release of inflect.py v0.1.8, a > >>> module that correctly generates: > >>> > >>> * the plural of singular nouns and verbs > >>> * the singular of plural nouns > >>> * ordinals > >>> * indefinite articl

rstrip()

2010-07-16 Thread Jason Friedman
$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> "x.vsd-dir".rstrip("-dir") 'x.vs' I expected 'x.vsd' as a return value. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 and setuptools

2010-07-16 Thread Thomas Jollans
On 07/16/2010 06:10 PM, fuglyducky wrote: > I am trying to install a library that requires setuptools. > Unfortunately, setuptools isn't available for Python 3 yet. Is this > correct? Any idea when it may be available OR if there is a different > tool/method of getting setuptools installed for Pyth

Re: Possible to include \n chars in doctest code samples or output?

2010-07-16 Thread Thomas Jollans
On 07/16/2010 07:26 AM, pyt...@bdurham.com wrote: > Thomas, > >> Recall that doctest doesn't parse the code, it extracts the docstrings. And >> docstrings are just strings, and are parsed like strings. > > I understand what you're saying, but I'm struggling with how to > represent the following

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Antoine Pitrou
On Fri, 16 Jul 2010 17:29:44 +0200 Daniel Fetchinson wrote: > I'm pleased to announce the release of inflect.py v0.1.8, a module that > correctly generates: > > * the plural of singular nouns and verbs > * the singular of plural nouns > * ordinals > * indefinite

Re: create dynamic instance

2010-07-16 Thread Andre Alexander Bell
On 07/16/2010 06:01 PM, Ray wrote: > if __name__=='__main__': > for x in range(10): > x=Test() > """ > the question is how do i call x.value outside of that for loop? > something like > print x.value ? > """ You would have to keep references to your Test objects (untested code):

Re: create dynamic instance

2010-07-16 Thread Ray
On Jul 16, 12:17 pm, MRAB wrote: > Ray wrote: > > class Test: > >   def __init__(self): > >     self.value=0 > >   def change(self, val): > >     self.value=val > > > if __name__=='__main__': > >   for x in range(10): > >     x=Test() > >   """ > >   the question is how do i call x.value outside o

Re: improvement for copy.deepcopy : no memo for immutable types

2010-07-16 Thread Mark Lawrence
On 16/07/2010 14:59, Steven D'Aprano wrote: [snip] However doing the minimum isn't likely to be very useful. Python is maintained by volunteers, and there are more bugs than person-hours available to fix them. Consequently, unless a bug is serious, high- profile, or affects a developer personal

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Stefan Behnel
Daniel Fetchinson, 16.07.2010 17:29: I'm pleased to announce the release of inflect.py v0.1.8, a module that correctly generates: * the plural of singular nouns and verbs * the singular of plural nouns * ordinals * indefinite articles * present participles * and converts numbers to words Which

Re: create dynamic instance

2010-07-16 Thread MRAB
Ray wrote: class Test: def __init__(self): self.value=0 def change(self, val): self.value=val if __name__=='__main__': for x in range(10): x=Test() """ the question is how do i call x.value outside of that for loop? something like print x.value ? """ thanks for any h

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread MRAB
Paul wrote: >> Thomas Jollans, 15.07.2010 18:41: > >>> On 07/15/2010 01:00 PM, Paul wrote: I'm pleased to announce the release of inflect.py v0.1.8, a module that correctly generates: > * the plural of singular nouns and verbs * the singular of plural nouns * ordinals

Re: MySQL One More Again

2010-07-16 Thread John Nagle
On 7/16/2010 7:39 AM, MRAB wrote: Victor Subervi wrote: Hi; I have the following code: cursor.execute('select MyTable from optionsDetails where Store=%s', (store,)) options_tables = [item[0] for item in cursor] for table in options_tables: cursor.execute('select * from %' % table) As has b

Python 3 and setuptools

2010-07-16 Thread fuglyducky
I am trying to install a library that requires setuptools. Unfortunately, setuptools isn't available for Python 3 yet. Is this correct? Any idea when it may be available OR if there is a different tool/method of getting setuptools installed for Python 3? Thanks!!! -- http://mail.python.org/mailma

create dynamic instance

2010-07-16 Thread Ray
class Test: def __init__(self): self.value=0 def change(self, val): self.value=val if __name__=='__main__': for x in range(10): x=Test() """ the question is how do i call x.value outside of that for loop? something like print x.value ? """ thanks for any help. -- http

Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread David Robinow
On Fri, Jul 16, 2010 at 9:29 AM, ernest wrote: > On 15 Jul, 18:45, kj wrote: >> This is a question _for Emacs users_ (the rest of you, go away :)  ). >> >> How do you do Python code-folding in Emacs? >> >> Thanks! >> >> ~K > > I tried the outline-mode and it seemed to work. It can > collapse diff

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Daniel Fetchinson
I'm pleased to announce the release of inflect.py v0.1.8, a module that correctly generates: * the plural of singular nouns and verbs * the singular of plural nouns * ordinals * indefinite articles * present participles * and converts numbers to words >>

Re: Nested loop not working

2010-07-16 Thread Dave Angel
Johann Spies wrote: I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops through the second fil

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Daniel Fetchinson
>>> I'm pleased to announce the release of inflect.py v0.1.8, a module that >>> correctly generates: >>> >>> * the plural of singular nouns and verbs >>> * the singular of plural nouns >>> * ordinals >>> * indefinite articles >>> * present participles >>> * and converts numbers to words >> >> Which

Re: M2Crypto-0.20.2, SWIG-2.0.0, and OpenSSL-1.0.0a build problem

2010-07-16 Thread Adam Mercer
On Fri, Jul 16, 2010 at 02:09, Heikki Toivonen wrote: > That version of M2Crypto does not work with OpenSSL 1.0.x because OpenSSL > changed APIs. M2Crypto trunk works, as will the next M2Crypto release. So at > this time, you should check out M2Crypto from the Subversion repository. See > http://

Re: [ANN] inflect.py: generate plurals, ordinals, numbers to words...

2010-07-16 Thread Paul
> Thomas Jollans, 15.07.2010 18:41: > > On 07/15/2010 01:00 PM, Paul wrote: > >> I'm pleased to announce the release of inflect.py v0.1.8, a module that > >> correctly generates: > >> * the plural of singular nouns and verbs > >> * the singular of plural nouns > >> * ordinals > >> * indefinite ar

Re: ctypes' c_longdouble: underflow error (bug?)

2010-07-16 Thread Mark Dickinson
On Jul 16, 2:53 pm, kj wrote: > This is extremely confusing.  From my naive reading of the > documentation, I would have expected that the following two blocks > would produce identical results (expl is one of the standard C math > library exponential functions, with signature "long double expl(lo

Re: Nested loop not working

2010-07-16 Thread MRAB
Johann Spies wrote: I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops through the second fil

Re: Nested loop not working

2010-07-16 Thread Ian Kelly
On Fri, Jul 16, 2010 at 8:34 AM, Johann Spies wrote: > I am overlooking something stupid. > > I have two files: one with keywords and another with data (one record per > line). > > I want to determine for each keyword which lines in the second file > contains that keyword. > > The following code

Re: MySQL One More Again

2010-07-16 Thread Victor Subervi
On Fri, Jul 16, 2010 at 10:09 AM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >>cursor.execute('select MyTable from optionsDetails where Store=%s', >> (store,)) >>options_tables = [item[0] for item in cursor] >>for table in options_tables: >> cur

Re: Splitting numeric litterals

2010-07-16 Thread MRAB
Steven D'Aprano wrote: On Fri, 16 Jul 2010 14:49:21 +0100, MRAB wrote: Lawrence D'Oliveiro wrote: In message , MRAB wrote: Normally it's only string literals that could be so long that you might want to split them over several lines. It is somewhat unusual to have a _numeric_ literal that's

Re: MySQL One More Again

2010-07-16 Thread MRAB
Victor Subervi wrote: Hi; I have the following code: cursor.execute('select MyTable from optionsDetails where Store=%s', (store,)) options_tables = [item[0] for item in cursor] for table in options_tables: cursor.execute('select * from %' % table) Should be: 'select *

Nested loop not working

2010-07-16 Thread Johann Spies
I am overlooking something stupid. I have two files: one with keywords and another with data (one record per line). I want to determine for each keyword which lines in the second file contains that keyword. The following code is not working. It loops through the second file but only uses the fi

Re: File transfer on network

2010-07-16 Thread MRAB
mukesh tiwari wrote: On Jul 16, 4:08 am, MRAB wrote: mukesh tiwari wrote: Hello all Currently i am trying to develop a client and server in python. Client takes screenshot in every 20 seconds and send it to server. Server store the received file in folder. Here is code for Client import sys im

Re: Splitting numeric litterals

2010-07-16 Thread Steven D'Aprano
On Fri, 16 Jul 2010 14:49:21 +0100, MRAB wrote: > Lawrence D'Oliveiro wrote: >> In message , MRAB >> wrote: >> >>> Normally it's only string literals that could be so long that you >>> might want to split them over several lines. It is somewhat unusual to >>> have a _numeric_ literal that's very

Re: any issues with long running python apps?

2010-07-16 Thread Les Schaffer
Stefan Behnel wrote: Les Schaffer, 16.07.2010 15:07: agree with all the other suggestions: multiple threads for data and GUI, The way I read it, the suggestion was to use separate processes, not multiple threads. That's a pretty important difference. check. processes, not threads. Les --

Re: improvement for copy.deepcopy : no memo for immutable types

2010-07-16 Thread Steven D'Aprano
On Fri, 16 Jul 2010 05:45:50 -0700, Inquisitive Scientist wrote: > I am having problems with running copy.deepcopy on very large data > structures containing lots of numeric data: [...] > This seems perfectly safe, should speed things up, keep the memo dict > smaller, and be easy to add. Can someo

Re: ctypes' c_longdouble: underflow error (bug?)

2010-07-16 Thread kj
In Thomas Jollans writes: >On 07/15/2010 06:41 PM, kj wrote: >> In Thomas Jollans >> writes: >> >>> http://docs.python.org/library/ctypes.html#fundamental-data-types >> >>> c_longdouble maps to float >> >> Thanks for pointing this out! >> ~K >> (Does it make *any difference at all* to use

Re: Splitting numeric litterals

2010-07-16 Thread MRAB
Lawrence D'Oliveiro wrote: In message , MRAB wrote: Normally it's only string literals that could be so long that you might want to split them over several lines. It is somewhat unusual to have a _numeric_ literal that's very very long! Seems a peculiar assumption to make in a language that a

Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread Andreas Waldenburger
On Fri, 16 Jul 2010 06:29:46 -0700 (PDT) ernest wrote: > On 15 Jul, 18:45, kj wrote: > > This is a question _for Emacs users_ (the rest of you, go away :) > >  ). > > > > How do you do Python code-folding in Emacs? > > > > Thanks! > > > > ~K > > I tried the outline-mode and it seemed to work. I

Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread ernest
On 15 Jul, 18:45, kj wrote: > This is a question _for Emacs users_ (the rest of you, go away :)  ). > > How do you do Python code-folding in Emacs? > > Thanks! > > ~K I tried the outline-mode and it seemed to work. It can collapse different blocks of code, such as functions, classes, etc. Howeve

Re: any issues with long running python apps?

2010-07-16 Thread Stefan Behnel
Les Schaffer, 16.07.2010 15:07: agree with all the other suggestions: multiple threads for data and GUI, The way I read it, the suggestion was to use separate processes, not multiple threads. That's a pretty important difference. Stefan -- http://mail.python.org/mailman/listinfo/python-list

MySQL One More Again

2010-07-16 Thread Victor Subervi
Hi; I have the following code: cursor.execute('select MyTable from optionsDetails where Store=%s', (store,)) options_tables = [item[0] for item in cursor] for table in options_tables: cursor.execute('select * from %' % table) You can already see what my question is. One of y'all

Re: any issues with long running python apps?

2010-07-16 Thread Les Schaffer
thanks to all for the replies. the Windows memory fragmentation was one of the "i didn't know that" items. we will use 64-bit Windows OS if the job happens. agree with all the other suggestions: multiple threads for data and GUI, etc. Also, might push for Linux even though the company is Wind

Re: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-16 Thread Nick Keighley
On 16 July, 09:24, Mark Tarver wrote: > On 15 July, 23:21, bolega wrote: > > >http://www.gnu.org/philosophy/stallman-kth.html > > > RMS lecture at KTH (Sweden), 30 October 1986 did you really have to post all of this... > > read more »... ...oh sorry only about a third of it... > Perhaps as

Re: improvement for copy.deepcopy : no memo for immutable types

2010-07-16 Thread Stefan Behnel
Inquisitive Scientist, 16.07.2010 14:45: I am having problems with running copy.deepcopy on very large data structures containing lots of numeric data: 1. copy.deepcopy can be very slow 2. copy.deepcopy can cause memory errors even when I have plenty of memory I think the problem is that

improvement for copy.deepcopy : no memo for immutable types

2010-07-16 Thread Inquisitive Scientist
I am having problems with running copy.deepcopy on very large data structures containing lots of numeric data: 1. copy.deepcopy can be very slow 2. copy.deepcopy can cause memory errors even when I have plenty of memory I think the problem is that the current implementation keeps a memo for e

Re: Cannot send email

2010-07-16 Thread thebjorn
On Jul 15, 7:07 pm, "D'Arcy J.M. Cain" wrote: > On Thu, 15 Jul 2010 09:50:57 -0700 (PDT) > > G F wrote: > > Does anyone have any ideas where the trouble is and what can be done > > about it? The little bit about: > > "reply: retcode (557); Msg: This mail server does not accept mail > > addressed

Re: Q for Emacs users: code-folding (hideshow)

2010-07-16 Thread thebjorn
On Jul 15, 10:34 pm, Peter wrote: > On Jul 16, 2:45 am, kj wrote: > > > This is a question _for Emacs users_ (the rest of you, go away :)  ). > > > How do you do Python code-folding in Emacs? > > > Thanks! > > > ~K > [...] > Anybody else now of any better ideas or whatever? Now that I think > abo

Re: adodb.NewADOConnection('postgres') returns None

2010-07-16 Thread micayael
On 14 jul, 14:51, Mladen Gogala wrote: > On Wed, 14 Jul 2010 05:14:08 -0700, micayael wrote: > > Thanks Thomas. > > :-( then adodb today dosn't work with postgres (at least on ubuntu) > > right? > > No, ADOdb doesn't work with the newer versions of Postgres. ADOdb doesn't > work with Psycopg2 and

Re: Possible to include \n chars in doctest code samples or output?

2010-07-16 Thread Albert Hopkins
On Fri, 2010-07-16 at 01:26 -0400, pyt...@bdurham.com wrote: > I understand what you're saying, but I'm struggling with how to > represent the following strings in doctest code and doctest results. > No > matter what combination of backslashes or raw strings I use, I am > unable > to find a way to

Re: Best Pythonic Approach to Annotation/Metadata?

2010-07-16 Thread Christian Heimes
> def to_JSON(self): > returnDict = {} > for member in filter(someMethod, inspect.getmembers(self)): > returnDict[member[0]] = member[1] > return json.dumps(returnDict) By the way you don't need filter here. The getmembers() function has a filter functions. It's cal

Re: Best Pythonic Approach to Annotation/Metadata?

2010-07-16 Thread Chris Rebert
On Thu, Jul 15, 2010 at 12:37 PM, Sparky wrote: > Hello Python community! > > I am building a JSON-RPC web application that uses quite a few models. > I would like to return JSON encoded object information and I need a > system to indicate which properties should be returned when the object > is t

Re: Code generator and visitor pattern

2010-07-16 Thread Jean-Michel Pichavant
Karsten Wutzke wrote: Yes, typo, I meant strictly. Damn, I mean strongly. At least not for identifying which methods to call depending on the type/s. Karsten Stringly is the perfect combination of strictly and strongly. Nice one :) JM -- http://mail.python.org/mailman/listinfo/pytho

Re: Code generator and visitor pattern

2010-07-16 Thread Stefan Behnel
Carl Banks, 16.07.2010 07:50: On Jul 15, 8:33 pm, Stefan Behnel wrote: The code I referenced is from the Cython compiler, and we use it to "do stuff" with the AST. The visitor pattern is actually a pretty common way to bind code in a single place that does a certain thing to different parts of a

Re: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-16 Thread Mark Tarver
On 15 July, 23:21, bolega wrote: > http://www.gnu.org/philosophy/stallman-kth.html > > RMS lecture at KTH (Sweden), 30 October 1986 > > (Kungliga Tekniska Högskolan (Royal Institute of Technology)) > Stockholm, Sweden > > Arranged by the student society > “Datorföreningen Stacken” > 30 October 198

Re: death of newsgroups (Microsoft closing their newsgroups)

2010-07-16 Thread Uday S Reddy
On 7/13/2010 7:43 PM, Xah Lee wrote: I use comp.lang.lisp, comp.emacs since about 1999. Have been using them pretty much on a weekly basis in the past 10 years. Starting about 2007, the traffic has been increasingly filled with spam, and the posters are always just the 20 or 30 known faces. I t

Re: *** StudyCourse :: The Conversion of KHAZARS to Jews and thence TRANSFORMATION to ZIONIST ATHEISTS ***

2010-07-16 Thread small Pox
The Kitab al Khazari, an Arabic phrase meaning Book of the Khazars, is one of most famous works of the medieval Spanish Jewish philosopher and poet Rabbi Yehuda Halevi, completed around 1140.[1] Divided into five essays ("ma'amarim," Articles), it takes the form of a dialogue between the pagan

Re: *** StudyCourse :: The Conversion of KHAZARS to Jews and thence TRANSFORMATION to ZIONIST ATHEISTS ***

2010-07-16 Thread small Pox
The Kitab al Khazari, an Arabic phrase meaning Book of the Khazars, is one of most famous works of the medieval Spanish Jewish philosopher and poet Rabbi Yehuda Halevi, completed around 1140.[1] Divided into five essays ("ma'amarim," Articles), it takes the form of a dialogue between the pagan

*** StudyCourse :: The Conversion of KHAZARS to Jews and thence TRANSFORMATION to ZIONIST ATHEISTS ***

2010-07-16 Thread small Pox
Self-Study Course : The Conversion of KHAZARS to Jews and thence TRANSFORMATION to ZIONIST ATHEISTS First, we will present the TRANSFORMATION, using HIGHLY AUTHENTIC source . Lying and Deception is the second nature of zionists , so we cant contaminate ourselves with an iota of it. We present evi

Re: Code generator and visitor pattern

2010-07-16 Thread Michele Simionato
On Jul 15, 7:58 pm, Karsten Wutzke wrote: > Hello, > > this is obviously a Python OO question: > > Since Python isn't stringly typed, single-dispatch isn't available per > se. So is the "double-dispatch" Visitor pattern, which is usually used > in OO systems to implement code generators. So, what

Re: File transfer on network

2010-07-16 Thread mukesh tiwari
On Jul 16, 4:08 am, MRAB wrote: > mukesh tiwari wrote: > > Hello all > > Currently i am trying to develop a client and server in python. Client > > takes screenshot in every 20 seconds and send it to server. Server > > store the received file in folder. Here is code for Client > > > import sys > >

  1   2   >