Re: Problems with ZODB, I can not persist and object accessed from 2 threads

2014-05-06 Thread dieter
Dennis Lee Bieber writes: > On Tue, 06 May 2014 13:03:08 +0200, dieter declaimed > the following: > >> >>The database (we have called it "db") is global to all threads. >>Each thread must open (and maybe close) its own connection to the >>global database. You must never share the same connection

Re: xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ...

2014-05-06 Thread dieter
thomas.lehmann.priv...@googlemail.com writes: > ... > taking the xml-rpc derived from standard example is working - basically - but > with following scenario I do not understand the problem. Maybe you can help: > > - one Unittest that does create the xmlrpc server in a thread >in "setUp" and

Re: The “does Python have variables?” debate

2014-05-06 Thread Marko Rauhamaa
Ned Batchelder : > Why is "variable" sacrosanct and can only be used to describe C > semantics, but we're OK reusing class, int, and function? The Python language specification calls them variables; the terminology discussion should end there. The complaint against variables seems to hinge on th

Re: Pass variable by reference

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 19:54:28 -0700, Rustom Mody wrote: > The number of possible concepts is infinite > > The number of words is finite (even assuming unicode!!) Not true. If you allow longer and longer words, with no upper limit, the number of words is also infinite. If you allow compound word

Re: Pass variable by reference

2014-05-06 Thread Rustom Mody
On Wednesday, May 7, 2014 8:09:34 AM UTC+5:30, Chris Angelico wrote: > On Wed, May 7, 2014 at 12:18 PM, Rustom Mody wrote: > > Wrong conclusion! > > These 3 lines look the same and amount to much the same in python and C. > > But as the example widens to something beyond 3 lines, the difference > >

Re: Pass variable by reference

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 12:18 PM, Rustom Mody wrote: > Wrong conclusion! > > These 3 lines look the same and amount to much the same in python and C. > > But as the example widens to something beyond 3 lines, the difference > will become more and more significant Python, C, REXX, BASIC, and pretty

Python under the sea and in space

2014-05-06 Thread Jessica McKellar
Hi folks, I'm trying to determine the greatest depth (in the ocean or underground) and highest altitude at which Python code has been executed. Please note that I'm interested in where the code was executed, and not, say, where data that Python analyzed was acquired. I know for example that NASA

Re: Pass variable by reference

2014-05-06 Thread Rustom Mody
On Wednesday, May 7, 2014 5:16:16 AM UTC+5:30, Chris Angelico wrote: > On Wed, May 7, 2014 at 7:00 AM, Mark H Harris wrote: > Is this code mutating or rebinding? > x = 1.1 > y = 2.2 > x = x + y Heh! Neat example! > What language did I write that in? Is there really a fundamental > difference

Re: Pass variable by reference

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 15:16:54 -0400, Terry Reedy wrote: > On 5/5/2014 8:39 PM, Satish Muthali wrote: >> Hello experts, >> >> I have a burning question on how to pass variable by reference in >> Python. > > Python passes objects to functions. CPython implements this by passing > object pointers. In

Re: The “does Python have variables?” debate

2014-05-06 Thread Ned Batchelder
On 5/6/14 7:55 PM, Ben Finney wrote: Ned Batchelder writes: This meme bugs me so much. Python has variables. They work differently than variables in C. Which is why it's useful to intervene right at the start when someone comes in with assumptions about “variables”; it's better that they dis

Re: Pass variable by reference

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 16:31:35 -0400, Ned Batchelder wrote: > On 5/6/14 12:42 AM, Gary Herron wrote: >> This gets confusing, but in fact the most accurate answer is that >> Python does not have "variables", so there is no such thing as passing >> "variables" by reference or any other method. Python

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 4:16 AM, Terry Reedy wrote: > If the prepend requirement is covered by > > "The email package is a library for managing email messages, including MIME > and other RFC 2822-based message documents. It is specifically not designed > to do any sending of email messages to SMTP

Re: The “does Python have variables?” debate (was: Pass variable by reference)

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 9:55 AM, Ben Finney wrote: >> If you want to insist that Python has no variables, you will have to >> also say that neither do Javascript, Ruby, Java, PHP, etc. > > I don't know enough Ruby to comment there. For Java, Javascript, PHP, > they *do* have variables that work pre

Re: [OT] Silde rules

2014-05-06 Thread Ben Finney
Steven D'Aprano writes: > Guys, heaven knows I'm guilty of the occasional off-topic post myself, > and I'm not obsessive about these things, but there comes a time in every > off-topic thread where the right thing to do is to label it off-topic. > And this thread has long passed that time! Ye

The “does Python have variables?” debate (was: Pass variable by reference)

2014-05-06 Thread Ben Finney
Ned Batchelder writes: > This meme bugs me so much. Python has variables. They work differently > than variables in C. Which is why it's useful to intervene right at the start when someone comes in with assumptions about “variables”; it's better that they discard that baggage and learn about ref

Re: Pass variable by reference

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 7:00 AM, Mark H Harris wrote: > What does the word "variable" mean. Think BASIC variables. You can set them, > you can reset them, you can delete them, you can change them. ... because > they are variable. > > Python has names bound to objects... some of which you may not c

Re: [ANNC] pybotwar-0.9 : now using pybox2d-2.3b0

2014-05-06 Thread Josh English
I loved RoboWar on my Mac, many ages ago. I wrote a Stack based language very similar to the one RoboWar used. If you're interested, let me know. Josh English On Saturday, May 3, 2014 3:28:34 PM UTC-7, Lee Harr wrote: > pybotwar is a fun and educational game where players > write computer progr

Re: Pass variable by reference

2014-05-06 Thread Ned Batchelder
On 5/6/14 5:00 PM, Mark H Harris wrote: On 5/6/14 3:31 PM, Ned Batchelder wrote: On 5/6/14 12:42 AM, Gary Herron wrote: This gets confusing, but in fact the most accurate answer is that Python does not have "variables", so there is no such thing as passing "variables" by reference or any other

Re: Pass variable by reference

2014-05-06 Thread Mark H Harris
On 5/6/14 3:31 PM, Ned Batchelder wrote: On 5/6/14 12:42 AM, Gary Herron wrote: This gets confusing, but in fact the most accurate answer is that Python does not have "variables", so there is no such thing as passing "variables" by reference or any other method. Python *does* have names bound t

Re: Pass variable by reference

2014-05-06 Thread Michael Torrie
On 05/05/2014 06:39 PM, Satish Muthali wrote: > I want to nuke /var/lib/postgresql/9.3.4/main/data , however > programatically I want it to be as: /var/lib/postgresql/ pgversion>/main/data > > Any help is appreciated. Not sure really. But if you want to pass a some data around that can be manip

Re: (question) How to use python get access to google search without query quota limit

2014-05-06 Thread Mark H Harris
On 5/6/14 2:27 PM, Mark Lawrence wrote: will u please send me the code that you write. actually i'm trying to learn use of google search api but i'm not getting so please mail me the code. Sure but it's USD 1,000 cash or cheque made payable to the Python Software Foundation, backed up by banke

Re: Pass variable by reference

2014-05-06 Thread Ned Batchelder
On 5/6/14 12:42 AM, Gary Herron wrote: This gets confusing, but in fact the most accurate answer is that Python does not have "variables", so there is no such thing as passing "variables" by reference or any other method. Python *does* have names bound to values, but that's a very different thin

Re: Joining centos 6.5 member Domain Controller to an existing Windows Domain

2014-05-06 Thread Jerry Hill
On Mon, May 5, 2014 at 11:18 AM, Joshua Knights wrote: > > Here is my Issue and I think it may be a python path bug? It's not a bug in Python. It looks to me like a configuration problem. I'm going to assume you have a good reason for bypassing your OS's package management system. In general,

Re: (question) How to use python get access to google search without query quota limit

2014-05-06 Thread Mark Lawrence
On 06/05/2014 15:07, shrikant aher wrote: hey, will u please send me the code that you write. actually i'm trying to learn use of google search api but i'm not getting so please mail me the code. my mail id is shrikan...@gmail.com -- Shrikant Sure but it's USD 1

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Terry Reedy
On 5/5/2014 4:58 PM, Grant Edwards wrote: On 2014-05-05, Ethan Furman wrote: I don't know that it matters, but which Python version? I usually does these days. Sorry, should have mentioned it: 2.7.5 email has been improved with successive 3.x versions. https://docs.python.org/3/library/

Re: Pass variable by reference

2014-05-06 Thread Terry Reedy
On 5/5/2014 8:39 PM, Satish Muthali wrote: Hello experts, I have a burning question on how to pass variable by reference in Python. Python passes objects to functions. CPython implements this by passing object pointers. In one sense, your request is impossible. In another, it already happens

Re: Problems with ZODB, I can not persist and object accessed from 2 threads

2014-05-06 Thread dieter
Ariel Argañaraz writes: > Hello, I am sorry I am stuck in this. And I need some help > > I want to persist an Object with ZODB, the object can be accessed from 2 > different threads. The ZODB manual says: > > A multi-threaded program should open a separate Connection instance for > each thread. D

multiprocessing in a while loop?

2014-05-06 Thread Johan Llewellyn
hi, I am struggling to understand how to leverage python's multiprocessing module in a while loop.  the examples I have found seem to assume it is known ahead of time how many items need to be processed. specifically, I am reading from an external queue.  I currently process items one at a time

Re: Why Python 3?

2014-05-06 Thread Thomas Lehmann
Hi, I can't give you the advise for a concrete version anyway there are lot of arguments given by the other posters. BUT there is a way how you can circumvent the problem to some extend: Are you intending to use Jenkins? I don't want to convince you here why to use Jenkins but maybe I don't ne

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 10:53 AM, William Ray Wing wrote: I’m surprised no one has jumped in to defend/tout the Dietzgen slide rules (which I always thought were the ultimate). Mine (their Vector Log Log) is one of their Microglide series that had teflon rails inserted in the body and is still totally stick-f

[OT] Silde rules [was Re: Significant digits in a float?]

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 09:59:22 -0500, Mark H Harris wrote: [...] > I used my rule well into college; the first calculator I owned was > the Rockwell 63R --- "The Big green numbers, and the little rubber > feet!" Guys, heaven knows I'm guilty of the occasional off-topic post myself, and I'm no

Re: Significant digits in a float?

2014-05-06 Thread Joel Goldstick
HP 35. $350 in 1973 or 4. Still have it somewhere. Tom yay! On May 6, 2014 11:20 AM, "alister" wrote: > On Tue, 06 May 2014 09:51:25 -0500, Mark H Harris wrote: > > > On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: > >>> The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES > >>> on

xmlrpc: problems with socket handling, close, shutdown of server, TIME_WAIT, ...

2014-05-06 Thread thomas . lehmann . private
Hi, taking the xml-rpc derived from standard example is working - basically - but with following scenario I do not understand the problem. Maybe you can help: - one Unittest that does create the xmlrpc server in a thread in "setUp" and shutdown of it in tearDown. The xml-rcp server does s

How does apache runs a application when a request comes in?

2014-05-06 Thread Norah Jones
Hi, I have a python web application running on apache2 deployed with `mod_wsgi`. The application has a thread continuously running. This thread is a ZeroMQ thread and listening to a port in loop. The application is not maintaining session. Now if I open the browser and sends a request to the a

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Burak Arslan wrote: > > On 05/06/14 12:47, Chris Angelico wrote: >> On Tue, May 6, 2014 at 7:15 PM, alister >> wrote: >>> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >>> I'm working on a Python app that receives an e-mail message via SMTP, does some trivial p

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Tue, 06 May 2014 14:15:08 +, Grant Edwards wrote: > > I'd like to do it the right way whether it's required by the letter of > the law or not. So do I , although i might have left a cosmetic issue until the rest of the app was functioning as desired. As wiser minds than mine have now conf

Re: Significant digits in a float?

2014-05-06 Thread alister
On Tue, 06 May 2014 09:51:25 -0500, Mark H Harris wrote: > On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: >>> The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES >>> on the site is yellow (mine is white) and the site rule indicates >>> Picket & Eckel Inc. (that's where the E comes

Re: (question) How to use python get access to google search without query quota limit

2014-05-06 Thread alister
On Tue, 06 May 2014 19:37:14 +0530, shrikant aher wrote: > hey, > will u please send me the code that you write. actually i'm trying to > learn use of google search api but i'm not getting so please mail me the > code. my mail id is shrikan...@gmail.com it does not work like that here you show u

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Burak Arslan
On 05/06/14 12:47, Chris Angelico wrote: > On Tue, May 6, 2014 at 7:15 PM, alister > wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another S

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 8:47 PM, Dennis Lee Bieber wrote: On Wed, 30 Apr 2014 22:54:21 -0500, Mark H Harris declaimed the following: My high school '74 was the last class to learn the slide-rule using the Sterling (we paid a deposit to use the school's). Since calculators had started to appe

Re: Significant digits in a float?

2014-05-06 Thread Mark H Harris
On 5/1/14 9:06 PM, Dennis Lee Bieber wrote: The N4-ES and the N4-T (mine) are essentially the same rule. The N4-ES on the site is yellow (mine is white) and the site rule indicates Picket & Eckel Inc. (that's where the E comes from) Also the the ES states Chicage Ill USA where the T states Made

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Yimr Zero
If you use Python 2.7, you should add urllib, urllib2 modules. If you use Python 3, the two modules mentioned above are included in urllib. -- https://mail.python.org/mailman/listinfo/python-list

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Wed, May 7, 2014 at 12:15 AM, Grant Edwards wrote: > On 2014-05-06, alister wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another SMTP >>

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Grant Edwards wrote: > On 2014-05-06, alister wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forwards it to another SMTP >>> server. >>> >>>

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, alister wrote: > On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > >> I'm working on a Python app that receives an e-mail message via SMTP, >> does some trivial processing on it, and forwards it to another SMTP >> server. >> >> I'd like to do the polite thing and add a "Re

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Grant Edwards
On 2014-05-06, Steven D'Aprano wrote: > On Tue, 06 May 2014 02:13:09 +, Grant Edwards wrote: > >> There's is a somewhat messy way to do it by calling msg.items() to >> retrieve all the current headers, removing all of them, and then adding >> them all back (includeing the new one) in the order

(question) How to use python get access to google search without query quota limit

2014-05-06 Thread shrikant aher
hey, will u please send me the code that you write. actually i'm trying to learn use of google search api but i'm not getting so please mail me the code. my mail id is shrikan...@gmail.com -- Shrikant -- https://mail.python.org/mailman/listinfo/python-list

Re: A Question about Python

2014-05-06 Thread Denis McMahon
On Tue, 06 May 2014 05:09:25 -0700, doaa eman wrote: > I'm a researcher .. Obviously part of your PhD research is going to be whether the citeulike_api 0.1.3dev python package can help you extract the information you want from http://citeulike.org/ We look forwards to seeing your conclusio

Re: A Question about Python

2014-05-06 Thread Rustom Mody
On Tuesday, May 6, 2014 5:39:25 PM UTC+5:30, doaa eman wrote: > hello; > > I'm a researcher from Cairo University (Information science Dep.) > i want to know how can i use Paython language on CiteULike > i need to use it for extracting only tagged articles in the field > of > medicine for exampl

A Question about Python

2014-05-06 Thread doaa eman
hello; I'm a researcher from Cairo University (Information science Dep.) i want to know how can i use Paython language on CiteULike i need to use it for extracting only tagged articles in the field of medicine for example for my Ph.D research. another question please : can this webpage help me

Re: Pass variable by reference

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 8:38 PM, Marko Rauhamaa wrote: > Chris Angelico : > >>> characters, words, lines = stats.read() >> >> That's not really pass-by-reference, though. What you're doing is >> output parameters, which are usually implemented in C with pointers, >> but in Python with a return

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 8:26 PM, alister wrote: > On Tue, 06 May 2014 19:47:54 +1000, Chris Angelico wrote: > >> On Tue, May 6, 2014 at 7:15 PM, alister >> wrote: >>> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >>> I'm working on a Python app that receives an e-mail message via S

Re: Pass variable by reference

2014-05-06 Thread Marko Rauhamaa
Chris Angelico : >> characters, words, lines = stats.read() > > That's not really pass-by-reference, though. What you're doing is > output parameters, which are usually implemented in C with pointers, > but in Python with a return tuple. Correct, but it is worth questioning the question itsel

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Tue, 06 May 2014 19:47:54 +1000, Chris Angelico wrote: > On Tue, May 6, 2014 at 7:15 PM, alister > wrote: >> On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: >> >>> I'm working on a Python app that receives an e-mail message via SMTP, >>> does some trivial processing on it, and forward

Re: Pass variable by reference

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 7:11 PM, Marko Rauhamaa wrote: > Steven D'Aprano : > >> On Mon, 05 May 2014 17:39:44 -0700, Satish Muthali wrote: >>> I have a burning question on how to pass variable by reference in >>> Python. I understand that the data type has to be mutable. >> >> [...] >> >> To get an

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Chris Angelico
On Tue, May 6, 2014 at 7:15 PM, alister wrote: > On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > >> I'm working on a Python app that receives an e-mail message via SMTP, >> does some trivial processing on it, and forwards it to another SMTP >> server. >> >> I'd like to do the polite thi

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread alister
On Mon, 05 May 2014 19:51:15 +, Grant Edwards wrote: > I'm working on a Python app that receives an e-mail message via SMTP, > does some trivial processing on it, and forwards it to another SMTP > server. > > I'd like to do the polite thing and add a "Received:" header, but I > can't figure o

Re: Pass variable by reference

2014-05-06 Thread Marko Rauhamaa
Steven D'Aprano : > On Mon, 05 May 2014 17:39:44 -0700, Satish Muthali wrote: >> I have a burning question on how to pass variable by reference in >> Python. I understand that the data type has to be mutable. > > [...] > > To get an effect *similar* to pass-by-reference, you can wrap your > varia

Mapping of node numbers

2014-05-06 Thread varun7rs
Hello Everyone, I need to map the node ID to a number. I am using this xml file as of now. http://sndlib.zib.de/coredata.download.action?objectName=germany50&format=xml&objectType=network Also, I need to use the same node number whenever there is a node occurrence in the source and destination.

Re: Add "Received:" header to email msg in correct position?

2014-05-06 Thread Steven D'Aprano
On Tue, 06 May 2014 02:13:09 +, Grant Edwards wrote: > There's is a somewhat messy way to do it by calling msg.items() to > retrieve all the current headers, removing all of them, and then adding > them all back (includeing the new one) in the order I want them. Does msg.items() return the ac

Re: Pass variable by reference

2014-05-06 Thread Steven D'Aprano
On Mon, 05 May 2014 17:39:44 -0700, Satish Muthali wrote: > Hello experts, > > I have a burning question on how to pass variable by reference in > Python. I understand that the data type has to be mutable. Python provides neither pass-by-reference nor pass-by-value argument passing. Please rea