Hi Mike,
you can check for the major version with
import sys
sys.version_info.major
On 01.06.2018 04:44, Mike McClain wrote:
OK so I installed python 3.2, which is the latest available as a
package in Debian Wheezy, because I've seen so many folks say it's a
waste of time to play with Py
Dietmar's answer is the best, piggybacking on search engines' algorithms
and probably instead of a dictionary of english words, we'd need a
dictionary of titles, making search much more efficient
regards,
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
No need to re-invent the wheel:
I gave it a different subject line.
On Fri, Jun 1, 2018 at 2:45 AM, Abdur-Rahmaan Janhangeer <
arj.pyt...@gmail.com> wrote:
> as this sig file is a common occurance, attaching the topic to the data
> blocks thread is not really necessary
>
> Abdur-Rahmaan Janhangeer
> https://github.com/Abdur-rah
1-> search in dict, identify all words example :
meaningsofoffers
.. identified words :
me
an
mean
in
meaning
meanings
so
of
of
offer
offers
2-> next filter duplicates, i.e. of above in a new list as the original
list serves as chronological reference
3-> next chose the words whose lengths mak
Look at the six module
On Thu, May 31, 2018, 7:57 PM Mike McClain wrote:
> OK so I installed python 3.2, which is the latest available as a
> package in Debian Wheezy, because I've seen so many folks say it's a
> waste of time to play with Py2.7.
> Immediately my python playground 'my.py
On 5/31/2018 10:26 PM, Mike McClain wrote:
I'm having understanding the use if the ellipsis.
I keep reading that it is used in slices
By numpy for numpy multidimensional arrays, which have their own
__getitem__, which recognizes and gives meaning to ...
--
Terry Jan Reedy
--
https://ma
OK so I installed python 3.2, which is the latest available as a
package in Debian Wheezy, because I've seen so many folks say it's a
waste of time to play with Py2.7.
Immediately my python playground 'my.python.py' failed as soon as
I changes the '#!' line to python3.2.
Most of the err
as this sig file is a common occurance, attaching the topic to the data
blocks thread is not really necessary
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
On Fri, 1 Jun 2018, 01:49 Paul, wrote:
> I have heard that attachments to messages are not allowed on this list,
> which makes
I'm having understanding the use if the ellipsis.
I keep reading that it is used in slices but every time I use it I get
'Syntax error' in 2.7 if 'Type error' in 3.2.
In python2.7:
l=range(15)
l[...:11]
Syntax error
l[3:...]
Syntax error
l[3:...:11]
Syntax error
In python3.2 it becomes 'Type
On 5/31/2018 3:49 PM, bruceg113...@gmail.com wrote:
> How do I list only the methods I define in a class?
Here's a class with some method, defined in various ways:
>>> class x():
... a=3
... def f():pass
... g = lambda: None
...
>>> l=[v for v in x.__dict__.items()]; print(l)
[('a',
On Thu, 31 May 2018 09:51:30 -0700, Rob Gaddi wrote:
> On 05/31/2018 07:49 AM, Dan Strohl wrote:
>> Is it possible to override the assignment of built in types to the
>> shorthand representations? And if not, is it a reasonable thought to
>> consider adding?
[...]
> My problem with this idea is
On Thursday, May 31, 2018 at 5:31:48 PM UTC-4, Dietmar Schwertberger wrote:
> On 5/31/2018 10:26 PM, beliavsky--- via Python-list wrote:
> > Is there a Python library that uses intelligent guesses to break sequences
> > of characters into words? The general strategy would be to break strings
> >
I have heard that attachments to messages are not allowed on this list,
which makes sense. However I notice that messages from Peter do have an
attachment, i.e., a signature.asc file.
I'm just curious; why and how do those particular attachments get through?
And should they get through, I guess? E
On Fri, Jun 1, 2018 at 7:09 AM, Dietmar Schwertberger
wrote:
> On 5/31/2018 10:26 PM, beliavsky--- via Python-list wrote:
>>
>> Is there a Python library that uses intelligent guesses to break sequences
>> of characters into words? The general strategy would be to break strings
>> into the longest
On Fri, Jun 1, 2018 at 7:05 AM, Peter J. Holzer wrote:
> [Strange: I didn't get this mail through the list, only directly]
>
> On 2018-05-31 14:39:17 +, Dan Strohl wrote:
>> The outdent method could look like:
>>
>> string.outdent(size=None)
>> """
>> :param size : The number of spaces
On Fri, Jun 1, 2018 at 6:51 AM, Paul wrote:
> In the US, at least, spaces should sort before letters.
>
> MRAB brought up an important point. It depends on your purpose, of course,
> but having all the capitalized-beginning items appear separately from all
> of the lower-cased-beginning items can
On 5/31/2018 10:26 PM, beliavsky--- via Python-list wrote:
Is there a Python library that uses intelligent guesses to break sequences of characters
into words? The general strategy would be to break strings into the longest words
possible. The library would need to "know" a sizable subset of wo
On 2018-05-31 23:05:35 +0200, Peter J. Holzer wrote:
> [Strange: I didn't get this mail through the list, only directly]
Found it. For some reason "Avoid duplicate copies of messages" was
enabled. I normally always disable this when I subscribe to a
mailinglist and I'm surprised that I haven't not
On 2018-05-31 16:44:10 +0100, MRAB wrote:
> I was also thinking that it could take the indentation from the first line,
> but that if you wanted the first line to have a larger indent than the
> remaining lines, you could replace the first space that you want to keep
> with a non-whitespace charact
[Strange: I didn't get this mail through the list, only directly]
On 2018-05-31 14:39:17 +, Dan Strohl wrote:
> > This is of course not a problem if the *trailing* quote determines the
> > indentation:
> >
> > a_multi_line_string = i'''
> >Py-
> > thon
> > ''
In the US, at least, spaces should sort before letters.
MRAB brought up an important point. It depends on your purpose, of course,
but having all the capitalized-beginning items appear separately from all
of the lower-cased-beginning items can be very annoying to a user.
--
https://mail.python.or
On Fri, Jun 1, 2018 at 6:26 AM, beliavsky--- via Python-list
wrote:
> I bought some e-books in a Humble Bundle. The file names are shown below. I
> would like to hyphenate words within the file names, so that the first three
> titles are
>
> a_devils_chaplain.pdf
> atomic_accidents.pdf
> chaos_m
I bought some e-books in a Humble Bundle. The file names are shown below. I
would like to hyphenate words within the file names, so that the first three
titles are
a_devils_chaplain.pdf
atomic_accidents.pdf
chaos_making_a_new_science.pdf
Is there a Python library that uses intelligent guesses t
How do I list only the methods I define in a class?
For example:
class Produce():
def __init__ (self):
print (dir (Produce))
def apples(self):
pass
def peaches(self):
pass
def pumpkin (self):
pass
The print (dir(Produce)) statement d
On 5/31/2018 10:49 AM, Dan Strohl via Python-list wrote:
Is it possible to override the assignment of built in types to the shorthand
representations?
By which I presume you mean literals and overt (non-comprehension)
displays. So you wish that Python should be even more dynamic. (Some
wis
On Fri, Jun 1, 2018 at 12:39 AM, Dan Strohl via Python-list
wrote:
>> This is of course not a problem if the *trailing* quote determines the
>> indentation:
>>
>> a_multi_line_string = i'''
>>Py-
>> thon
>> '''
>
> I get the point, but it feels like it would be a
On 2018-05-31, Paul Moore wrote:
> On 31 May 2018 at 15:01, Chris Angelico wrote:
>> Can someone on Windows see if there are other path names that raise
>> ValueError there? Windows has a whole lot more invalid characters, and
>> invalid names as well.
>
> On Windows:
>
os.path.exists('\0')
On Fri, Jun 1, 2018 at 12:37 AM, Frank Millman wrote:
> "Steven D'Aprano" wrote in message news:peorib$1f4$2...@blaine.gmane.org...
>>
>>
>> On Thu, 31 May 2018 10:05:43 +0200, Frank Millman wrote:
>>
>> > From the interpreter session below, you will see that adding a key while
>> > processing th
On Fri, Jun 1, 2018 at 12:51 AM, MRAB wrote:
> On 2018-05-31 14:38, Marko Rauhamaa wrote:
>>
>> Chris Angelico :
>>>
>>> Do you have an actual use-case where it is correct for an invalid path
>>> to be treated as not existing?
>>
>>
>> Note that os.path.exists() returns False for other types of er
> >
> > I am envisioning something in the header like an import statement
> > where I could do;
> >
> > override str=my_string
> > override list=my_list
> >
> > This would only be scoped to the current module and would not be
> imported when that module was imported.
> >
> > Thoughts?
> >
> > Dan S
Terry Reedy :
> On 5/31/2018 8:03 AM, Marko Rauhamaa wrote:
>> Is the behavior a bug? Shouldn't it be:
>>
>> >>> os.path.exists("\0")
>> False
>
> Please open an issue on the tracker if there is not one for this
> already.
issue 33721 created
Marko
--
https://mail.python.org/mailman/li
On 5/31/2018 10:39 AM, Dan Strohl via Python-list wrote:
This is of course not a problem if the *trailing* quote determines the
indentation:
a_multi_line_string = i'''
Py-
thon
'''
I get the point, but it feels like it would be a pain to use, and it "Feels"
On 5/31/2018 8:03 AM, Marko Rauhamaa wrote:
This surprising exception can even be a security issue:
>>> os.path.exists("\0")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python3.6/genericpath.py", line 19, in exists
os.stat(path)
Value
On 05/31/2018 07:49 AM, Dan Strohl wrote:
Is it possible to override the assignment of built in types to the shorthand
representations? And if not, is it a reasonable thought to consider adding?
For example, right now, if I do:
test = "this is a string",
I get back str("this is a string").
Tobiah wrote:
> I had a case today where I needed to sort two string:
>
> ['Awards', 'Award Winners']
>
> I consulted a few sources to get a suggestion as to
> what would be correct. My first idea was to throw them
> through a Linux command line sort:
>
> Awards
> Award Winners
>
> Then I did
That's what I wanted! But, I didn't know the question because I didn't
know the answer.
On 30/05/2018 23:09, Karsten Hilbert wrote:
On Wed, May 30, 2018 at 11:01:17PM +0200, Peter J. Holzer wrote:
On 2018-05-30 22:08:45 +0200, Paul St George wrote:
Ha! No, my question was clumsy.
If I know
On 2018-05-31 15:39, Dan Strohl via Python-list wrote:
This is of course not a problem if the *trailing* quote determines the
indentation:
a_multi_line_string = i'''
Py-
thon
'''
I get the point, but it feels like it would be a pain to use, and it "Feels"
diff
On 2018-05-31 15:18, Tobiah wrote:
I had a case today where I needed to sort two string:
['Awards', 'Award Winners']
I consulted a few sources to get a suggestion as to
what would be correct. My first idea was to throw them
through a Linux command line sort:
Awards
Awa
On 31 May 2018 at 16:11, Steven D'Aprano
wrote:
> On Thu, 31 May 2018 22:46:35 +1000, Chris Angelico wrote:
> [...]
>>> Most other analogous reasons *don't* generate an exception, nor is that
>>> possibility mentioned in the specification:
>>>
>>>https://docs.python.org/3/library/os.path.html?
On Thu, 31 May 2018 22:46:35 +1000, Chris Angelico wrote:
[...]
>> Most other analogous reasons *don't* generate an exception, nor is that
>> possibility mentioned in the specification:
>>
>>https://docs.python.org/3/library/os.path.html?#os.path.exists
>>
>> Is the behavior a bug? Shouldn't it
Is it possible to override the assignment of built in types to the shorthand
representations? And if not, is it a reasonable thought to consider adding?
For example, right now, if I do:
test = "this is a string",
I get back str("this is a string"). What if I want to return this as
my_string
On 31 May 2018 at 15:01, Chris Angelico wrote:
> Can someone on Windows see if there are other path names that raise
> ValueError there? Windows has a whole lot more invalid characters, and
> invalid names as well.
On Windows:
>>> os.path.exists('\0')
ValueError: stat: embedded null character in
On 2018-05-31 14:38, Marko Rauhamaa wrote:
Chris Angelico :
Do you have an actual use-case where it is correct for an invalid path
to be treated as not existing?
Note that os.path.exists() returns False for other types of errors
including:
* File might exist but you have no access rights
> This is of course not a problem if the *trailing* quote determines the
> indentation:
>
> a_multi_line_string = i'''
>Py-
> thon
> '''
I get the point, but it feels like it would be a pain to use, and it "Feels"
different from the other python indenting, which
"Steven D'Aprano" wrote in message news:peorib$1f4$2...@blaine.gmane.org...
On Thu, 31 May 2018 10:05:43 +0200, Frank Millman wrote:
> From the interpreter session below, you will see that adding a key while
> processing the *last* key in an OrderedDict does not give rise to an
> exception.
I
I had a case today where I needed to sort two string:
['Awards', 'Award Winners']
I consulted a few sources to get a suggestion as to
what would be correct. My first idea was to throw them
through a Linux command line sort:
Awards
Award Winners
Then I did some Googling
Chris Angelico wrote:
A Unix path name cannot contain a null byte, so what you have is a
fundamentally invalid name. ValueError is perfectly acceptable.
It would also make sense for it could simply return False, since
a file with such a name can't exist.
This is analogous to the way comparing
On Thu, May 31, 2018 at 11:38 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>> Do you have an actual use-case where it is correct for an invalid path
>> to be treated as not existing?
>
> Note that os.path.exists() returns False for other types of errors
> including:
>
> * File might exist but you
Chris Angelico :
> Do you have an actual use-case where it is correct for an invalid path
> to be treated as not existing?
Note that os.path.exists() returns False for other types of errors
including:
* File might exist but you have no access rights
* The pathname is too long for the file syst
On Thu, May 31, 2018 at 11:03 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Thu, May 31, 2018 at 10:03 PM, Marko Rauhamaa wrote:
>>>
>>> This surprising exception can even be a security issue:
>>>
>>>>>> os.path.exists("\0")
>>>Traceback (most recent call last):
>>> File "", l
Chris Angelico :
> On Thu, May 31, 2018 at 10:03 PM, Marko Rauhamaa wrote:
>>
>> This surprising exception can even be a security issue:
>>
>>>>> os.path.exists("\0")
>>Traceback (most recent call last):
>> File "", line 1, in
>> File "/usr/lib64/python3.6/genericpath.py", line
On Thu, 31 May 2018 10:05:43 +0200, Frank Millman wrote:
> "Frank Millman" wrote in message news:pemchs$r12$1...@blaine.gmane.org...
>>
>> So working backwards, I have solved the first problem. I am no nearer
>> to
> figuring out why it fails intermittently in my live program. The message
> from
On Thu, May 31, 2018 at 10:03 PM, Marko Rauhamaa wrote:
>
> This surprising exception can even be a security issue:
>
>>>> os.path.exists("\0")
>Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib64/python3.6/genericpath.py", line 19, in exists
>os.
This surprising exception can even be a security issue:
>>> os.path.exists("\0")
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python3.6/genericpath.py", line 19, in exists
os.stat(path)
ValueError: embedded null byte
Most other analogous rea
We have received an amazing collection of 376 proposals.
Thank you all for your contributions!
Given the overwhelming quality of the proposals,
we had some very difficult decisions to make.
Nonetheless we are happy to announce
we have published the first 120+ sessions.
https://ep2018.europython.eu
On 2018-05-31 00:06:37 +, Steven D'Aprano wrote:
> On Wed, 30 May 2018 21:53:05 +0100, Ben Bacarisse wrote:
> > Rob Gaddi writes:
> >> On 05/30/2018 09:34 AM, Paul Rubin wrote:
> >>> I think Usenet posts are no longer getting forwarded to the mailing
> >>> list, but now I wonder if this is get
"Frank Millman" wrote in message news:pemchs$r12$1...@blaine.gmane.org...
So working backwards, I have solved the first problem. I am no nearer to
figuring out why it fails intermittently in my live program. The message
from INADA Naoki suggests that it could be inherent in CPython, but I am n
57 matches
Mail list logo