Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Stephen Hansen
On Fri, Apr 29, 2016, at 06:55 PM, Christopher Reimer wrote: > On 4/29/2016 6:29 PM, Stephen Hansen wrote: > > If isupper/islower were perfect opposites of each-other, there'd be no > > need for both. But since characters can be upper, lower, or *neither*, > > you run into this situation. > > Ba

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 9:36:42 AM UTC+5:30, Paul Rubin wrote: > Rustom Mody writes: > > As with all things rms, its taking him decades to realize this defeat > > [Latest makeinfo is 18 times slower than previous version!! > > https://lists.gnu.org/archive/html/bug-texinfo/2013-01/msg00012.

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Gregory Ewing
Christopher Reimer wrote: str.islower(): "Return true if all cased characters [4] in the string are lowercase and there is at least one cased character, false otherwise." str.isupper(): "Return true if all cased characters [4] in the string are uppercase and there is at least one cased charac

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 23:23, Steven D'Aprano wrote: > Seriously, I'm thinking that a keyword argument to help might be useful: > > help(object, pager=None) I'd call it something more generic like "output". > where: > > - pager=None gives the current behaviour; > > - pager="foo" calls out to

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 9:46:19 AM UTC+5:30, Random832 wrote: > On Sat, Apr 30, 2016, at 00:06, Ben Finney wrote: > > Steven D'Aprano writes: > > > > > So they want the PAGER environment variable to specify what pager they > > > want... > > > > > > ...so long as applications don't actually

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Random832
On Sat, Apr 30, 2016, at 00:06, Ben Finney wrote: > Steven D'Aprano writes: > > > So they want the PAGER environment variable to specify what pager they > > want... > > > > ...so long as applications don't actually make use of that PAGER > > environment variable to determine the pager they want t

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Paul Rubin
Rustom Mody writes: > As with all things rms, its taking him decades to realize this defeat > [Latest makeinfo is 18 times slower than previous version!! > https://lists.gnu.org/archive/html/bug-texinfo/2013-01/msg00012.html Wait, what's it written in now? > In the meantime the so called lightwe

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Ben Finney
Steven D'Aprano writes: > So they want the PAGER environment variable to specify what pager they > want... > > ...so long as applications don't actually make use of that PAGER > environment variable to determine the pager they want to use. This at least does not baldly misrepresent the position

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 12:49 pm, Ben Finney wrote: > Random832 writes: > >> On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: >> > Instead it does some ½-assed fall-between-the-stools of both >> >> That doesn't answer the question of why, if you (Well, Ethan, but >> you're taking the same position

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 7:55:47 AM UTC+5:30, Ben Finney wrote: > "Martin A. Brown" writes: > > > Hello [Steven D'Aprano], > > > > >What is a good place where I can find out more about writing manpage? > > Writing them directly in GNU troff markup is easy enough > http://liw.fi/manpages/>.

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:46, Rustom Mody wrote: > I dont get whats so hard to get in this: > When we need pagers we know where to get them And if you set PAGER=cat (thus "crippling your shell"), you will likewise know where to get them when you want to page the output from man or git. Why is py

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 8:06:46 AM UTC+5:30, Random832 wrote: > On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > > On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > > > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > > > So I have to cripple my shell to get p

Re: about special characters

2016-04-29 Thread MRAB
On 2016-04-30 03:35, eryk sun wrote: On Fri, Apr 29, 2016 at 8:48 PM, Ben Finney wrote: Steven D'Aprano writes: On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: > (There has never been a Python 27. I assume Python 2.7 is what you > meant.) I believe that Python X.Y shows up as "PythonXY" und

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Ben Finney
Random832 writes: > On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > > Instead it does some ½-assed fall-between-the-stools of both > > That doesn't answer the question of why, if you (Well, Ethan, but > you're taking the same position here) hate pagers so much That's not a question relevant

Re: about special characters

2016-04-29 Thread Ben Finney
Terry Reedy writes: > On 4/29/2016 9:48 PM, Ben Finney wrote: > > Steven D'Aprano writes: > > > >> On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: > >> > >>> (There has never been a Python 27. I assume Python 2.7 is what you > >>> meant.) > >> > >> I believe that Python X.Y shows up as "PythonXY

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:27, Rustom Mody wrote: > On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > > So I have to cripple my shell to get pydoc help to work nicely? Neat! > > > Actually, not so much. :( > > > > I

Re: about special characters

2016-04-29 Thread eryk sun
On Fri, Apr 29, 2016 at 8:48 PM, Ben Finney wrote: > Steven D'Aprano writes: >> On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: >> >> > (There has never been a Python 27. I assume Python 2.7 is what you >> > meant.) >> >> I believe that Python X.Y shows up as "PythonXY" under Windows. > > Then th

Re: about special characters

2016-04-29 Thread Terry Reedy
On 4/29/2016 9:48 PM, Ben Finney wrote: Steven D'Aprano writes: On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: (There has never been a Python 27. I assume Python 2.7 is what you meant.) I believe that Python X.Y shows up as "PythonXY" under Windows. As a directory name that also omits t

Writing manual pages using Python code (was: manpage writing)

2016-04-29 Thread Ben Finney
"Martin A. Brown" writes: > Hello [Steven D'Aprano], > > >What is a good place where I can find out more about writing manpage? Writing manual pages directly in standard GNU troff markup is simple enough http://liw.fi/manpages/>. It's not a pretty markup language, but it's workable. For writing

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Rustom Mody
On Saturday, April 30, 2016 at 7:47:11 AM UTC+5:30, Random832 wrote: > On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > > So I have to cripple my shell to get pydoc help to work nicely? Neat! > > Actually, not so much. :( > > If you don't want a pager with pydoc, when exactly do you want i

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Ben Finney
"Martin A. Brown" writes: > Hello [Steven D'Aprano], > > >What is a good place where I can find out more about writing manpage? Writing them directly in GNU troff markup is easy enough http://liw.fi/manpages/>. For writing manual pages programmatically via Python code, I am working on a ‘manpag

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Random832
On Fri, Apr 29, 2016, at 22:09, Ethan Furman wrote: > So I have to cripple my shell to get pydoc help to work nicely? Neat! > Actually, not so much. :( If you don't want a pager with pydoc, when exactly do you want it? -- https://mail.python.org/mailman/listinfo/python-list

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Chris Angelico
On Sat, Apr 30, 2016 at 11:55 AM, Christopher Reimer wrote: > On 4/29/2016 6:29 PM, Stephen Hansen wrote: >> >> If isupper/islower were perfect opposites of each-other, there'd be no >> need for both. But since characters can be upper, lower, or *neither*, you >> run into this situation. > > > Bas

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Ethan Furman
On 04/29/2016 06:20 PM, Steven D'Aprano wrote: On Fri, 29 Apr 2016 07:53 pm, Rustom Mody wrote: JFTR I find git behavior annoying -- as it seems do others `git --help` behaves as the Unix standard: it prints help output to stdout. Is that the annoying behaviour? No. `git help ` and `git

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Christopher Reimer
On 4/29/2016 6:29 PM, Stephen Hansen wrote: If isupper/islower were perfect opposites of each-other, there'd be no need for both. But since characters can be upper, lower, or *neither*, you run into this situation. Based upon the official documentation, I was expecting perfect opposites. str.

Re: Not x.islower() Versus x.isupper Output Results

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 11:31 am, Steven D'Aprano wrote: > In unicode, there are also: > > - titlecase characters, like "DžLjῼ" To be clear, each of those three characters is considered titlecased individually. The three of them together is not considered a title-cased string. "Is Title" is not just

Re: about special characters

2016-04-29 Thread Ben Finney
Steven D'Aprano writes: > On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: > > > (There has never been a Python 27. I assume Python 2.7 is what you > > meant.) > > I believe that Python X.Y shows up as "PythonXY" under Windows. Then that's a bug which should be fixed, IMO. An MS Windows user (i.e

Re: Python path and append

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 06:26 am, boB Stepp wrote: > On Mon, Apr 25, 2016 at 8:51 PM, Steven D'Aprano > wrote: > >> See here for the *start* of a more professional approach: >> >> http://code.activestate.com/recipes/579097-safely-and-atomically-write-to-a-file/ > > What else would I need to know/co

Re: Not x.islower() Versus x.isupper Output Results

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 11:14 am, Christopher Reimer wrote: > Shouldn't the results between 'not x.islower()' and 'x.isupper()' be > identical? Of course not. py> "2 #".islower(), "2 #".isupper() (False, False) py> not "2 #".islower(), "2 #".isupper() (True, False) "Is Lower" versus "Is Upper" is

Re: Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Stephen Hansen
On Fri, Apr 29, 2016, at 06:17 PM, Christopher Reimer wrote: > Greetings, > > I was playing around with a piece of code to remove lowercase letters > and leave behind uppercase letters from a string when I got unexpected > results. > > string = 'Whiskey Tango Foxtrot' > > list(filter

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 07:53 pm, Rustom Mody wrote: > On Friday, April 29, 2016 at 3:07:09 PM UTC+5:30, Steven D'Aprano wrote: >> On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich >> pheromones into the air, where they diffused rapidly: >> > Why replicate and cause annoyance? >> >> I

Not x.islower() has different output than x.isupper() in list output...

2016-04-29 Thread Christopher Reimer
Greetings, I was playing around with a piece of code to remove lowercase letters and leave behind uppercase letters from a string when I got unexpected results. string = 'Whiskey Tango Foxtrot' list(filter((lambda x: not x.islower()), string)) ['W', ' ', 'T', ' ', 'F'] Note the

Not x.islower() Versus x.isupper Output Results

2016-04-29 Thread Christopher Reimer via Python-list
Greetings, I was playing around with a piece of code to remove lowercase letters and leave behind uppercase letters from a string when I got unexpected results. string = 'Whiskey Tango Foxtrot' list(filter((lambda x: not x.islower()), string)) ['W', ' ', 'T', ' ', 'F'] Note the

Re: about special characters

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 09:33 am, Jianling Fan wrote: > Hello everyone, > > I am trying to use python 27 copying some of my folders and files to > another directory. > My code works good for other files but I have some problem to copy > files that have some special characters in the filename. like >

Re: about special characters

2016-04-29 Thread Steven D'Aprano
On Sat, 30 Apr 2016 09:52 am, Ben Finney wrote: > Jianling Fan writes: > >> I am trying to use python 27 copying some of my folders and files to >> another directory. > > (There has never been a Python 27. I assume Python 2.7 is what you meant.) I believe that Python X.Y shows up as "PythonXY"

Re: def __init__(self,cls):

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 07:47 pm, San wrote: > Dear Group, > > Please explain the following in details. > > " > def __init__(self,cls): > self.cls = cls The answer is the same as the answer you were given when you asked this question on the tutor mailing list. Did you read the answers you

Re: about special characters

2016-04-29 Thread MRAB
On 2016-04-30 00:52, Ben Finney wrote: Jianling Fan writes: I am trying to use python 27 copying some of my folders and files to another directory. (There has never been a Python 27. I assume Python 2.7 is what you meant.) My code works good for other files but I have some problem to copy

Re: about special characters

2016-04-29 Thread Ben Finney
Jianling Fan writes: > I am trying to use python 27 copying some of my folders and files to > another directory. (There has never been a Python 27. I assume Python 2.7 is what you meant.) > My code works good for other files but I have some problem to copy > files that have some special charact

Re: Why does pathlib not have is_readable() & things like that?

2016-04-29 Thread Grant Edwards
On 2016-04-29, eryk sun wrote: > On Fri, Apr 29, 2016 at 6:51 AM, Jussi Piitulainen > wrote: >> Adam Funk writes: >>> On 2016-04-28, Grant Edwards wrote: >> Or just do os.access("directory/where/you/want/to/open/a/file",os.W_OK) >>> >>> That's what I'm doing now, but I prefer to give the user

about special characters

2016-04-29 Thread Jianling Fan
Hello everyone, I am trying to use python 27 copying some of my folders and files to another directory. My code works good for other files but I have some problem to copy files that have some special characters in the filename. like filenames contain Greek "δ" or latin "š". it always gave a error

Re: web facing static text db

2016-04-29 Thread Chris Angelico
On Sat, Apr 30, 2016 at 8:29 AM, Fetchinson . via Python-list wrote: > * store text documents (about 10 pages) > * the data set is static (i.e. only lookups are performed, no delete, > no edit, no addition) > * only one operation required: lookup of pages by matching words in them > * very sim

web facing static text db

2016-04-29 Thread Fetchinson . via Python-list
Hi folks, I have a very specific set of requirements for a task and was wondering if anyone had good suggestions for the best set of tools: * store text documents (about 10 pages) * the data set is static (i.e. only lookups are performed, no delete, no edit, no addition) * only one operation

Re: Compiling extensions on Python 2.7, Windows 10 64 bit

2016-04-29 Thread Andrea Gavana
Hi, On Friday, 29 April 2016, Igor Korot wrote: > Andrea, > > On Fri, Apr 29, 2016 at 3:45 PM, > > wrote: > > Dear list, > > > > I have been trying to compile wxPython Phoenix ( > https://github.com/wxWidgets/Phoenix) from source on Windows 10 64 bit, > Python 2.7 64 bit, using the very han

Re: How to download a flash video from this site?

2016-04-29 Thread Chris Angelico
On Sat, Apr 30, 2016 at 5:21 AM, wrote: > I am looking for a way to download a flash video from the page: > > https://hrti.hrt.hr/#/video/show/2203605/trebizat-prica-o-jednoj-vodi-i-jednom-narodu-dokumentarni-film > > The html code bellow the page is fairly simple, but I can't figure out how to

Re: Compiling extensions on Python 2.7, Windows 10 64 bit

2016-04-29 Thread Igor Korot
Andrea, On Fri, Apr 29, 2016 at 4:27 PM, Andrea Gavana wrote: > Hi, > > > On Friday, 29 April 2016, Igor Korot wrote: >> >> Andrea, >> >> On Fri, Apr 29, 2016 at 3:45 PM, wrote: >> > Dear list, >> > >> > I have been trying to compile wxPython Phoenix >> > (https://github.com/wxWidgets/Phoe

Re: Python path and append

2016-04-29 Thread boB Stepp
On Mon, Apr 25, 2016 at 8:51 PM, Steven D'Aprano wrote: > See here for the *start* of a more professional approach: > > http://code.activestate.com/recipes/579097-safely-and-atomically-write-to-a-file/ What else would I need to know/consider in order to have a *complete* professional approach?

Re: Compiling extensions on Python 2.7, Windows 10 64 bit

2016-04-29 Thread Igor Korot
Andrea, On Fri, Apr 29, 2016 at 3:45 PM, wrote: > Dear list, > > I have been trying to compile wxPython Phoenix > (https://github.com/wxWidgets/Phoenix) from source on Windows 10 64 bit, > Python 2.7 64 bit, using the very handy Microsoft Visual C++ Compiler for > Python 2.7 (https://www.

Compiling extensions on Python 2.7, Windows 10 64 bit

2016-04-29 Thread andrea . gavana
Dear list, I have been trying to compile wxPython Phoenix (https://github.com/wxWidgets/Phoenix) from source on Windows 10 64 bit, Python 2.7 64 bit, using the very handy Microsoft Visual C++ Compiler for Python 2.7 (https://www.microsoft.com/en-us/download/details.aspx?id=44266). I starte

How to download a flash video from this site?

2016-04-29 Thread zljubisic
Hi, I am looking for a way to download a flash video from the page: https://hrti.hrt.hr/#/video/show/2203605/trebizat-prica-o-jednoj-vodi-i-jednom-narodu-dokumentarni-film The html code bellow the page is fairly simple, but I can't figure out how to get the file. In case somebody have an idea

Re: Query regarding python 2.7.11 release

2016-04-29 Thread Michael Selik
>From searching bugs.python.org, I see that issues referencing CVE-2014-7185, CVE-2013-1752, and CVE-2014-1912 have all been marked as closed. I don't see any issues referencing CVE-2014-4650 via Python's bug tracker, but did spot it on Red Hat's. It appears to be related to issue 21766 ( http://b

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Rustom Mody
On Friday, April 29, 2016 at 7:35:55 PM UTC+5:30, Ethan Furman wrote: > Wow. Thank you for that very informative post! > > -- > ~Ethan~ For emacs junkies there is also org-e-man [1] http://orgmode.org/worg/org-tutorials/org-e-man-documentation.html [2] https://github.com/tkf/org-mode/blob/mast

Re: Why does pathlib not have is_readable() & things like that?

2016-04-29 Thread eryk sun
On Fri, Apr 29, 2016 at 6:51 AM, Jussi Piitulainen wrote: > Adam Funk writes: >> On 2016-04-28, Grant Edwards wrote: > >>> Or just do os.access("directory/where/you/want/to/open/a/file",os.W_OK) >> >> That's what I'm doing now, but I prefer to give the user the error >> message early on. > > Then

Re: manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Ethan Furman
Wow. Thank you for that very informative post! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

manpage writing [rst, asciidoc, pod] was [Re: What should Python apps do when asked to show help?]

2016-04-29 Thread Martin A. Brown
Hello, >What is a good place where I can find out more about writing >manpage? I don't know of a single place where manpage authorship is particularly documented. This seems to be one of the common target links. In addition to introducing the breakdown of manpages by type (section) and pro

Re: Controlling the passing of data

2016-04-29 Thread Sayth Renshaw
> because a set avoids duplicates. If you say "I want to document my > achievements for posterity" I would recommend that you print to a file > rather than append to a list and the original code could be changed to > > with open("somefile") as f: > for achievement in my_achievements: >

Re: def __init__(self,cls):

2016-04-29 Thread Michiel Overtoom
> On 2016-04-29, at 11:47, San wrote: > > Dear Group, please explain the following in details. Thanks in Advance. > > def __init__(self,cls): >self.cls = cls Is this homework? Why don't you explain it first in your own words, then let us comment on it? Greetings, -- https://mail.

Re: Why does pathlib not have is_readable() & things like that?

2016-04-29 Thread Jussi Piitulainen
Adam Funk writes: > On 2016-04-28, Grant Edwards wrote: >> >> Then open the output file before you do the GET. > > I guess I could, but fetching the data actually involves a whole lot > of GET requests (the first one includes cross-references to the URLs > where the rest of the data is found), som

Re: Controlling the passing of data

2016-04-29 Thread Peter Otten
Sayth Renshaw wrote: > >> >> Your actual problem is drowned in too much source code. Can you restate >> it in English, optionally with a few small snippets of Python? >> >> It is not even clear what the code you provide should accomplish once >> it's running as desired. >> >> To give at least

Re: Controlling the passing of data

2016-04-29 Thread Peter Otten
Sayth Renshaw wrote: > >> >> Your actual problem is drowned in too much source code. Can you restate >> it in English, optionally with a few small snippets of Python? >> >> It is not even clear what the code you provide should accomplish once >> it's running as desired. >> >> To give at least

Re: Why does pathlib not have is_readable() & things like that?

2016-04-29 Thread Adam Funk
On 2016-04-28, Grant Edwards wrote: > On 2016-04-28, Adam Funk wrote: >> On 2016-04-26, Random832 wrote: >> >>> On Tue, Apr 26, 2016, at 09:30, Adam Funk wrote: I recently discovered pathlib in the Python 3 standard library, & find it very useful, but I'm a bit surprised that it doesn't

Re: Pythonic style

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 10:48 am, Gregory Ewing wrote: > MRAB wrote: > >> Is it worthy of being in the Zen of Python? > > +1. Maybe something along the lines of: > > Dunder methods are for defining, not calling. > Unless you're a dunderhead[1]. > > [1] Meant in the sense of an enthusiast,

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Rustom Mody
On Friday, April 29, 2016 at 3:07:09 PM UTC+5:30, Steven D'Aprano wrote: > On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich pheromones > into the air, where they diffused rapidly: > > Why replicate and cause annoyance? > > If you don't want to use the functionality, don't. You as

def __init__(self,cls):

2016-04-29 Thread San
Dear Group, Please explain the following in details. " def __init__(self,cls): self.cls = cls " Thanks in Advance. San -- https://mail.python.org/mailman/listinfo/python-list

Re: What should Python apps do when asked to show help?

2016-04-29 Thread Steven D'Aprano
On Fri, 29 Apr 2016 03:00 pm, Rustom Mody wafted information-rich pheromones into the air, where they diffused rapidly: > Quite bewildered by this thread... > Are we in 2016? > [Reminds me of the bizarre claim that world has not moved on from text] (For the benefit of those of us still stuck in t