Re: "help( pi )"

2017-11-18 Thread Cameron Simpson
On 19Nov2017 11:49, Greg Ewing wrote: Cameron Simpson wrote: one could change implementations such that applying a docstring to an object _removed_ it from the magic-shared-singleton pool, Is there any need to bother? If another float happened to end up with exactly the same value as pi and g

Constants In Python (Posting On Python-List Prohibited)

2017-11-18 Thread Lawrence D’Oliveiro
Every (unqualified) name in Python is a variable. Which means its value can be changed. If you want something that has a value that cannot be changed, you have to make it an attribute of an object. For example, enums work this way. You could define an enum for constants, but enums are nominally

Re: "help( pi )"

2017-11-18 Thread Gregory Ewing
Cameron Simpson wrote: one could change implementations such that applying a docstring to an object _removed_ it from the magic-shared-singleton pool, Is there any need to bother? If another float happened to end up with exactly the same value as pi and got merged with it, the docstring wouldn'

Re: ctypes help

2017-11-18 Thread Python
Eryk, Thanks much for the excellent and highly detailed response! That made a lot of things clear. On Sat, Nov 18, 2017 at 10:56:27AM +, eryk sun wrote: > On Fri, Nov 17, 2017 at 10:11 PM, Python wrote: > > > > I'm starting to play with ctypes, as I'd like to provide Python > > interfaces

Re: Time travel - how to simplify?

2017-11-18 Thread Peter Otten
Andrew Z wrote: > well, yeah, it's unidirectional and final destination is always the same > and have little to do with the question. > > Say, i have a dict: > > fut_suffix ={ 1 : 'F', > 2 : 'G', > 3 : 'H', > 4 : 'J', > 5 : 'K', >

Re: Time travel - how to simplify?

2017-11-18 Thread Andrew Z
Thank you for your input, gentlemen. I'm thinking about the following approach: import datetime from dateutil import relativedelta fut_suffix ={ 1 : 'F', 2 : 'G', 3 : 'H', 4 : 'J', 5 : 'K', 6 : 'M', 7 : 'N',

Re: for/ if against dict - one liner

2017-11-18 Thread Andrew Z
Gentlemen, thank you very much for the replies and help. Vincent's solution worked perfectly for me. Alister - you are correct and for me, i was looking to achieve that - readability and slightly less keystrokes. On Tue, Nov 14, 2017 at 4:59 AM, alister via Python-list < python-list@python.org>

Re: Test - you can ignore

2017-11-18 Thread Skip Montanaro
On Saturday, November 18, 2017 at 7:28:56 AM UTC-6, Skip Montanaro wrote: > This is a test posting from the Usenet side of things. Looking to see if/when > it turns up in the gate_news logs on mail.python.org... > > Skip Yet another test. This time with SpamBayes x-mine_usenet_headers setting e

Re: Test - you can ignore

2017-11-18 Thread Skip Montanaro
On Saturday, November 18, 2017 at 7:28:56 AM UTC-6, Skip Montanaro wrote: > This is a test posting from the Usenet side of things. Looking to see if/when > it turns up in the gate_news logs on mail.python.org... This is another test, though with a bit more Python content... (python2) ~% python -

Re: Python dos2unix one liner

2017-11-18 Thread Chris Angelico
On Sat, Nov 18, 2017 at 9:42 PM, wrote: > Hello, > > I need to perform a tp on semaphores and shared segments of memory, but I > have a bit of trouble with the first notion. A tp? Sorry, not something I'm familiar with. > We are asked here to use only the IPC system 5 objects that are the shar

Re: ctypes help

2017-11-18 Thread eryk sun
On Fri, Nov 17, 2017 at 10:11 PM, Python wrote: > > I'm starting to play with ctypes, as I'd like to provide Python > interfaces to a C/C++ library I have. For now I'm just messing with a > very simple piece of code to get things sorted out. I'm working with > this example C++ library, which ju

Re: Python dos2unix one liner

2017-11-18 Thread gabsiwided12
Hello, I need to perform a tp on semaphores and shared segments of memory, but I have a bit of trouble with the first notion. In short, we are asked to create 3 programs: The first director, who with the create capacity file argument, will create the museum with the different IPC system object