Re: Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Steven D'Aprano
On Sat, 9 Jan 2016 03:16 am, Chris Angelico wrote: > On Sat, Jan 9, 2016 at 3:07 AM, Steven D'Aprano > wrote: >> If you absolutely insist that you must must must continue to use a double >> underscore name, you could also try this: >> >> py> __a = 1 >> py> class Test: >> ... def method(self):

OT, but

2016-01-08 Thread Gene Heskett
Greetings all; Where can I find the best tut for pyvcp? Thanks all. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) Genes Web page -- https://

Re: Strange crash while running a script with a embedded python interpreter

2016-01-08 Thread Michael Torrie
On 01/08/2016 09:18 AM, Rickard Englund wrote: > First, some system info > * Windows 7 (also tested on 8 and 10) > * Python 3.5.1 64bit (previously also tested using several 3.x versions) > (also tested with 32 bit, but with 3.4.2) > * Microsoft Visual Studio 2015 (earlier version of python als

Re: What use is '__reduce__'?

2016-01-08 Thread Peter Otten
Ian Kelly wrote: > As you found by searching, __reduce__ is used to determine how > instances of the class are pickled. If the example you're using > doesn't do any pickling, then it's not really relevant to the example. > It's probably included so that it won't be missed when the code is > copied

Re: EOFError: marshal data too short -- causes?

2016-01-08 Thread Glenn Linderman
On 1/7/2016 7:44 PM, Dennis Lee Bieber wrote: On Thu, 7 Jan 2016 10:55:38 -0800, Glenn Linderman declaimed the following: But all the touched files are .pyc files (and the directories __pycache__ directories). None of the source files were modified. So why would any .pyc files ever be updated

Re: How to remove item from heap efficiently?

2016-01-08 Thread srinivas devaki
So you need a task scheduler with expiration and priority on each task. Interesting Problem.. as peter said about marking the task in heapB to be deleted. but this needs searching everytime you pop off an old item [complexity: O(len(heapB))]. you may as well use python del on it as complexity is s

Required Python/Backend Engineer, Data in Redwood City, CA -- full time

2016-01-08 Thread naveen . v
Hi , One of our client seeking Python/Backend Engineer, Data in Redwood City, CA If you are interested please send me your updated resume at navee...@maania.com along with your expected salary. Title: Python/Backend Engineer, Data Location: Redwood City, CA Full time position Required:

Re: extract script from executable made by pyinstaller?

2016-01-08 Thread Ulli Horlacher
Oscar Benjamin wrote: > On 8 January 2016 at 07:44, Ulli Horlacher > wrote: > > Is it possible to extract (and view) the Python script from the Windows > > executable which was made by pyinstller? > > I may be misremembering but I though that pyinstaller actually stores > the main script uncompr

Re: What use is '() here?

2016-01-08 Thread Robert
On Friday, January 8, 2016 at 12:44:01 PM UTC-5, Robert wrote: > Hi, > > Thanks Ian for replying to my previous post. Here is a further question on > the 'return' line below. > > > > > import collections > import pickle > class C(collections.defaultdict): > def __init__(self): >

Re: What use is '__reduce__'?

2016-01-08 Thread Robert
On Friday, January 8, 2016 at 12:04:21 PM UTC-5, Ian wrote: > As you found by searching, __reduce__ is used to determine how > instances of the class are pickled. If the example you're using > doesn't do any pickling, then it's not really relevant to the example. > It's probably included so that it

What use is '() here?

2016-01-08 Thread Robert
Hi, Thanks Ian for replying to my previous post. Here is a further question on the 'return' line below. import collections import pickle class C(collections.defaultdict): def __init__(self): collections.defaultdict.__init__(self, list) def __reduce__(self): t = coll

Re: What use is '__reduce__'?

2016-01-08 Thread Ian Kelly
As you found by searching, __reduce__ is used to determine how instances of the class are pickled. If the example you're using doesn't do any pickling, then it's not really relevant to the example. It's probably included so that it won't be missed when the code is copied. On Fri, Jan 8, 2016 at 9:

Re: debugging uwsgi

2016-01-08 Thread Robin Becker
On 08/01/2016 15:03, Robin Becker wrote: I have an unusual bug in a large django project which has appeared when using nginx + uwsgi + django. The configuration nginx + flup + django or the django runserver don't seem to create the conditions for the error. Basically I am seeing an error Trace

What use is '__reduce__'?

2016-01-08 Thread Robert
Hi, When I try to run the following code: / from collections import Counter, OrderedDict class OrderedCounter(Counter, OrderedDict): 'Counter that remembers the order elements are first seen' def __repr__(self): return '%s(%r)' % (self.__class__.__name__,

Re: Need help on a project To :"Create a class called BankAccount with the following parameters "

2016-01-08 Thread acushla4real
On Wednesday, 30 December 2015 19:21:32 UTC+1, Won Chang wrote: > i have these task which i believe i have done well to some level > > Create a function get_algorithm_result to implement the algorithm below > > 1- Get a list of numbers L1, L2, L3LN as argument 2- Assume L1 is the > largest,

Re: Strange crash while running a script with a embedded python interpreter

2016-01-08 Thread Rickard Englund
On Friday, January 8, 2016 at 5:18:56 PM UTC+1, Rickard Englund wrote: > First, some system info > * Windows 7 (also tested on 8 and 10) > * Python 3.5.1 64bit (previously also tested using several 3.x versions) > (also tested with 32 bit, but with 3.4.2) > * Microsoft Visual Studio 2015 (earli

Strange crash while running a script with a embedded python interpreter

2016-01-08 Thread Rickard Englund
First, some system info * Windows 7 (also tested on 8 and 10) * Python 3.5.1 64bit (previously also tested using several 3.x versions) (also tested with 32 bit, but with 3.4.2) * Microsoft Visual Studio 2015 (earlier version of python also tested with Visual Studio 2013) We have tested with

Re: Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Chris Angelico
On Sat, Jan 9, 2016 at 3:07 AM, Steven D'Aprano wrote: > If you absolutely insist that you must must must continue to use a double > underscore name, you could also try this: > > py> __a = 1 > py> class Test: > ... def method(self): > ... x = eval("__a") > ... print(x)

Re: Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Steven D'Aprano
On Fri, 8 Jan 2016 03:14 am, Joseph Fox-Rabinovitz wrote: > Hi, > > I have a module attribute whose name starts with a pair of underscores. Don't do that. The way to flag a module-level variable as private is with a single leading underscore. Double-leading underscores are intended for use in c

Re: extract script from executable made by pyinstaller?

2016-01-08 Thread Oscar Benjamin
On 8 January 2016 at 07:44, Ulli Horlacher wrote: > Is it possible to extract (and view) the Python script from the Windows > executable which was made by pyinstller? I may be misremembering but I though that pyinstaller actually stores the main script uncompressed so that it's just in the raw .e

Re: graphs

2016-01-08 Thread Oscar Benjamin
On 7 January 2016 at 15:36, Saini, Sakshi wrote: > I have a complex dataset and I wish to write a code to create different > graphs from it. I was wondering if it is possible for Python/ matplotlib/ > seaborn to return a cumulative or mean distribution bar graph based on values > in your datas

debugging uwsgi

2016-01-08 Thread Robin Becker
I have an unusual bug in a large django project which has appeared when using nginx + uwsgi + django. The configuration nginx + flup + django or the django runserver don't seem to create the conditions for the error. Basically I am seeing an error Traceback (most recent call last): File "./pr

Re: PyFladesk :: create GUI apps by Python and HTML, CSS and Javascript.

2016-01-08 Thread Michael Torrie
On 01/07/2016 08:54 PM, jacob Kruger wrote: > I would definitely like to try out something like this - I am primarily > a web developer, and, partly since am 100% blind, any form of GUI design > is at times an issue for me, whereas I have been working with HTML > markup layouts for almost 20 yea

Re: Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Peter Otten
Joseph Fox-Rabinovitz wrote: > Hi, > > I have a module attribute whose name starts with a pair of underscores. I > am apparently unable to access it directly in a class method (within the > same module, but that is not relevant as far as I can tell). The following > bit of code illustrates the si

Re: How to remove item from heap efficiently?

2016-01-08 Thread Peter Otten
Sven R. Kunze wrote: > Hi everybody, > > suppose, I need items sorted by two criteria (say timestamp and > priority). For that purpose, I use two heaps (heapq module): > > heapA # items sorted by timestamp > heapB # items sorted by priority > > Now my actual problem. When popping an item of hea

Re: How to remove item from heap efficiently?

2016-01-08 Thread srinivas devaki
You can create a single heap with primary key as timestamp and secondary key as priority, i.e by creating a tuple insert the elements into the heap as (timestamp, priority) If there is any underlying meaning for creating 2 heaps. please mention. On Fri, Jan 8, 2016 at 4:22 AM, Sven R. Kunze wr

python 3.5.1 winsound bug

2016-01-08 Thread nick mcelwaine
Dear python team, On my 64bit windows10 the SND_ASYNC flag doesn’t cause the sound to play asynchronously. Nick McElwaine Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

graphs

2016-01-08 Thread Saini, Sakshi
I have a complex dataset and I wish to write a code to create different graphs from it. I was wondering if it is possible for Python/ matplotlib/ seaborn to return a cumulative or mean distribution bar graph based on values in your dataset? E.g. I have a certain volume in m3 for each rainfall e

How to remove item from heap efficiently?

2016-01-08 Thread Sven R. Kunze
Hi everybody, suppose, I need items sorted by two criteria (say timestamp and priority). For that purpose, I use two heaps (heapq module): heapA # items sorted by timestamp heapB # items sorted by priority Now my actual problem. When popping an item of heapA (that's the oldest item), I need

Re: Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Joseph Fox-Rabinovitz
> On Thu, Jan 7, 2016 at 11:14 AM, Joseph Fox-Rabinovitz > wrote: > > Hi, > > I have a module attribute whose name starts with a pair of underscores. I am > apparently unable to access it directly in a class method (within the same > module, but that is not relevant as far as I can tell). The f

Unable to access module attribute with underscores in class method, Python 3

2016-01-08 Thread Joseph Fox-Rabinovitz
Hi, I have a module attribute whose name starts with a pair of underscores. I am apparently unable to access it directly in a class method (within the same module, but that is not relevant as far as I can tell). The following bit of code illustrates the situation: __a = 3 class B: def __init_

Re: SUM only of positive numbers from array

2016-01-08 Thread Davorin Bajic
On Friday, January 8, 2016 at 5:13:06 AM UTC+1, Davorin Bajic wrote: > Hi All, > > I should help... > > I want to calculate the sum of a positive number, for each row: > > > x = ((mat_1 / s_1T)-(s_2 / total)) > y = (np.sum(x > 0, axis=1)).reshape(-1, 1).tolist() > > However, this part of the c

Schedule of PythonFOSDEM 2016

2016-01-08 Thread Stephane Wirtel
Hi all, Just to inform you that there is the PythonFOSDEM on 30th January and the PythonFOSDEM will have a room of 363 seats for the #python community. PythonFOSDEM is the name of the room for the Python community at FOSDEM. FOSDEM is a free event for software developers to meet, share ideas and

Re: (Execution) Termination bit, Alternation bit.

2016-01-08 Thread Skybuck Flying
Should be easy to turn that somewhat pseudo code into python code ! :) If it is so easy, why won't you do it? Not sure why, I use SikuliX and it's kinda buggy and slow, and I also had little time, it's also pretty trivial and I doubt you guys will have a solution that will actually work, so i

Re: extract script from executable made by pyinstaller?

2016-01-08 Thread Chris Angelico
On Fri, Jan 8, 2016 at 6:44 PM, Ulli Horlacher wrote: > Is it possible to extract (and view) the Python script from the Windows > executable which was made by pyinstller? To some extent, yes. You might only get the .pyc files, rather than the proper source code, but you should be able to get some

Re: SUM only of positive numbers from array

2016-01-08 Thread Peter Otten
Davorin Bajic wrote: > Hi All, > > I should help... > > I want to calculate the sum of a positive number, for each row: > > > x = ((mat_1 / s_1T)-(s_2 / total)) > y = (np.sum(x > 0, axis=1)).reshape(-1, 1).tolist() > > However, this part of the code only calculation count, I need sum. > > An