Pyitect - Plugin architectural system for Python 3.0+ (feedback?)

2015-06-08 Thread Ben Powers
As importlib has been added in python 3 and up I decided to use it's abilities to create a plugin system for truly modular development in python. Pyitect has the ability to drop in components and resolve dependencies. Even load different versions of a dependency if two different libraries require

Re: Parser needed.

2015-06-08 Thread Skybuck Flying
I made it way too difficult on myself with that stupid dictionary bs... What I really wanted was to know if the ref was already in the reflist. Turns out python has a really nice simple operation for that: if not (Ref in EntityRef): EntityRef.append(Ref) DONE ! =D No need for dictionary.

Re: Parser needed.

2015-06-08 Thread Skybuck Flying
Oh I think I forgot to mention... parser is now getting close to 1 second... with tokenizer and such. But I think this is still within acceptable performance level for now. Bye, Skybuck. -- https://mail.python.org/mailman/listinfo/python-list

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Mark Lawrence
On 08/06/2015 21:05, Steven K Knight wrote: June 8 2015 3:11 PM, "Skip Montanaro" mailto:%22Skip%20Montanaro%22%20>> wrote: I have so far ignored the new string formatting (you know, the stuff with all the braces, dots and brackets that make Python strings look like Perl code ). I

Re: Python Random vs. Cython C Rand for Dice Rolls

2015-06-08 Thread Sturla Molden
On 08/06/15 19:33, Laura Creighton wrote: Better C random number generator. http://www.pcg-random.org/download.html Or for something less minimalistic, just grab randomkit.c and randomkit.h from NumPy, which implements the same Mersenne Twister as Python. That is what I usually do to get fas

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread random832
On Mon, Jun 8, 2015, at 16:32, Skip Montanaro wrote: > This is counterintuitive: > > >>> "{:.3}".format(-0.00666762259822) > '-0.00667' > >>> "{:.3f}".format(-0.00666762259822) > '-0.007' > >>> "%.3f" % -0.00666762259822 > '-0.007' > >>> "{:.3s}".format(-0.00666762259822) > ValueError Unknown form

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Serhiy Storchaka
On 08.06.15 23:32, Skip Montanaro wrote: This is counterintuitive: >>> "{:.3}".format(-0.00666762259822) '-0.00667' >>> "{:.3f}".format(-0.00666762259822) '-0.007' >>> "%.3f" % -0.00666762259822 '-0.007' >>> "{:.3s}".format(-0.00666762259822) ValueError Unknown format code 's' for object of

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Yann Kaiser
It just means significant digits in the general format, which alternates between 10-exponent notation and plain decimal notation. https://docs.python.org/3.4/library/string.html#format-specification-mini-language >>> '{:.3}'.format(0.356785) '3.57e-05' >>> '{:.3}'.format(0.0035678

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Skip Montanaro
This is counterintuitive: >>> "{:.3}".format(-0.00666762259822) '-0.00667' >>> "{:.3f}".format(-0.00666762259822) '-0.007' >>> "%.3f" % -0.00666762259822 '-0.007' >>> "{:.3s}".format(-0.00666762259822) ValueError Unknown format code 's' for object of type 'float' Why does the first form display f

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Steven K Knight
June 8 2015 3:11 PM, "Skip Montanaro" wrote: I have so far ignored the new string formatting (you know, the stuff with all the braces, dots and brackets that make Python strings look like Perl code ). I am still only using Python 2.7, but have recently started forcing myself to use the

Re: Cheat sheet for the new string formatting?

2015-06-08 Thread Skip Montanaro
On Mon, Jun 8, 2015 at 3:05 PM, Steven K Knight wrote: > I think http://pyformat.info/ is what you're looking for. Perfect, thanks! S -- https://mail.python.org/mailman/listinfo/python-list

Cheat sheet for the new string formatting?

2015-06-08 Thread Skip Montanaro
I have so far ignored the new string formatting (you know, the stuff with all the braces, dots and brackets that make Python strings look like Perl code ). I am still only using Python 2.7, but have recently started forcing myself to use the print() function. I figure maybe I should also start to c

Re: Detect if specific Python.app instance is already running

2015-06-08 Thread Laura Creighton
I needed to do something like this once. What I needed was a way to send a process a signal, and have it then spit out a huge amount of stats about how long it had been running, how many page faults it had suffered, and, goodness, I forget all the information that was needed. Lots. So I just wra

Re: Python Random vs. Cython C Rand for Dice Rolls

2015-06-08 Thread Laura Creighton
Better C random number generator. http://www.pcg-random.org/download.html Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Using ssl module over custom sockets

2015-06-08 Thread Johannes Bauer
On 08.06.2015 09:22, jbauer.use...@gmail.com wrote: > Something that I could always use as a workaround would be to open up a > listening port locally in one thread and connection to that local port in a > different thread, then forward packets. But that's pretty ugly and I'd like > to avoid it

Re: Rule of order for dot operators?

2015-06-08 Thread Steven D'Aprano
On Mon, 8 Jun 2015 09:21 pm, Albert van der Horst wrote: > Why is "slug.title" a valid decomposition of the total string> > (Or is it?) I'm afraid I don't understand the question. > What is the ()-brackets doing? Does it force the execution of title, > which gives something to be dotted onto s

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-08 Thread felix
El 07/06/15 12:20, Rustom Mody escribió: On Saturday, June 6, 2015 at 10:20:49 AM UTC+5:30, Steven D'Aprano wrote: On Sat, 6 Jun 2015 01:20 pm, Rustom Mody wrote: On Saturday, June 6, 2015 at 3:30:23 AM UTC+5:30, Chris Angelico wrote: Congrats! You just proved that an object can itself be imm

Re: Rule of order for dot operators?

2015-06-08 Thread Albert van der Horst
In article , Cameron Simpson wrote: >On 16May2015 12:20, C.D. Reimer wrote: >>title = slug.replace('-',' ').title() >>This line also works if I switched the dot operators around. >>title = slug.title().replace('-',' ') >> >>I'm reading the first example as character replacement first and title >

Re: Detect if specific Python.app instance is already running

2015-06-08 Thread Andrei
On Monday, June 8, 2015 at 1:08:07 AM UTC+2, Ned Deily wrote: > In article <11e093d5-b78e-4ac6-9a7f-649cb2c2c...@googlegroups.com>, > Andrei wrote: > > Alright, I have had some development in > > http://stackoverflow.com/questions/30694560/detect-if-specific-python-app-inst > > ance-is-already-ru

Memory Error while using pandas dataframe

2015-06-08 Thread narencr7
Memory Error while working with pandas dataframe. Description of Environment Windows 7 python 3.4.2 32-bit version pandas 0.16.0 We are running into the error described below. Any help provided will be sincerely appreciated. We are able to read a 300MB Csv file into a dataframe using the read_c

Re: Testing random

2015-06-08 Thread Jussi Piitulainen
Thomas 'PointedEars' Lahn writes: > Jussi Piitulainen wrote: >> Thomas 'PointedEars' Lahn writes: >> >>> 8 3 6 3 1 2 6 8 2 1 6. >> >> There are more than four hundred thousand ways to get those numbers >> in some order. >> >> (11! / 2! / 2! / 2! / 3! / 2! = 415800) > > Fallacy. Order is irrele

Re: Python Random vs. Cython C Rand for Dice Rolls

2015-06-08 Thread Jeremy Sanders
C.D. Reimer wrote: > Is there something in the Cython code that I need to change and/or find > a better C random number generator? This may not be helpful, but numpy is pretty helpful for this sort of thing: import numpy import numpy.random a=numpy.random.randint(1,6,5000) b=numpy.random.ra

Memory error while using pandas dataframe

2015-06-08 Thread naren
Memory Error while working with pandas dataframe. Description of Environment Windows 7 python 3.4.2 32-bit version pandas 0.16.0 We are running into the error described below. Any help provided will be sincerely appreciated. We are able to read a 300MB Csv file into a dataframe using the read_cs

Using ssl module over custom sockets

2015-06-08 Thread jbauer . usenet
Hi group, is it possible to use the ssl module using a custom transport? It appears to me as if currently the relationship between ssl.SSLSocket() and socket.socket() is pretty entangled. Suppose I do have some kind of reliable transport (let's say RS232) and a connection that I have wrapped i

Please, rate the project

2015-06-08 Thread Yurij Alexandrovich
EnvTransfer - transfer your environment between computers using Yandex disk. https://github.com/deslum/envtransfer -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to show time to execute another function

2015-06-08 Thread Cecil Westerhof
On Monday 8 Jun 2015 07:04 CEST, Johannes Bauer wrote: > On 07.06.2015 22:35, Cecil Westerhof wrote: > >>> And you also posted your solution. I fail to find any question in >>> your original posting at all. >> >> That is because there was no question: I just wanted to share >> something I thought