Re: for / while else doesn't make sense

2016-05-24 Thread Gregory Ewing
Pete Forman wrote: Gregory Ewing writes: Pete Forman wrote: However I am coming from scientific measurements where 1.0 is the stored value for observations between 0.95 and 1.05. You only know that because you're keeping some extra information in your head about what the 1.0 stored in your

Re: for / while else doesn't make sense

2016-05-24 Thread Gregory Ewing
Christopher Reimer wrote: Nope. I meant 8-bit ASCII (0-255). http://www.ascii-code.com That page is talking about latin-1, which is just one of many possible 8-bit extensions of ascii. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about imports and packages

2016-05-24 Thread Ben Finney
Gerald Britton writes: > On Wed, 25 May 2016 10:00 am, Steven D'Aprano wrote: > >The problem is that you are running the Python script from *inside* > >the package. That means, as far as the script can see, there is no > >longer a package visible -- it cannot see its own outside from the > >insid

Re: Question about imports and packages

2016-05-24 Thread Terry Reedy
On 5/24/2016 9:02 PM, Steven D'Aprano wrote: On Wed, 25 May 2016 09:35 am, Gerald Britton wrote: For brevity, here's your package setup: testpkg/ +-- __init__.py +-- testimport.py which runs "from testpkg.testimported import A" +-- testimported.py containing class A Your package layout is cor

Question about imports and packages

2016-05-24 Thread Gerald Britton
On Wed, 25 May 2016 10:00 am, Steven D'Aprano wrote: >On Wed, 25 May 2016 09:35 am, Gerald Britton wrote: > >For brevity, here's your package setup: > > >testpkg/ >+-- __init__.py >+-- testimport.py which runs "from testpkg.testimported import A" >+-- testimported.py containing class A > >Your pack

Re: Question about imports and packages

2016-05-24 Thread Steven D'Aprano
On Wed, 25 May 2016 09:35 am, Gerald Britton wrote: For brevity, here's your package setup: testpkg/ +-- __init__.py +-- testimport.py which runs "from testpkg.testimported import A" +-- testimported.py containing class A Your package layout is correct. But: > When I run > > python testimport

Re: multiprocessing not quite working

2016-05-24 Thread MRAB
On 2016-05-24 23:17, Noah wrote: Hi, I am using this example: http://spartanideas.msu.edu/2014/06/20/an-introduction-to-parallel-programming-using-pythons-multiprocessing-module/ I am sending and receiving communication from the worker processes. Two issues. the join is only getting to the pr

Question about imports and packages

2016-05-24 Thread Gerald Britton
I'm trying to understand packages in Python, especially Intra Package References. >From https://docs.python.org/2/tutorial/modules.html#packages i see that: you can use absolute imports to refer to submodules of siblings packages. This is what I can't get to work in my case. Here's the setup:

multiprocessing not quite working

2016-05-24 Thread Noah
Hi, I am using this example: http://spartanideas.msu.edu/2014/06/20/an-introduction-to-parallel-programming-using-pythons-multiprocessing-module/ I am sending and receiving communication from the worker processes. Two issues. the join is only getting to the process and waiting. When I commen

batch files and path in python (subprocess | sys)

2016-05-24 Thread Xristos Xristoou
hello i use some programs where support python api. but to can use that api from programs need to define some paths(pythonpath program and more) and call some batch files(if i not do that i cant access api support).create an .bat file where if i run i can use api. mybatch.bat set ROOT=C:\pa

.bat files and path in python(subprocess | sys)

2016-05-24 Thread Xristos Xristoou
hello i use some programs where support python api. but to can use that api from programs need to define some paths(pythonpath program and more) and call some batch files(if i not do that i cant access api support).create an .bat file where if i run i can use api. mybatch.bat set ROOT=C:\path\p

Re: for / while else doesn't make sense

2016-05-24 Thread Jon Ribbens
On 2016-05-24, Steven D'Aprano wrote: > On Tue, 24 May 2016 08:54 pm, Jon Ribbens wrote: >> On 2016-05-24, Steven D'Aprano wrote: >>> On Tue, 24 May 2016 03:09 am, Jon Ribbens wrote: On 2016-05-23, Steven D'Aprano wrote: > [...] >>> In Australia, we have an 11% consumption tax, the GST. I c

Re: META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread Paul Rubin
Ned Batchelder writes: > Once the tone gets to picking apart any detail, no matter how trivial, it's > just turned into a contest to see who can be more right. It helps to use a threaded news/mail reader (I use gnus). When a subtopic starts going off the fails, hitting control-K marks the rest o

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-24 Thread Sean Son
Thanks for the reply. Looks like I am screwed on this one lol On Tue, May 24, 2016 at 3:31 PM, MRAB wrote: > On 2016-05-24 20:04, Sean Son wrote: > >> hello all >> >> I am testing out a script called androwarn.py, which I downloaded from: >> >> https://github.com/mz/androwarn >> >> using th

Re: META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread Wildman via Python-list
On Tue, 24 May 2016 10:44:56 -0700, Ned Batchelder wrote: > On Tuesday, May 24, 2016 at 12:44:04 PM UTC-4, Steven D'Aprano wrote: >> On Tue, 24 May 2016 12:19 pm, Ned Batchelder wrote: >> >> > Ugh, can we please stop with the "well, actually" pedantic tangents? >> >> With respect, no. >> >> Thi

Re: Strange Python related errors for androwarn.py. Please help!

2016-05-24 Thread MRAB
On 2016-05-24 20:04, Sean Son wrote: hello all I am testing out a script called androwarn.py, which I downloaded from: https://github.com/mz/androwarn using the instructions found on: https://github.com/mz/androwarn/wiki/Installation When I ran the following commands to test the APK

Strange Python related errors for androwarn.py. Please help!

2016-05-24 Thread Sean Son
hello all I am testing out a script called androwarn.py, which I downloaded from: https://github.com/mz/androwarn using the instructions found on: https://github.com/mz/androwarn/wiki/Installation When I ran the following commands to test the APK for AirBNB: python androwarn.py -i S

Re: for / while else doesn't make sense

2016-05-24 Thread MRAB
On 2016-05-24 18:49, Chris Angelico wrote: On Wed, May 25, 2016 at 3:44 AM, Steven D'Aprano wrote: If you're just going to automatically gainsay everything I say without even reading what I say first, well, you're no John Cleese. Yes he is! He's not John Cleese, he's a very naughty boy. :-

Re: for / while else doesn't make sense

2016-05-24 Thread Christopher Reimer
On May 24, 2016, at 7:23 AM, Grant Edwards wrote: > >> On 2016-05-24, Steven D'Aprano wrote: >>> On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote: >>> >>> Those symbols are blowing my 8-bit ASCII brain. :) >> >> That's certainly true, because there is no such thing as 8-bit ASCII. > > H

Re: Unit test a class with xml elements

2016-05-24 Thread John Gordon
In <4c25c98f-9cf0-4a70-b33b-1d2c982de...@googlegroups.com> Palpandi writes: > Hi, > How can I unit test a class which using xml elements? > There is a posiibility of different combinations of xml. > What is the better way to test this kind of class? > XML binding is used here. > Share if any

Re: ZipImportError: can't find module

2016-05-24 Thread John Gordon
In <1e511b73-e984-459c-9311-77bcd...@googlegroups.com> loial writes: > What has been working for years suddenly has an error : > zipimport.ZipImportError: can't find module 'mymodule' How is the shell script executed? Is it run interactively, or from a cron job? Are the permissions on th

Re: for / while else doesn't make sense

2016-05-24 Thread Pete Forman
Gregory Ewing writes: > Pete Forman wrote: >> However I am coming from scientific measurements where 1.0 is the >> stored value for observations between 0.95 and 1.05. > > You only know that because you're keeping some extra information in > your head about what the 1.0 stored in your computer re

Re: Need python script to scan website with safe browsing site status

2016-05-24 Thread mm0fmf
On 24/05/2016 09:05, cheapfiverrservi...@gmail.com wrote: i need a python script which can scan provided list of websites and scan that list with https://www.google.com/transparencyreport/safebrowsing/diagnostic/index.html and save result of dangerous website or infected website in another tex

Re: for / while else doesn't make sense

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 3:44 AM, Steven D'Aprano wrote: > > If you're just going to automatically gainsay everything I say without even > reading what I say first, well, you're no John Cleese. Yes he is! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Here is a summary of what I did with numpy and the dll I have verified that the values entering the last dll call (dl.cfunction) are identical across platforms. The c function has a signature as follows: int cfunction(int len_data, float* data, int* ac, int num_ac, int flag1, int

Re: META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread Ned Batchelder
On Tuesday, May 24, 2016 at 12:44:04 PM UTC-4, Steven D'Aprano wrote: > On Tue, 24 May 2016 12:19 pm, Ned Batchelder wrote: > > > Ugh, can we please stop with the "well, actually" pedantic tangents? > > With respect, no. > > This is a forum with a very tolerant approach to off-topic and only- >

Re: for / while else doesn't make sense

2016-05-24 Thread Steven D'Aprano
On Tue, 24 May 2016 08:54 pm, Jon Ribbens wrote: > On 2016-05-24, Steven D'Aprano wrote: >> On Tue, 24 May 2016 03:09 am, Jon Ribbens wrote: >>> On 2016-05-23, Steven D'Aprano wrote: [...] >> In Australia, we have an 11% consumption tax, the GST. I cannot tell you >> how many times I've needed t

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
The c function has a signature as follows: int cfun(int len_data, float* data, int* a, int num_a, int flag1, int flag2, int flag3, float* param, float* out1, float* out2, float* out3) and in python: import numpy as np import ctypes as ct data = np.atleast_2d(np.float32(data

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 3:12 AM, Steven D'Aprano wrote: >>2: In my process later on I get: "OverflowError: long too big to >>convert". > > Can you copy and paste the actual traceback rather than retyping it from > memory? I think you're missing something, namely what the long is being > co

Re: META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread boB Stepp
On Tue, May 24, 2016 at 11:43 AM, Steven D'Aprano wrote: [...] > ...Python-Dev, etc, all with their own idiosyncrasies. This is ours: we have a > bunch of people here who enjoy extended discussions on computing matters > which are sometimes only tangentially related to Python. I rarely post on

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread Steven D'Aprano
On Tue, 24 May 2016 08:22 pm, thomas povtal.org wrote: >Hi, > >Please excuse me if this is not the right place, but I have some issues >with CPython on a NUMA machine. Do you mean a Non-Uniform Memory Access machine? Can you be more specific about the actual machine and OS used?

[smtplib] how to assure login was succesful?

2016-05-24 Thread maurice
Hello to all. I have the following question: Once my python script reaches the point where I login in my email account with: server.login(username,password) (where server server = smtplib.SMTP('smtp.office365.com:587')), it returns a tuple like this: (235, '2.7.0 Authentication successful tar

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 2:32 AM, Steven D'Aprano wrote: > On Wed, 25 May 2016 02:18 am, Siyi Deng wrote: > >> Hello ChrisA, >> I don't quite understand, the binary shared library contains no python >> interfaces, it should be independent of python. > > In your first post, you said you were using n

META Culture of this place [was Re: for / while else doesn't make sense]

2016-05-24 Thread Steven D'Aprano
On Tue, 24 May 2016 12:19 pm, Ned Batchelder wrote: > Ugh, can we please stop with the "well, actually" pedantic tangents? With respect, no. This is a forum with a very tolerant approach to off-topic and only- slightly-on-topic discussions. If you want a forum that follows strict rules for what'

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Steven D'Aprano
On Wed, 25 May 2016 02:18 am, Siyi Deng wrote: > Hello ChrisA, > I don't quite understand, the binary shared library contains no python > interfaces, it should be independent of python. In your first post, you said you were using numpy. How is that independent of Python? > As a matter of fact,

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Wed, May 25, 2016 at 2:18 AM, Siyi Deng wrote: > I don't quite understand, the binary shared library contains no python > interfaces, it should be independent of python. As a matter of fact, I have > successfully used it in Conda python 2.7, 3.5, Julialang as well as c++ > executables. I th

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Hello ChrisA, I don't quite understand, the binary shared library contains no python interfaces, it should be independent of python. As a matter of fact, I have successfully used it in Conda python 2.7, 3.5, Julialang as well as c++ executables. I think the fact that only stock python 2.7 faile

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
Hi! Thanks for the reply. Unfortunately I missed a 'not'. I'm not able to reproduce it locally :( The corrupted .pyc file experience: I suppose that effect the behaviour both if the .pyc file is the main file or as an something that gets imported. :) T Den 24. maj 201

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
Hi! Thanks! That was a typo. I do '=='. The rest of the mail is ok (with the corrections from Chris) :) T Den 24. maj 2016 klokken 17:05 skrev Novocastrian_Nomad : On Tuesday, May 24, 2016 at 5:47:55 AM UTC-6, thomas povtal.org wrote: ... > 1: I get "Runtim

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread Novocastrian_Nomad
On Tuesday, May 24, 2016 at 5:47:55 AM UTC-6, thomas povtal.org wrote: ... >1: I get "RuntimeWarning: tp_compare didn't return -1 or -2 for >exception". It's a line like: > >"if Foo = False:" where Foo is a global variable (global Foo). ... Are you really using "if Foo = False:"? If s

Re: JNLP File download and run

2016-05-24 Thread Michael Torrie
On 05/24/2016 12:01 AM, Robert Clove wrote: > Can u provide the pseudo code for the same I think you'll be disappointed. What you want to do is a simple, three-step affair in pseudocode: download the jnlp file launch javaws to run the jnlp file delete jnlp file That *is* the pseudo code in its

Re: str(float) python 3 versus 2.7

2016-05-24 Thread Robin Becker
On 23/05/2016 18:05, Ian Kelly wrote: On Mon, May 23, 2016 at 10:39 AM, Robin Becker wrote: . If you want to show the float in a less noisy format, you can explicitly format it using the 'g' or 'n' presentation type, which essentially round to a given precision and strip off trailing

Re: for / while else doesn't make sense

2016-05-24 Thread Grant Edwards
On 2016-05-24, Steven D'Aprano wrote: > On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote: > >> Those symbols are blowing my 8-bit ASCII brain. :) > > That's certainly true, because there is no such thing as 8-bit ASCII. He meant to say "my 8-bit, ASCII brain". The adjectives "8-bit" and "A

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread Chris Angelico
On Tue, May 24, 2016 at 8:22 PM, thomas povtal.org wrote: > Please excuse me if this is not the right place, but I have some issues >with CPython on a NUMA machine. > >We're using gevent and I'm suspecting some "threading" could cause this, >as I'm able to replicate it locally with th

Unit test a class with xml elements

2016-05-24 Thread Palpandi
Hi, How can I unit test a class which using xml elements? There is a posiibility of different combinations of xml. What is the better way to test this kind of class? XML binding is used here. Share if any examples available. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
Hi, Please excuse me if this is not the right place, but I have some issues with CPython on a NUMA machine. 1: I get "RuntimeWarning: tp_compare didn't return -1 or -2 for exception". It's a line like: "if Foo = False:" where Foo is a global variable (global Foo). Now, I've

Re: for / while else doesn't make sense

2016-05-24 Thread Jon Ribbens
On 2016-05-24, Steven D'Aprano wrote: > On Tue, 24 May 2016 03:09 am, Jon Ribbens wrote: >> On 2016-05-23, Steven D'Aprano wrote: >>> But one thing is certain: very few people, Jon Ribbens being one of them, >>> expects 1/3 to return 0. And that is why Python changed the meaning of >>> the / oper

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-24 Thread rocky
On Monday, May 23, 2016 at 2:17:07 AM UTC-4, Pete Forman wrote: > rocky writes: > > > I'm looking for a good name for a relatively new project I'll put on pypy. > > > > I've been working on a module to disassemble Python bytecode from many > > versions of Python. (Right now 2.3 .. 3.5 bytecode, l

EuroPython 2016 Keynote: Rachel Willmer

2016-05-24 Thread M.-A. Lemburg
We are pleased to announce our third keynote speaker for EuroPython 2016: *** Rachel Willmer *** About Rachel Willmer Rachel has been working at the "bleeding edge" of technology for 30 years, as programmer, network engineer, manager, startup founder

Need python script to scan website with safe browsing site status

2016-05-24 Thread cheapfiverrservices
i need a python script which can scan provided list of websites and scan that list with https://www.google.com/transparencyreport/safebrowsing/diagnostic/index.html and save result of dangerous website or infected website in another text file. -- https://mail.python.org/mailman/listinfo/python-

ZipImportError: can't find module

2016-05-24 Thread loial
I am suddenly having a problem with importing a module from a zip file in Python 2.4.1 What has been working for years suddenly has an error : zipimport.ZipImportError: can't find module 'mymodule' PYTHONPATH is correct, it points to the zip file containing mymodule N.B. the python script(unch

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Chris Angelico
On Tue, May 24, 2016 at 5:15 PM, Siyi Deng wrote: > Thanks for all the replies. > > It turned out that the Apple OS X stock python 2.7 gives the wrong results, > but other distributions like 2.7 from miniconda gives the correct results. > Facepalm. When you use a binary shared library, it has t

Re: Setting Return-Path in email

2016-05-24 Thread dieter
ragav s writes: > How can i add different Return-path and fromid in python.i have pasted the > below code for preview Note that there are two different return paths associated with an email exchange: one on the protocol level (SMPT - RFC821); the other at the message level. The one on the proto

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-24 Thread Siyi Deng
Thanks for all the replies. It turned out that the Apple OS X stock python 2.7 gives the wrong results, but other distributions like 2.7 from miniconda gives the correct results. Facepalm. -- https://mail.python.org/mailman/listinfo/python-list