Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Nagy László Zsolt
  Hello, It depends on the operating system. For example on Ubuntu, the default python version is still 2.7. When you install both python2.7 and python3 on a system, then usually the "pip" will be a symlink to pip version 2 or 3. The default python interpreter can be different on different system

Re: Best way to (re)load test data in Mongo DB

2019-02-24 Thread Nagy László Zsolt
  Hello! We have a system where we have to create an exact copy of the original database for testing. The database size is over 800GB. We have found that using zfs snapshots and zfs clone is the best option. In order to do this, you have to enable journaling in mongodb. Then you can take a snap

XSD data mapper lib

2018-06-16 Thread Nagy László Zsolt
  Hello! I wonder what kind of XSD <-> Python class mapper should I use for my project. I need something that can generate classes from XSD files, and then parse XML to an objecttree and also dump object trees to XML. I'll be using Python version 3.6 and I would prefer to use something that is b

Re: requests / SSL blocks forever?

2018-01-16 Thread Nagy László Zsolt
>> Or maybe I misunderstood the docs and the timeout means the max. time >> elapsed between receiving two chunks of data from the server? > Yes. It's documented better here: > http://docs.python-requests.org/en/master/user/advanced/#timeouts > > You can't specify a "total time" within which the op

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> In other words: if the server starts to send the response, but then > stops sending it (without closing the connection), then this will block > forever anyway. Or maybe I misunderstood the docs and the timeout means the max. time elapsed between receiving two chunks of data from the server? --

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
> (a) are you setting daemon=True on the thread? > (b) are you setting a timeout on the requests call? Hmm setting the timeout might not be the solution. This is from the docs of the requests module: > > Note > > |timeout| is not a time limit on the entire response download; rather, > an exception

Re: requests / SSL blocks forever?

2018-01-15 Thread Nagy László Zsolt
2018. 01. 13. 15:03 keltezéssel, Jon Ribbens írta: > On 2018-01-13, Nagy László Zsolt wrote: >> I have a multi threaded Windows service written in Python. It is running >> on 3.6.2.  Sometimes I cannot stop the service, because on of the >> threads won't exit. I have

requests / SSL blocks forever?

2018-01-13 Thread Nagy László Zsolt
Hi! I have a multi threaded Windows service written in Python. It is running on 3.6.2.  Sometimes I cannot stop the service, because on of the threads won't exit. I have narrowed down the problem to request and _lib.SSL_read. I have used a modified version of this gem: http://code.activestate.com/

Re: xml: TypeError: write() got an unexpected keyword argument 'short_empty_elements'

2017-09-22 Thread Nagy László Zsolt
> https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.ElementTree.write > > The argument was added in Python 3.4. Presumably, lxml implemented the > API before this change. > > Maybe this would be considered a bug by lxml. Maybe it won't. Maybe it is not a bug, just

Re: xml: TypeError: write() got an unexpected keyword argument 'short_empty_elements'

2017-09-22 Thread Nagy László Zsolt
> Result: > > Traceback (most recent call last): >   File "C:/not_telling/c14n.py", line 16, in >     short_empty_elements=False >   File "lxml.etree.pyx", line 1869, in lxml.etree._ElementTree.write > (src\lxml\lxml.etree.c:57004) > TypeError: write() got an unexpected keyword argument 'short_em

xml: TypeError: write() got an unexpected keyword argument 'short_empty_elements'

2017-09-22 Thread Nagy László Zsolt
Here is an MWE: import io from lxml import etree test_node = etree.fromstring(''' http://schemas.xmlsoap.org/soap/envelope/"; xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512";>     ''') output = io.BytesIO(b'') test_node.getroottree().write(output, enc

Python 3.4.7 binaries for windows?

2017-08-09 Thread Nagy László Zsolt
Hi! On the official python site, it is possible to download python 3.4.4 here: https://www.python.org/downloads/release/python-344/ There are binary installation files for Windows. But Python 3.4.4 is two years old. There is 3.4.7 that was just released, but there are no binaries. https://www.

[SOLVED] Re: Firebird 1.5 and Python 3.4 - is this possible?

2017-08-09 Thread Nagy László Zsolt
To answer my own question: - You can convert a firebird 1.5 database into 2.5 with this tool: http://gsbelarus.com/gs/fdbconvert/fdbconvert_eng.html - You can install firebird 2.5 instead of 1.5. Old BDE based program will still work with it, because the Firebird 2.5 server can talk with a 1.5 c

Firebird 1.5 and Python 3.4 - is this possible?

2017-08-07 Thread Nagy László Zsolt
Hi! I have an old HIS program written in Delphi. It uses Firebird 1.5 database. I need to make an interface to exchange data with other healthcare providers. I do not want to do this in Delphi, that is ancient code. It is also not an option to rewrite the whole program from scratch. I just need

Re: Python not able to find package but it is installed

2017-05-30 Thread Nagy László Zsolt
Do you have /opt/rocks/lib/python2.6/site-packages on sys.path? Does your exread2.py file manipulate sys.path in any way? 2017. 05. 30. 10:18 keltezéssel, Mahmood Naderan via Python-list írta: > Hello, > Although I have installed a package via pip on a centos-6.6, python > interpreter still says

Re: zeep, infinite recursion

2017-05-30 Thread Nagy László Zsolt
> It was easier than I thought. It seems that zeep has a problem > processing a basic WS-Security STS (Security Token Service, plain > username+password authentication) document. I have changed the endpoint > URL to example.com. Total size 11K compressed. I hope it is okay to > attach here. It wa

Re: zeep, infinite recursion

2017-05-30 Thread Nagy László Zsolt
> There are less than 100 elements defined in the WSDL, so it cannot be > the problem. It might be a recursive data definition, but then it should > be handled by zeep instead of entering into an intinite recursion. > > Well, I'll be working on an MWE and post it here later. It was easier than I t

Re: zeep, infinite recursion

2017-05-30 Thread Nagy László Zsolt
>> line 259, in signature >> from zeep.xsd import ComplexType >> RecursionError: maximum recursion depth exceeded >> >> Looks like an infinite recursion to me. Due to a non-disclosure >> agreement, I'm not able to send you the example wsdl. > So you tell us it's just restin' under an NDA. Ye

zeep, infinite recursion

2017-05-29 Thread Nagy László Zsolt
Running this command: python3.6 -m zeep exmaple.wsdl I get this (this is only the end of the traceback): part = element.signature(schema, standalone=False) File "/usr/local/lib/python3.6/dist-packages/zeep/xsd/elements/indicators.py", line 252, in signature parts.append(element.signat

Re: SOAP/wsse lib on Windows

2017-05-17 Thread Nagy László Zsolt
>> Yes, it is listed under the "Other useful packages and applications not >> currently available on this page" section. Its home page ( >> https://github.com/mehcode/python-xmlsec ) does not tell how to install >> it on windows. > *facepalm* Sorry about that. I just automatically went to the page

Re: SOAP/wsse lib on Windows

2017-05-17 Thread Nagy László Zsolt
>> So is there a way to do this? I would prefer a cross platform solution, >> but I'll do whatever it takes. > You might be in luck: xmlsec appears to be in this list: > > http://www.lfd.uci.edu/~gohlke/pythonlibs/ > > I don't know anything about it, though, so you'll have to try it and see. Yes,

SOAP/wsse lib on Windows

2017-05-17 Thread Nagy László Zsolt
Is there a library that handles SOAP and wsee (with x509 signed requests) on Windows platform? I went through a few. Suds is not supported anymore. py-wsee depends on libxml2 that has no windows port. zeep is great, except that x509 cannot be used unless xmlsec library is installed. I could not b

Re: concurrent futures, async futures and await

2017-02-26 Thread Nagy László Zsolt
>> >> Simply because the concurrent future returned by executor.submit does >> not implement __await__ and so it cannot be awaited for. > I get that, but what happens if you try wrapping the executor.submit > call with tornado.gen.convert_yielded as the tornado docs suggest and > as I suggested a

Re: concurrent futures, async futures and await

2017-02-23 Thread Nagy László Zsolt
> My guess: because asyncio wouldn't know what to do with a > concurrent.futures.Future. I see that as a problem. > > The tornado docs say that "You can also use > tornado.gen.convert_yielded to convert anything that would work with > yield into a form that will work with await": > http://www.torn

concurrent futures, async futures and await

2017-02-22 Thread Nagy László Zsolt
I'm in a situation where I would like to refactor some code to use native coroutine functions (aync def) instead of "normal" coroutines that use yield. Most of the code is asnyc, but some of the operations are performed in different threads (using concurrent.futures.Executor). We have concurrent.

Re: Python 3.5 amd64 and win32service

2016-10-06 Thread Nagy László Zsolt
>> "C:\Users\Laci\AppData\Local\Programs\Python\Python35\lib\site-packages\win32\PythonService.exe" > I wanted you to run the above executable, not python.exe. If it fails > you'll get more information about why it's failing when run directly > then when the service controller runs it. Since you'r

Re: Python 3.5 amd64 and win32service

2016-10-05 Thread Nagy László Zsolt
> > The MWE I provided is so simple. By now, It should be obvious what is > missing from it. :-( > > The problem is NOT with my code. I just installed a new virtual machine, and installed python3.5 amd64 + pypiwin32 on it. On that machine, the test service works perfectly! So it is with my machin

Re: Python 3.5 amd64 and win32service

2016-10-05 Thread Nagy László Zsolt
> On Wed, Oct 5, 2016 at 7:43 AM, Nagy László Zsolt > wrote: >> It did not help. I still get the same error message (service did not >> respond in time). > Can you run the service executable directly? From the command line > check `sc qc TestService`. Run the BINARY_P

Re: Python 3.5 amd64 and win32service

2016-10-05 Thread Nagy László Zsolt
>> But again, that is not related to the question. Why does it not work? >> What is missing? > If you mean why running the service doesn't work, it should once you > run the post-install script that copies pywintypes35.dll to the > Windows System32 directory. This DLL is required by PythonService.

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread Nagy László Zsolt
>> def main(self): >> self.ReportServiceStatus(win32service.SERVICE_RUNNING) >> while not self.stop_requested.is_set(): >> time.sleep(1) # So something useful here > Why don't you use the Windows Event (hWaitStop) with > WaitForSingleObject instead of an additional

Re: Python 3.5 amd64 and win32service

2016-10-04 Thread Nagy László Zsolt
>> Is it possible to write a win32 service with 64 bit python 3.5? The >> pywin32 package does exist on 3.5 64bit, but missing some modules: > Try pip installing the "pypiwin32" package. That worked, thanks. Do you have an explanation why to official build ( https://sourceforge.net/projects/pywi

Python 3.5 amd64 and win32service

2016-10-03 Thread Nagy László Zsolt
Hello, Is it possible to write a win32 service with 64 bit python 3.5? The pywin32 package does exist on 3.5 64bit, but missing some modules: >>> import win32service Traceback (most recent call last): File "", line 1, in ImportError: DLL load failed:The specified module could not be found.

Re: How to make a copy of chained dicts effectively and nicely?

2016-09-29 Thread Nagy László Zsolt
On Wed, Sep 28, 2016 at 12:54 AM, Jussi Piitulainen > wrote: >> I wasn't sure if it makes a copy or just returns the dict. But it's >> true: help(dict) says dict(mapping) is a "new dictionary initialized >> from a mapping object's (key, value) pairs". > Yep. With mutable objects, Python's docs ar

How to make a copy of chained dicts effectively and nicely?

2016-09-27 Thread Nagy László Zsolt
The result that I need should be a real dict, not just a ChainMap. (It is because I have to mutate it.) d1 = {'a':1, 'b':2} d2 = {'c':3, 'd':4} d3 = {'e':5, 'f':6} #1. My first naive approach was: from collections import ChainMap d = {} for key,value in ChainMap(d1, d2, d3).items(): d[key]

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
> Yes, the get part works. The set part is a pain, and a bit ugly: > > super(B, B).foo.__set__(self, value) > > There is an issue for this on the tracker: > http://bugs.python.org/issue14965 > Thank you Ethan! The superprop pure Python implementation is very promising. ( http://bugs.python.or

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
Yes, I believe it does. (Others may disagree. This is a design question and very much a matter of style, not hard fact.) I would have an explicit action "set_content" which will set the value of an input field, the inner text of a textarea, the checked state of a check box, etc. In other words,

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
> Even the problem seems to rather defeat the purpose of a property. A > property should be very simple - why do you need to override it and > call super()? Doesn't this rather imply that you've gone beyond the > normal use of properties *already*? Here are some of my classes that can represent da

Re: Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
> Even the problem seems to rather defeat the purpose of a property. A > property should be very simple - why do you need to override it and > call super()? Doesn't this rather imply that you've gone beyond the > normal use of properties *already*? I'm not sure about that. I'm going to send a USE

Re: Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
By the way, I know that I can use a "property virtualizer", something like this: import inspect class A: def __init__(self, prop=0): self.__prop = prop def _prop_get(self): return self.__prop def _prop_set(self, value): self.prop_set(value)

Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
Example code: class A: def __init__(self, prop=0): self.__prop = prop @property def prop(self): return self.__prop @prop.setter def prop(self, value): self.__prop = value class B(A): @A.prop.setter def prop(self, value): print

datetime, time zone and xs:datetime

2016-08-26 Thread Nagy László Zsolt
Hello, I'm having problems finding the "preferrably one" way to convert a datetime instance into an xs:datetime string. Here is an example datetime instance with is format: dt = datetime.now() print(dt.isoformat()) # prints "2016-08-26 12:41:13.426081+02:00" print(dt.strftime('%Y-%m-%dT%H:%M:

Re: Can math.atan2 return INF?

2016-06-27 Thread Nagy László Zsolt
> Thanks, I'm in the same position as you, except that I'm in the position > where I need it use the result, and if it ever returns INF my function will > blow up. But it doesn't look like that can happen. > Doesn't atan2 relies on the C lib math floating point library? At least in CPython. I thin

Re: Which one is the best JSON parser?

2016-06-27 Thread Nagy László Zsolt
On 2016-06-23, MRAB wrote: >> On 2016-06-23 21:58, David Shi via Python-list wrote: >>> Can any one tell me? >>> Regards. >>> David >>> >> There's one in the standard library. > Which has always worked fine for me... Which always reminds me: >>> import json >>> d = {0:1, False:2} >>> d {0: 2} >>>

python 3 + milter

2016-06-16 Thread Nagy László Zsolt
Does anyone know a module that can be used to write a before-queue, smtpd time milter with Python 3? Unfortunately, pymilter does not work with Python 3: Downloading https://pypi.python.org/packages/58/2f/d4799c9cade461177955ca19ade6ca55385286f066c0db9a0770a332ab8a/pymilter-1.0.tar.gz#md5=ec9b95f

Re: UserList - which methods needs to be overriden?

2016-06-10 Thread Nagy László Zsolt
2016.06.10. 0:38 keltezéssel, Michael Selik írta: > On Thu, Jun 9, 2016 at 5:07 AM Nagy László Zsolt <mailto:gand...@shopzeus.com>> wrote: > > I would like to create a collections.UserList subclass that can notify > others when the list is mutated. > > > Wh

Re: UserList - which methods needs to be overriden?

2016-06-09 Thread Nagy László Zsolt
> [Looks like you made progress while I struggled to come up with the > following. I'll post it anyway.] Your version is much better. Thanks! :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: UserList - which methods needs to be overriden?

2016-06-09 Thread Nagy László Zsolt
> @wrap_notify('remove', 'clear', 'append', 'insert', 'sort'): > class ObservableList(ObservableCollection, list): > pass > > I just can't find out the right syntax. > > All right, this is working. from contextlib import contextmanager class ObservableCollection: @contextmanager def

Re: UserList - which methods needs to be overriden?

2016-06-09 Thread Nagy László Zsolt
> Using the built-in list or dict is problematic because sometimes the > subclass methods are ignored when the internal data is accessed (sorry, I > don't have an example). Are you suggesting that I should use UserList and UserDict instead of list and dict? What is the truth? Was UserDict left i

Re: UserList - which methods needs to be overriden?

2016-06-09 Thread Nagy László Zsolt
>> Is there a way to easily find out which methods of are mutating the >> collection? Other than going over the source and checking all (normal >> and inherited) methods? > How about > > set(dir(collections.UserList)) - set(dir(collections.Sequence)) Thanks. It narrows down the list of possible me

Re: what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
>> Yes, and more. That property will also have a get method! Is it >> intentional? > It's a logical effect of how the setter() method works. The above is > syntactic sugar for > > def set_parent(...): >... > set_parent = parent.setter(set_parent) > > and parent.setter() creates a new property

UserList - which methods needs to be overriden?

2016-06-09 Thread Nagy László Zsolt
Hi, I would like to create a collections.UserList subclass that can notify others when the list is mutated. I'm not sure which methods I need to override. I have checked the sources, and it seems difficult to figure out which methods needs to be overriden. For example, MutableSequence.extend i

Re: what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
>> @parent.setter >> def set_parent(self, new_parent): >> self._parent = new_parent > This creates a settable property with the name "set_parent" and leaves the > read-only property "parent" alone. Yes, and more. That property will also have a get method! Is it intentional? -- h

what is wrong with this property setter

2016-06-09 Thread Nagy László Zsolt
class Test: def __init__(self): self._parent = None @property def parent(self): return self._parent @parent.setter def set_parent(self, new_parent): self._parent = new_parent p, c = Test(), Test() c.parent = p >py -3 test.py Traceback (most recent c

Re: Recursive type annotations

2016-06-08 Thread Nagy László Zsolt
>> pass >> >> NameError: name 'Test' is not defined > I think you can fix this by using a string annotation as follows: > > class Test: > def test(self, child: "Test"): > pass Yes, you are right. It is not directly written in the official documentation ( https://doc

Recursive type annotations

2016-06-08 Thread Nagy László Zsolt
class Test: def test(self, child : Test): pass NameError: name 'Test' is not defined I understand that the class "Test" is not defined until the class definition is executed. But it is very very common to build recursive data structures, and I have concrete use case where the IDE did

Re: Multiple inheritance, super() and changing signature

2016-06-04 Thread Nagy László Zsolt
> > Things to know about super: > Part 1 http://www.artima.com/weblogs/viewpost.jsp?thread=236275 > Part 2 http://www.artima.com/weblogs/viewpost.jsp?thread=236278 > Part 3 http://www.artima.com/weblogs/viewpost.jsp?thread=237121 > > The wonders of super: > http://www.artima.com/weblogs/viewpost.j

Re: I'm wrong or Will we fix the ducks limp?

2016-06-03 Thread Nagy László Zsolt
def getsMeet(files=file_list): """Get a File or List of Files. From the list of files determine what meetings exist and prepare them to be parsed """ pyqFiles = [] for filename in sorted(file_list): pyqFiles = pyqFiles.append(pq(filename=my_dir + file

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Nagy László Zsolt
Is the problem that the attribute or parameter has the same name in both base classes, but has different meanings in each? If they had different meanings, a simple rename would solve the problem. They have the same meaning. If you can't change the base classes, I've got some other solutions,

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Nagy László Zsolt
>> That's overly strict. As Raymond shows, it is easy to deal with >> changing method signatures in *cooperative* classes. > I must watch that for sure. All right, I have read this: https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ There is still something I don't get: how to

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Nagy László Zsolt
>> But I have to initialize some default attributes. > Then the statement “there is NOTHING else here” must be false. Either > the custom ‘__init__’ does something useful, or it doesn't. Well... the custom __init__ method with nothing else just a super() call was expressed there to show the super

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Nagy László Zsolt
> Raymond Hettinger gives an excellent presentation where he describes various > problems with MI and gives solutions for them. I think this might be it: > > http://pyvideo.org/video/1094/the-art-of-subclassing-0 This is a much better version from one year later: https://www.youtube.com/watch?v=m

Re: Multiple inheritance, super() and changing signature

2016-06-03 Thread Nagy László Zsolt
> > In Python 3, that will be automatic and you don't need to worry about it. I'm using Python 3. I'm aware of old style and new style classes in Python 2. > > > [...] >> class BootstrapDesktop(BootstrapWidget, BaseDesktop): >> def __init__(self, appserver, session): >> # there is NOT

Multiple inheritance, super() and changing signature

2016-05-31 Thread Nagy László Zsolt
Today I come across this problem for the N+1st time. Here are some classes for the example: class Observable: """Implements the observer-observable pattern.""" def __init__(self): # initialization code here... super(Observable, self).__init__() class AppServerSessionMixi

Re: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
> Sorry to be late to the party--I applaud that you have already > crafted something to attack your problem. When you first posted, > there was a library that was tickling my memory, but I could not > remember its (simple) name. It occurred to me this morning, after > you posted your new lib

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
>> How about creating two classes for this? One that supports zero sized >> intervals, and another that doesn't? > If you don't want zero sized intervals, just don't put any in it. You > don't have a separate list type to support even integers vs one that > supports all floats. What operations are

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
>> It is blurred by design. There is an interpretation where an interval >> between [0..4] equals to a set of intervals ([0..2],[2..4]). > No, because 2.5 is in one and not the other. My notation was: 0..4 for any number between 0 and 4. And 2..4 for any number between 2 and 4. So yes, 2.5 is in

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Nagy László Zsolt
> Yes, my question is why it's useful to have a single Interval as a > *distinct* type, separate from the interval set type, which supports a > sharply limited number of set-like operations (such as the union of two > overlapping intervals but NOT two non-overlapping ones). This doesn't > appear t

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> I don't know if I like it being immutable. Maybe have separate mutable > and immutable versions. The reason for making it immutable is implementation specific. These intervals are stored in an ordered list. Overlapping intervals are unified by the constructor. This makes sure that sets with equa

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> Why do you limit the intervals to datetime? Are there any assumptions in > your code that would make it fail with int values? It has been generalized. Now it can be used with any immutable ordered type. :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> Why do you limit the intervals to datetime? Are there any assumptions in > your code that would make it fail with int values? Just one. The empty interval is a singleton and I want it to be smaller than any other interval. UTC_ZERO = datetime.datetime.utcfromtimestamp(0) EMPTY_INTERVAL = Inte

Re: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
>> element ::= (start_point_in_time, end_point_in_time) >> intervalset ::= { element1, element2, } >> >> Operations on elements: > > Eh... I think these should be realized as operations on an intervalset > with a single element, and that elements should simply have properties > like the start

Re: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
> > On Fri, Apr 1, 2016 at 1:32 AM Nagy László Zsolt <mailto:gand...@shopzeus.com>> wrote: > > Does anyone know a library that already implements these functions? > > > What do you not like about the ones on PyPI? > https://pypi.python.org/pypi?%3Aaction=s

ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Nagy László Zsolt
Hi All, If anyone is interested, a module was born: https://bitbucket.org/nagylzs/intervalset https://pypi.python.org/pypi/intervalset/0.1.1 I have some unit tests, but testers and comments are welcome. Also see below. >> >> Hello, >> >> I need to compare sets of datetime intervals, and

Set type for datetime intervals

2016-03-31 Thread Nagy László Zsolt
Hello, I need to compare sets of datetime intervals, and make set operations on them: intersect, union, difference etc. One element of a set would be an interval like this: element ::= (start_point_in_time, end_point_in_time) intervalset ::= { element1, element2, } Operations on element

Re: asyncmongo + python 3: No module named 'errors'

2016-02-25 Thread Nagy László Zsolt
> Yes. > I recommend you to use motor [1]. > > > * [1] https://github.com/mongodb/motor Thanks. I have checked motor, and here are some problems with it: * I cannot install it with "pip3 install motor", because it is trying to downgrade (!!!) pymongo to version 2.8, but it fails to do so. There m

asyncmongo + python 3: No module named 'errors'

2016-02-25 Thread Nagy László Zsolt
ayncmongo requirements are "pymongo" and "tornado". I have a fresh installation of Python 3.5, pymongo 3.2 and tornado 4.3, but I cannot import asyncmongo. Tracelog below. P:\WinPython-64bit-3.5.1.2\python-3.5.1.amd64>python Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900

Re: asyncmongo + python 3: No module named 'errors'

2016-02-25 Thread Nagy László Zsolt
2016.02.25. 9:08 keltezéssel, Nagy László Zsolt írta: > ayncmongo requirements are "pymongo" and "tornado". > > I have a fresh installation of Python 3.5, pymongo 3.2 and tornado 4.3, > but I cannot import asyncmongo. This seems to be the exact same bug r

timedelta and float multiplication in python 2

2016-02-11 Thread Nagy László Zsolt
I ran into a problem today where I had to determine the mean point between two datetimes. Here is an example: >>> start = datetime.datetime(2016,2,11) >>> stop = datetime.datetime.now() >>> mean = start + (stop-start)*0.5 Traceback (most recent call last): File "", line 1, in TypeError: unsuppo

Re: variable vs. object

2015-11-30 Thread Nagy László Zsolt
> a=10 > > 'a' is an integer. Is it an object too? In Python, objects have an identity. When you do "a=10" then you *bind* the object to the name *a*. By "variable", the documentation refers to a name that was bound to an object. This is different from many other low level languages. For example:

Re: ANN: tornadostreamform

2015-11-26 Thread Nagy László Zsolt
> PyPi: https://pypi.python.org/pypi/tornadostreamform > Documentation: https://pypi.python.org/pypi/tornadostreamform Wrong paste. Here is the good one: https://pythonhosted.org/tornadostreamform/ -- https://mail.python.org/mailman/listinfo/python-list

ANN: tornadostreamform

2015-11-26 Thread Nagy László Zsolt
Pure python module that let’s you upload *huge* files to a tornado web server. This project provides the |tornadostreamform.multipart_streamer.MultiPartStreamer| class that incrementally parses incoming multipart/form-data, splits it into form fields, and streams the fields into file like objects

ANN: yubistorm

2015-11-22 Thread Nagy László Zsolt
YubiStorm provides a simple module that can be used from a Tornado server to authenticate users with YubiCloud authentication servers. The PyPi package contains the module for the API only. The repository contains an example web server that can be used to understand how YubiCloud authentication

Re: How To Create A Endles List Of Lists In Python...???

2015-11-20 Thread Nagy László Zsolt
> Sorry For Bad Question, But I need List Of Lists That I Can > Acces Horyzontaly, Not In The Deep(But This IS Not All, > I End That Evey List In List Of Lists Can Be A List... It is not possible to do it with a native list. But you can write your own iterable that can be iterated forever, and ind

Re: Is there an meaning of '[[]]' in a list?

2015-11-19 Thread Nagy László Zsolt
> I have question: Is there any difference between [[]] and []? Yes. [] - a list with zero elements. That is an empty list. [[]] - A list with one element. (That element is an empty list.) > [[]] can have deeper assignment and use than You can have it as deep as you want, if you have enough mem

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-18 Thread Nagy László Zsolt
> Perhaps there is a size threshold? You could experiment with different block > sizes in the following f.read() replacement: > > def read_chunked(f, size=2**20): > read = functools.partial(f.read, size) > return "".join(iter(read, "")) > Under win32 platform, my experience is that the fa

Re: Trouble installing Python 3.5.0

2015-11-17 Thread Nagy László Zsolt
>> Hello, >> >> I installed 3.5, "successfully" as the installer indicated, yet the program >> wouldn't run, with the following error message: "...failed to start because >> api-ms-win-crt-runtime-I1-1-0.dll was not found. Re-installing the >> application may fix this problem." I reinstalled, b

Re: Trouble installing Python 3.5.0

2015-11-17 Thread Nagy László Zsolt
> Hello, > > I installed 3.5, "successfully" as the installer indicated, yet the program > wouldn't run, with the following error message: "...failed to start because > api-ms-win-crt-runtime-I1-1-0.dll was not found. Re-installing the > application may fix this problem." I reinstalled, but no

pybabel: default locale is None ???

2015-11-17 Thread Nagy László Zsolt
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 >>> from datetime import timedelta >>> from babel.dates import format_timedelta >>> td = timedelta(seconds=39.28355172422679) >>> format_timedelta(td) Traceback (most recent call last): File "", line 1,

Re: pycrypto

2015-11-04 Thread Nagy László Zsolt
Can u give me a suited solution that simply works for me? > http://stackoverflow.com/questions/11405549/how-do-i-install-pycrypto-on-windows Voidspace only has Python 3.3. They are usually behind some minor versions. The only good way to do this is to compile it from sources. Unfortunately, not

Re: LU decomposition

2015-11-04 Thread Nagy László Zsolt
> Hey, > > I have to write a LU-decomposition. My Code worked so far but (I want to > become better:) ) I want to ask you, if I could write this LU-decomposition > in a better way? Why can't you just use scipy for this? http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.linalg.lu.

pybabel extraction mess

2015-11-03 Thread Nagy László Zsolt
If I have a large project with multiple directories, then I may want to assign different translation domains for different subpackages. Suppose I have this directory structure: main | |--- sub1 | |--- sub2 | | sub2.1 | | sub2.2

Re: How to implement an async message bus

2015-10-29 Thread Nagy László Zsolt
try: return await waiter finally: # TODO: Use a context manager to add and remove the keys. for key in keys: self._waiters[key].discard(waiter) if handle: handle.cancel() def notify(s

ANN: orcastorm

2015-10-26 Thread Nagy László Zsolt
OrcaStorm provides a simple module that can be used from a Tornado server to authenticate users with SaasPass (www.saaspass.com) two-factor authentication. This is a pre-release, it can only be used with tornado version 4.3. That version is still beta, but that is the only version that supports as

ANN: clefstorm

2015-10-26 Thread Nagy László Zsolt
ClefSform provides a simple module that can be used from a Tornado server to authenticate users with Clef (www.getclef.com) two-factor authentication. This is a pre-release, it can only be used with tornado version 4.3. That version is still beta, but that is the only version that supports async d

Re: PyPi bug?

2015-10-22 Thread Nagy László Zsolt
> > Could be http://bugs.python.org/issue20120 ? Almost. Except that the password was saved incorrectly by distutils itself. So maybe the read part should not be fixed, but the write part should. -- https://mail.python.org/mailman/listinfo/python-list

PyPi bug?

2015-10-21 Thread Nagy László Zsolt
Today I have tried to register and upload a new package by executing setup.py register I was asked if I want to save the creditentials in a .pypirc file and I answered yes. Next I wanted to run setup.py upload and I got this error: Traceback (most recent call last): File "C:\Python\Projec

Re: What does it mean for Python to have “constants”?

2015-10-20 Thread Nagy László Zsolt
Dennis Lee Bieber writes: >> (Python does not have anything that one might consider a true constant >> -- other than the language defined singletons: None, and maybe by now >> True and False). > Python now deals with those by making the names keywords:: > > >>> True = object() > File ""

Re: variable scope of class objects

2015-10-19 Thread Nagy László Zsolt
> These two statements make me think you come from C++ or something > similar. > > In Python you can declare variables at class level, but this > declaration must NOT be interpreted in the same manner of a similar > declaration in C++: they remain at the abstract level of a class, and > they have

Re: variable scope of class objects

2015-10-19 Thread Nagy László Zsolt
> My questions are: > What is the scope of class variables? In Python, you bind values (objects) to names. It is conceptually different from "setting the value of a variable". In Python, scope applies to names, not variables. When you say "class variable", what do you mean? This may help: A nam

Re: variable scope of class objects

2015-10-19 Thread Nagy László Zsolt
> > #!/usr/bin/python > # -- developed using Python 2.7.3 > > class BME280: Not strictly related to the question, but you probably want to use so called "new style classes" when developing a new program for Python version 2. In other words, use: class BME280(object): instead of class BME280:

  1   2   3   4   5   6   7   8   9   >