Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Marko Rauhamaa
Steven D'Aprano : > On Thu, 15 May 2014 17:12:57 +0300, Marko Rauhamaa wrote: > >> A definitive Python source file could be binary, XML, .py, .ast, >> whatever, > > Containing *what*? You can't just wave your hands and say "binary". I sure can and am. > Besides, where does the information insid

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Steven D'Aprano
On Thu, 15 May 2014 17:06:13 -0700, Rustom Mody wrote: > The claim being made is that 79/80 is a fundamental, cognitive limit and > has no relation to technological changes. I don't believe anyone has made that claim. You are reading a statement about general (typical, average) behaviour, and tu

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Chris Angelico
On Fri, May 16, 2014 at 4:25 PM, Steven D'Aprano wrote: > Containing *what*? You can't just wave your hands and say "binary". What > sort of binary file? Perhaps a JPEG file, where red triangles of > different sizes represent keywords. Variable names can be encoded using a > pattern of purple dots

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Chris Angelico
On Fri, May 16, 2014 at 5:00 PM, Marko Rauhamaa wrote: > Well, actually, any .py file *does* specify a unique AST. Nothing would > prevent the text editor from presenting it according to your > preferences. They all do that to a degree anyway (colors, fonts), but > they could take even more libert

Re: IndexError: pop from empty list

2014-05-16 Thread Peter Otten
ch...@freeranger.com wrote: > No, that was pretty much what I was looking for. If anyone has an answer > to the deeper question, that would be icing on the cake. > > What is interesting is that usually the traceback shows the line of code > that I invoke which, deep inside a library I'm using, h

Extracting the value from Netcdf file with longitude and lattitude

2014-05-16 Thread Isaac Won
Hi, My question may be confusing. Now I would like to extract temperature values from model output with python. My model output have separate temperature, longitude and latitude variables. So, I overlap these three grid variables on one figure to show temperature with longitude and latitude thr

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Marko Rauhamaa
Chris Angelico : > You still haven't answered my biggest objection from earlier. Source > code contains more information than the AST does; even if you make a > frAnkenSTein's monster that includes comments, there's still the point > that whitespace carries information, and that information is > f

The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Enlong Liu
Dear All, I have a question about the integration with Python. The equation is as below: and I want to get values of I with respect of V. E_F is known. But for T(E), I don't have explicit equation, but a .dat file containing two columns, the first is E, and the second is T(E). It is also in the at

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Chris Angelico
On Fri, May 16, 2014 at 7:18 PM, Marko Rauhamaa wrote: > If every bit of your Python text conveys information, obviously, it > can't be abstracted. I don't believe that to be the case, though. So > this AST should contain all *actual* information worth conveying and > strip away irrelevant stuff.

Psycopg2 : error message.

2014-05-16 Thread dandrigo
Dear all, I'm writing a python script for a web service. I have to connect to my postgres/postgis databases via Psycopg2. I writed a little first script just to connect to my pg/postgis db and drop a test db. But when i execute the python file, i have several error messages. Please read the

Re: PEP 8 : Maximum line Length :

2014-05-16 Thread Marko Rauhamaa
Chris Angelico : > Compare these two assignment statements: > > area = (base*base + extension*extension > + annex*annex + (annex-extension)*annex > + triangle*triangle/2 > + circle*circle*math.PI + sphere*sphere*4*math.PI) > > area = (base*base + extension*extension + annex*annex >

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Dave Angel
On 05/16/2014 04:49 AM, Enlong Liu wrote: Dear All, I have a question about the integration with Python. The equation is as below: and I want to get values of I with respect of V. E_F is known. But for T(E), I don't have explicit equation, but a .dat file containing two columns, the first is E,

Re: Psycopg2 : error message.

2014-05-16 Thread Chris Angelico
On Fri, May 16, 2014 at 8:18 PM, dandrigo wrote: > Please read the 2 usefull files below : > > Dandrigo pg_test.py > > SS_dos.JPG These would be MUCH better included inline. Please, i

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread Antoine Pitrou
Terry Reedy udel.edu> writes: > > On 5/13/2014 8:53 PM, Ethan Furman wrote: > > On 05/13/2014 05:10 PM, Steven D'Aprano wrote: > >> On Tue, 13 May 2014 10:08:42 -0600, Ian Kelly wrote: > >> > >>> Because Python 3 presents stdin and stdout as text streams however, it > >>> makes them more difficul

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Enlong Liu
Sorry for this inconvenience. Since my file is a little large, I think it will be more difficult for fellows to check. I will now paste the attachment below. The file for T(E) consists of two columns, the first is E and the second is T(E). What I want is to integrate this function in a certain r

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread duncan smith
On 16/05/14 13:57, Enlong Liu wrote: Sorry for this inconvenience. Since my file is a little large, I think it will be more difficult for fellows to check. I will now paste the attachment below. The file for T(E) consists of two columns, the first is E and the second is T(E). What I want is to

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread wxjmfauth
Le vendredi 16 mai 2014 13:50:47 UTC+2, Antoine Pitrou a écrit : > Terry Reedy udel.edu> writes: > > > > > > On 5/13/2014 8:53 PM, Ethan Furman wrote: > > > > On 05/13/2014 05:10 PM, Steven D'Aprano wrote: > > > >> On Tue, 13 May 2014 10:08:42 -0600, Ian Kelly wrote: > > > >> > > > >>> Beca

urllib with x509 certs

2014-05-16 Thread Luis Miguel Rojas Aguilera
Hi, i tried what you suggest but still asking me for the password, this time twice. Please i need help so this is for my thesis. VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de julio de 2014. Ver www.uci.cu -- https://mail.python.org/mailman/listinfo/python-list

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread Grant Edwards
On 2014-05-14, alister wrote: > On Wed, 14 May 2014 10:08:57 +1000, Chris Angelico wrote: > >> On Wed, May 14, 2014 at 9:53 AM, Steven D'Aprano >> wrote: >>> With the current system, all of us here are technically violating >>> copyright every time we reply to an email and quote more than a small

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Johannes Schneider
If you do not have a closed form for T(E) you cannot calculate the exact value of I(V). Anyway. Assuming T is integrable you can approximate I(V). 1. Way to do: interpolate T(E) by a polynomial P and integrate P. For this you need the equation (coefficients and exponents) of P. Integrating is

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Ernest Bonat, Ph.D.
Hi Enlong You may try standard numerical integration solutions based on the E and T(E) columns data provided. Ernest Bonat, Ph.D. On Fri, May 16, 2014 at 1:49 AM, Enlong Liu wrote: > Dear All, > > I have a question about the integration with Python. The equation is as > below: > and I want t

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Terry Reedy
On 5/16/2014 4:49 AM, Enlong Liu wrote: Dear All, I have a question about the integration with Python. For numerical integration, you should look as numpy and scipy and perhaps associated packages. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread duncan smith
On 16/05/14 16:01, Johannes Schneider wrote: If you do not have a closed form for T(E) you cannot calculate the exact value of I(V). Anyway. Assuming T is integrable you can approximate I(V). 1. Way to do: interpolate T(E) by a polynomial P and integrate P. For this you need the equation (coeff

Re: The possibility integration in Python without an equation, just an array-like file

2014-05-16 Thread Ernest Bonat, Ph.D.
1. There are a lot of spinet codes in many languages for numerical integration. I may find a good one in Python for you? try SciPy.org ( http://www.scipy.org/about.html) you may find something there. 2. Look at the wiki too: https://wiki.python.org/moin/NumericAndScientific. I hope this help a bi

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread Steven D'Aprano
On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: > At least in the US, there doesn't seem to be such a thing as "placing a > work into the public domain". The copyright holder can transfer > ownershipt to soembody else, but there is no "public domain" to which > ownership can be trasferre

Re: Everything you did not want to know about Unicode in Python 3

2014-05-16 Thread Marko Rauhamaa
Steven D'Aprano : > On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: > >> At least in the US, there doesn't seem to be such a thing as "placing >> a work into the public domain". The copyright holder can transfer >> ownershipt to soembody else, but there is no "public domain" to which >> o

Loading modules from files through C++

2014-05-16 Thread Roland Plüss
I'm using Python in an embedded situation. In particular I have to load python scripts through a memory interface so regular python module loading can not be used. I got working so far a module loader object I've added using C++ to sys.meta_path . Now I'm totally stuck at the finally loading step.