Re: What is the correct form for saying "licensed under the same terms as Python itself"?

2016-09-14 Thread Tim Chase
On 2016-09-14 11:57, Brendan Abel wrote: > Also, according to the python web site, they only accept > contributions under the following licenses: > >- Academic Free License v. 2.1 > >- Apache License, Version 2.0 >

Idiomatic code validator?

2016-09-20 Thread Tim Johnson
Not to confuse idiomatic code validation with pep8 validation (I use elpy on emacs) Is there such a thing as a validator for _idiomatic_ code? I have Knupp's "Writing Idiomatic Python" and have bookmarked some advisory websites that illustrate idiomatic style. thank

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Terry Reedy [160920 11:48]: > On 9/20/2016 11:41 AM, Tim Johnson wrote: > > Not to confuse idiomatic code validation with pep8 validation > > Strictly speaking, there cannot be a mechanical PEP 8 validator, as any > mechanical checker violates the admonitions of the

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Steve D'Aprano [160920 16:29]: > On Wed, 21 Sep 2016 01:41 am, Tim Johnson wrote: > > > Not to confuse idiomatic code validation with pep8 validation (I use > > elpy on emacs) > > > > Is there such a thing as a validator for _idiomatic_ code? > >

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Steve D'Aprano [160920 16:29]: > On Wed, 21 Sep 2016 01:41 am, Tim Johnson wrote: > > > Not to confuse idiomatic code validation with pep8 validation (I use > > elpy on emacs) > > > > Is there such a thing as a validator for _idiomatic_ code? > >

Re: Obtain the raw line of text read by CSVDictReader when reporting errors?

2016-09-23 Thread Tim Chase
On 2016-09-23 16:58, Lawrence D’Oliveiro wrote: > Duck type is great for sticking pieces of Python code together. > > And anybody who doesn’t like it can go Java themselves... Sorry, my source code doesn't declare that I support JavaInterface... -tkc -- https://mail.python.org/mailman/lis

Case insensitive replacement?

2016-09-27 Thread Tim Chase
I'd like to do a case-insensitive replacement in a string but want to do it pythonically. Ideally, the code would something like needle = "World" haystack = "Hello, world!" replacement = "THERE" result = haystack.replace(needle, replacement, ignore_case=True) # result would be "Hello, T

Re: Case insensitive replacement?

2016-09-28 Thread Tim Chase
On 2016-09-27 18:10, MRAB wrote: > The disadvantage of your "string-hacking" is that you're assuming > that the uppercase version of a string is the same length as the > original: Ah, good point. I went with using the regexp version for now since I needed to move forward with something, so I'm gl

Syncing up iterators with gaps

2016-09-28 Thread Tim Chase
I've got several iterators sharing a common key in the same order and would like to iterate over them in parallel, operating on all items with the same key. I've simplified the data a bit here, but it would be something like data1 = [ # key, data1 (1, "one A"), (1, "one B"), (2, "tw

Re: Syncing up iterators with gaps

2016-09-28 Thread Tim Chase
On 2016-09-29 10:20, Steve D'Aprano wrote: > On Thu, 29 Sep 2016 05:10 am, Tim Chase wrote: > > data1 = [ # key, data1 > > (1, "one A"), > > (1, "one B"), > > (2, "two"), > > (5, "five"), > >

Abusive Italian Spam

2016-09-29 Thread Tim Golden
You may have noticed one or two more of the abusive spam messages slip through onto the list. We do have traps for these but, as with most such things, they need tuning. (We've discarded many more than you've seen). As ever, kudos to Mark Sapiro of the Mailman team for tweaking our custom filters

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread Tim Golden
On 06/10/2016 13:38, Peter Otten wrote: > BartC wrote: >> All this advice seems to be getting out of hand, with suggestions of >> 'curses' and 'blessings' and using GUI. I've tried 'ncurses' elsewhere >> and it was over the top for what I wanted to do. >> >> The OP wants to runs on Pi which I think

Reversing \N{...} notation?

2016-10-25 Thread Tim Chase
I like the clarity of using the "\N{...}" notation when creating string literals involving Unicode chars. Is there a built-in way to get such strings back from Python? >>> s = 'ma\N{LATIN SMALL LETTER N WITH TILDE}ana' >>> s 'mañana' >>> magic(s) 'ma\\N{LATIN SMALL LETTER N WITH TILDE}ana'

Re: Reversing \N{...} notation?

2016-10-26 Thread Tim Chase
On 2016-10-25 20:14, Peter Otten wrote: > Tim Chase wrote: > > I like the clarity of using the "\N{...}" notation when creating > > string literals involving Unicode chars. > > > > Is there a built-in way to get such strings back from Python? > >

Re: What is currently the recommended way to work with a distutils-based setup.py that requires compilation?

2016-11-08 Thread Tim Johnson
sked this at http://stackoverflow.com/q/40174932/648265 a couple of > days ago (to no avail). > > -- > > Regards, > Ivan > > -- > https://mail.python.org/mailman/listinfo/python-list -- Tim http://www.akwebsoft.com, http://www.tj49.com -- https://mail.python.org/mailman/listinfo/python-list

Re: update certain key-value pairs of a dict from another dict

2016-11-11 Thread Tim Chase
On 2016-11-11 11:17, Daiyue Weng wrote: > dict1 = {'A': 'a', 'B': 'b', 'C': 'c'} > dict2 = {'A': 'aa', 'B': 'bb', 'C': 'cc'} > > I am wondering how to update dict1 using dict2 that > > only keys 'A' and 'B' of dict1 are udpated. It will result in > > dict1 = {'A': 'aa', 'B': 'bb', 'C': 'c'} Use

Re: update certain key-value pairs of a dict from another dict

2016-11-11 Thread Tim Chase
On 2016-11-11 13:29, Peter Otten wrote: > The same using update(), with a generator expression that avoids > the intermediate dict: > > >>> dict1 = {'A': 'a', 'B': 'b', 'C': 'c'} > >>> dict1.update((k, dict2[k]) for k in desired & dict1.keys() & > dict2.keys()) Huh. Handy to file that new knowl

Re: Is this pythonic?

2016-11-23 Thread Tim Chase
On 2016-11-23 22:15, Steve D'Aprano wrote: > On Wed, 23 Nov 2016 08:10 pm, Frank Millman wrote: > > The class has a getval() method to return the current value. > > > > Usually the value is stored in the instance, and can be returned > > immediately, but sometimes it has to be computed, incurring

Re: Can I print 2 calendars side by side?

2016-11-23 Thread Tim Chase
On 2016-11-23 10:02, Dayton Jones wrote: > I'd like to be able to display 2 calendars side by side, instead of > stacked... is this possible? > > for instance: > > print(calendar.month(year_a,month)) > print() > print(calendar.month(year_b,month)) > > prints: > June 1971 > Mo Tu

Re: The Case Against Python 3

2016-11-26 Thread Tim Chase
On 2016-11-26 01:01, Ian Kelly wrote: > When I read that Python 3.6 would include f-strings, I turned to the > coworker sitting next to me and said, "Oh my god, Python is adding > yet another new syntax for string formatting." It's getting to be a > joke. Pretty soon Python will have one string-fo

Re: Merge Two List of Dict

2016-12-01 Thread Tim Chase
On 2016-12-01 12:44, Nikhil Verma wrote: > A = [{'person_id': '1', 'adop_count': '2'}, {'person_id': '3', > 'adop_count': '4'}] > *len(A) might be above 10L* > > B = [{'person_id': '1', 'village_id': '3'}, {'person_id': '3', > 'village_id': '4'}] > *len(B) might be above 20L* > > > OutPut List s

Re: Can json.dumps create multiple lines

2016-12-01 Thread Tim Chase
On 2016-12-01 17:30, Cecil Westerhof wrote: > When I have a value dummy which contains: > ['An array', 'with several strings', 'as a demo'] > Then json.dumps(dummy) would generate: > '["An array", "with several strings", "as a demo"]' > I would prefer when it would generate: > '[ >

Re: Detect Linux Runlevel

2016-12-05 Thread Tim Chase
On 2016-12-05 14:58, Wildman via Python-list wrote: > I there a way to detect what the Linux runlevel is from > within a Python program? I would like to be able to do > it without the use of an external program such as 'who' > or 'runlevel'. You can use something like https://gist.github.com/lik

Re: Detect Linux Runlevel

2016-12-05 Thread Tim Chase
On 2016-12-05 18:26, Wildman via Python-list wrote: > On Mon, 05 Dec 2016 16:08:57 -0600, Tim Chase wrote: > > > On 2016-12-05 14:58, Wildman via Python-list wrote: > >> I there a way to detect what the Linux runlevel is from > >> within a Python program? I would

Re: Detect Linux Runlevel

2016-12-06 Thread Tim Chase
On 2016-12-05 23:00, Wildman via Python-list wrote: > On Mon, 05 Dec 2016 21:42:52 -0600, Tim Chase wrote: > > This works based on my poking at it in both Py2 and Py3: > > That works perfectly. I owe you a big thanks. That was a > lot of work and time on your part. I really

Re: Detect Linux Runlevel

2016-12-06 Thread Tim Chase
On 2016-12-06 01:14, Bernd Nawothnig wrote: > > I am a hobby programmer and I've been trying to learn python > > for a few months now. The program is 'worthlessware' but it > > is a 'learning experience' for me. > > It looks for me like a worthless learning experience. Eh, one person's "wort

Re: Detect Linux Runlevel

2016-12-06 Thread Tim Chase
On 2016-12-06 12:10, Wildman via Python-list wrote: > If I had tried this in the beginning, it would have > save you a lot of work. > > Since both versions of the code works, which one do > you recommend? Or does it matter? Heh, I'm not sure it matters much. The code I provided should be expand

Re: Detect Linux Runlevel

2016-12-06 Thread Tim Chase
On 2016-12-07 00:29, Marko Rauhamaa wrote: > Tim Chase : > > > This works based on my poking at it in both Py2 and Py3: > > Great info, Tim. > > A word a warning: your code doesn't lock /var/run/utmp before > access, which is a race condition. The file may be upd

Re: Detect Linux Runlevel

2016-12-06 Thread Tim Chase
On 2016-12-06 21:27, Wildman via Python-list wrote: > On Tue, 06 Dec 2016 13:06:35 -0600, Tim Chase wrote: > I forgot to mention that I want to include your name in the > final script as a contributor, if that is ok. No issues here. > You will get a cut of the royalties. Lets see,

Re: Detect Linux Runlevel

2016-12-08 Thread Tim Chase
On 2016-12-07 07:30, Marko Rauhamaa wrote: > Tim Chase : > > On 2016-12-07 00:29, Marko Rauhamaa wrote: > >> A word a warning: your code doesn't lock /var/run/utmp before > >> access, which is a race condition. The file may be updated at any > >> time, an

Re: Problem running Python 3.5.2 on school network PC

2016-12-15 Thread Tim Golden
On 15/12/2016 16:11, Jed Mack wrote: We are having a problem running Python 3.5.2 on Windows 10 x64 computers, which are members of a school network. The program seems to install correctly, but when we try to run the program it stops and give an error message saying: *Fatal Python error: Py_Ini

Re: Reading python list as a newsgroup (was ...)

2016-12-16 Thread Tim Golden
On 16/12/2016 16:12, D'Arcy Cain wrote: On 2016-12-16 10:11 AM, Grant Edwards wrote: I didn't notice much spam on c.l.p (but then again, I filter out all posts from google-groups). The problem on c.l.p that caused me to Yes, blocking GG was the biggest improvement to my reading this list (mai

Re: Cleaning up conditionals

2016-12-31 Thread Tim Chase
On 2016-12-30 19:59, Deborah Swanson wrote: > Similar, actually the same as Cameron suggested. I really need to > revisit testing for empty. I probably rejected it early on for some > bad reason (you don't understand everything that goes wrong when > you're learning). If your data is anything like

Re: learning and experimenting python.

2017-01-01 Thread Tim Golden
On 02/01/17 06:40, Ian Kelly wrote: On Mon, Jan 2, 2017 at 12:15 AM, Ian Kelly wrote: Since they're unlikely to do that however, Then again, I see that einstein1410 made a couple of rather aggressive posts 11 hours ago that haven't made it to my email, so maybe he did manage to get himself ba

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Tim Johnson
ogrammed the keypad extensively for emacs. The bottom line, as others have stated, is to consistently stick with some approach that fits one's personal preferences. We are fortunate to have so many options. -- Tim http://www.akwebsoft.com, http://www.tj49.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-03 Thread Tim Johnson
ho have been programming > using Vim for almost 20 years and they did not need to change > editor (that is really awesome). Bye the way, one thing I like about the GUI based vim is that it supports tabs, where emacs does not. And check out the vim plugins for python Good L

Re: Clickable hyperlinks

2017-01-03 Thread Tim Chase
On 2017-01-03 11:46, Deborah Swanson wrote: > Excel has a formula: > > =HYPERLINK(url,description) > > that will put a clickable link into a cell. > > Does python have an equivalent function? Probably the most common > use for it would be output to the console, similar to a print > statement, bu

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-04 Thread Tim Johnson
* Paul Rudin [170103 23:17]: > Tim Johnson writes: > > > * Antonio Caminero Garcia [170102 20:56]: > >> Guys really thank you for your answers. Basically now I am more > >> emphasizing in learning in depth a tool and get stick to it so I > >> can get a

Re: Clickable hyperlinks

2017-01-05 Thread Tim Chase
On 2017-01-03 11:46, Deborah Swanson wrote: > Excel has a formula: > > =HYPERLINK(url,description) > > that will put a clickable link into a cell. > > Does python have an equivalent function? Probably the most common > use for it would be output to the console, similar to a print > statement, but c

Re: Choosing a Python IDE. what is your Pythonish recommendation? I

2017-01-06 Thread Tim Johnson
* Paul Rudin [170103 23:17]: > Tim Johnson writes: > > > * Antonio Caminero Garcia [170102 20:56]: > >> Guys really thank you for your answers. Basically now I am more > >> emphasizing in learning in depth a tool and get stick to it so I > >> can get a fas

Re: The hardest problem in computer science...

2017-01-06 Thread Tim Chase
On 2017-01-06 13:44, Dan Sommers wrote: > On Sat, 07 Jan 2017 00:03:37 +1100, Steve D'Aprano wrote: > > what do we call the vertical and horizontal line elements? I want > > to make them configurable, which means the user has to be able to > > pass an argument that specifies them ... > > pstree(1)

Re: Grumpy: Python to Go compiler

2017-01-08 Thread Tim Daneliuk
On 01/08/2017 06:18 PM, Deborah Swanson wrote: > (haha, unless > you ask) C'mon, go for it ... there hasn't been a good rant here in 4 or 5 minutes ... -- https://mail.python.org/mailman/listinfo/python-list

Re: Temporary variables in list comprehensions

2017-01-09 Thread Tim Chase
On 2017-01-09 02:46, Paul Rubin wrote: > > gen = (expensive_calculation(x) for x in data) > > result = [(tmp, tmp + 1) for tmp in gen] > > result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)] As charmingly expressive as map() is, the wildly different behavior in py3 (it's a gener

Re: Clickable hyperlinks

2017-01-09 Thread Tim Chase
On 2017-01-09 05:00, Deborah Swanson wrote: > Code does in fact have the power to control what happens > in the console. How do you think Linux does it on their terminals > with clickable links? Granted, the code may have to specify > parameters for a particular console, but I certainly wasn't aski

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Tim Chase
On 2017-01-08 22:58, Deborah Swanson wrote: > 1) I have a section that loops through the sorted data, compares two > adjacent rows at a time, and marks one of them for deletion if the > rows are identical. > > I'm using > > for i in range(len(records)-1): > r1 = records[i] > r2 = records

Re: Temporary variables in list comprehensions

2017-01-09 Thread Tim Chase
On 2017-01-09 04:59, Rustom Mody wrote: > What happens when the expensive is on an inner generator? > Something like: > > [expensive₂(y) for x in data for y in foo(x)] > > [The ₂ representing the 2 or more occurrences in Steven's eg] Well, if I understand your question correctly, the goal would

Re: Temporary variables in list comprehensions

2017-01-09 Thread Tim Chase
On 2017-01-09 13:16, Paul Rubin wrote: > Tim Chase writes: > >> result = [(tmp, tmp+1) for tmp in map(expensive_calculation, > >> data)] > > > > As charmingly expressive as map() is, the wildly different > > behavior in py3 (it's a generator that e

Re: Clickable hyperlinks

2017-01-09 Thread Tim Chase
On 2017-01-09 14:33, Deborah Swanson wrote: > Ok, here is the crux of this thread's communication problem. I > didn't ask, or particularly care for all these lectures on the > technology of terminal emulators. I asked how to code Python to > make clickable links. The crux of the problem is that wo

Re: Find and append file path

2017-01-12 Thread Tim Chase
On 2017-01-12 19:28, Iranna Mathapati wrote: > Example: > CLI Input: /root/user/branches/xyz > > find latest file and append to CLI path: > "/root/user/branches/xyz/Apple" I've used something like the below to find the most recent file in a directory tree (it also works for pulling other attribu

Re: Find and append file path

2017-01-12 Thread Tim Chase
On 2017-01-12 18:32, Peter Otten wrote: > Why did you add an explicit isdir() check? My understanding is that > the names in dirs are known to be directories. Ah, right. The code I had laying around that did something similar but processes both the dirs and the files, so when the OP asked for jus

Re: PEP 393 vs UTF-8 Everywhere

2017-01-21 Thread Tim Chase
On 2017-01-21 11:58, Chris Angelico wrote: > So, how could you implement this function? The current > implementation maintains an index - an integer position through the > string. It repeatedly requests the next character as string[idx], > and can also slice the string (to check for keywords like "

Re: PEP 393 vs UTF-8 Everywhere

2017-01-21 Thread Tim Chase
On 2017-01-22 01:44, Steve D'Aprano wrote: > On Sat, 21 Jan 2017 11:45 pm, Tim Chase wrote: > > > but I'm hard-pressed to come up with any use case where direct > > indexing into a (non-byte)string makes sense unless you've already > > processed/searched

Re: How coding in Python is bad for you

2017-01-23 Thread Tim Daneliuk
On 01/23/2017 11:24 AM, breamore...@gmail.com wrote: > The article is here http://lenkaspace.net/index.php/blog/show/111 > > Kindest regards. > > Mark Lawrence. > Beyond silly. Languages - like all tools - can be used properly or badly. -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-23 Thread Tim Daneliuk
On 01/23/2017 02:19 PM, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 6:59 AM, Grant Edwards > wrote: >> On 2017-01-23, breamore...@gmail.com wrote: >> >>> The article is here http://lenkaspace.net/index.php/blog/show/111 >> >> I don't really think any of his points are valid, but one way that

Re: How coding in Python is bad for you

2017-01-24 Thread Tim Chase
On 2017-01-24 20:04, Dennis Lee Bieber wrote: >>You don't know that. If this has been pasted from elsewhere, you >>need to match up the indentation level with the current code. > > So? The editor(s) I tend to use have the ability to shift > indent in/out for selected blocks. Do the paste, hi

Meta: mailing list, bounces, and SPF?

2017-02-03 Thread Tim Chase
Thanks to an abysmal failure of my hosting service (Site5), I was without email for multiple days, and when it came back up, the SPF record was pointed at the wrong place. I normally get a steady stream of comp.lang.python/python-list@ messages at my email address, so when they/I finally got thing

Re: Meta: mailing list, bounces, and SPF?

2017-02-03 Thread Tim Golden
On 03/02/2017 18:15, Tim Chase wrote: However, despite seeing messages appearing in the online archives, I'm not receiving anything via email. When I send a "subscribe" message to mailman, it responds telling me that I'm already subscribed (and checking the settings on the w

Can mock.mock_open.read return different values?

2018-03-12 Thread Tim Golden
I'm contributing to a codebase which makes heavy use of mock in the test suite, a technique which I'm aware of but have used only rarely. In one situation it uses mock.mock_open(read_data="...") and then asserts again mock_open.return_value.read.call_count. A code change I've made results in a

Re: 2.7 EOL = 2020 January 1

2018-03-13 Thread Tim Chase
On 2018-03-13 10:58, Terry Reedy wrote: > Two days later, Benjamin Peterson, the 2.7 release manager, replied > "Sounds good to me. I've updated the PEP to say 2.7 is completely > dead on Jan 1 2020." adding "The final release may not literally be > on January 1st". Am I the only one saddened by

Restore via pip to new OS

2018-03-14 Thread Tim Johnson
.txt? thanks -- Tim http://www.akwebsoft.com, http://www.tj49.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Restore via pip to new OS

2018-03-14 Thread Tim Johnson
* Paul Moore [180314 15:42]: > Use pip freeze rather than pip list. That will give you the > information in "requirements file" format that pip install -r can > read. > > On 14 March 2018 at 23:20, Tim Johnson wrote: <...> > > Can I duplicate the same

Re: Thank you Python community!

2018-03-19 Thread Tim Daneliuk
On 03/19/2018 02:05 PM, bartc wrote: > I've often wondered what the guys who invented C (around 1970) must have been  > smoking to have come up with some of those ideas. I dunno, but I do know that - if they were smoking something - it was rolled in greenbar paper ... -- https://mail.python.org/m

Pip Version Confusion

2018-03-24 Thread Tim Johnson
I'm on Ubuntu 16.04. I'm getting the following message from pip: You are using pip version 8.1.1, however version 9.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. # But then I get this : tim@linus:~/Downloads$ which pip /hom

Re: Pip Version Confusion

2018-03-24 Thread Tim Johnson
* Steven D'Aprano [180324 08:29]: > On Sat, 24 Mar 2018 07:40:17 -0800, Tim Johnson wrote: > > > I'm on Ubuntu 16.04. > > > > I'm getting the following message from pip: > > > > You are using pip version 8.1.1, however version 9.0.3 is availa

Re: Pip Version Confusion

2018-03-24 Thread Tim Johnson
* Tim Johnson [180324 10:32]: > * Steven D'Aprano [180324 08:29]: > > On Sat, 24 Mar 2018 07:40:17 -0800, Tim Johnson wrote: > > > > > I'm on Ubuntu 16.04. > > > > > > I'm getting the following message from pip: > > > > &g

Re: please test the new PyPI (now in beta)

2018-03-27 Thread Tim Golden
On 27/03/2018 11:06, Steven D'Aprano wrote: On Tue, 27 Mar 2018 10:48:15 +0100, Paul Moore wrote: By the way, on the search page: https://pypi.org/search/ it says "Enter a search query above, or select a filter from the list of classifiers on the left" but there is no such filter or list of

Re: please test the new PyPI (now in beta)

2018-03-28 Thread Tim Golden
On 28/03/2018 15:50, sumana.hariharesw...@gmail.com wrote: I'll give a bit of context on PyPI's new visual design, then talk about specific concerns folks have mentioned in this thread. [... snip ...] At the risk of sounding patronising, can I thank you for coming back to engage with the ideas

Re: Converting list of tuple to list

2018-03-29 Thread Tim Chase
On 2018-03-29 20:42, Ganesh Pal wrote: > I have a list of tuple say [(1, 2, 1412734464L, 280), (2, 5, > 1582956032L, 351), (3, 4, 969216L, 425)] . I need to convert the > above as ['1,2,1412734464:280', > '2,5,1582956032:351', '3,4,969216:425'] > > Here is my Solution , Any suggestion or optim

Re: Fwd: Python Import Impossibility

2018-04-20 Thread Tim Golden
people responding individually saying that images are stripped.  It's looking like a bit of a traffic increaser. My impression is that attachments are more common than 20 years ago. In a more draconian world, we could even bounce such messages. If Tim Golden does not reply to this,

Re: The perils of multiple Pythons

2018-04-30 Thread Tim Chase
On 2018-05-01 06:40, Chris Angelico wrote: >>> >> https://xkcd.com/1987/ >> >> I feel like this problem is pretty handily solved by virtual >> environments. Also, if a single project requires all of this, >> perhaps Python isn't the best choice for the project. > > Some of it is definitely solve

Re: Why exception from os.path.exists()?

2018-06-02 Thread Tim Chase
On 2018-06-02 00:14, Steven D'Aprano wrote: > Since /wibble doesn't exist, neither does /wibble/a\0b > > > py> os.path.exists("/wibble") > False > py> os.path.exists("/wibble/a\0b") > Traceback (most recent call last): > File "", line 1, in > File "/storage/torrents/torrents/python/Pytho

Re: Why exception from os.path.exists()?

2018-06-07 Thread Tim Chase
On 2018-06-07 22:46, Chris Angelico wrote: > On Thu, Jun 7, 2018 at 10:18 PM, Steven D'Aprano > 3. http://localhost:8000/te%00st.html > >>> Actually, I couldn't even get Chrome to make that request, so it > >>> obviously was considered by the browser to be invalid. It doesn't matter wheth

Re: Python web server weirdness

2018-06-07 Thread Tim Chase
On 2018-06-07 13:32, Steven D'Aprano wrote: > I'm following the instructions here: > > https://docs.python.org/3/library/http.server.html > > and running this from the command line as a regular unprivileged > user: > > python3.5 -m http.server 8000 > > What I expected was a directory listing of

Re: syntax difference

2018-06-20 Thread Tim Golden
[... snip discussions about Bart's language ...] Wearing my moderator hat Can we take the "Bart's language vs Python Show" to some other forum, please? We've already gone over this ground again and again and it isn't helping the signal-to-noise ratio here on the Python list / comp.lang.python

Re: Feeding the trolls

2018-06-22 Thread Tim Golden
On 22/06/2018 09:33, bart4...@gmail.com wrote: It costs me some genuine effort to make what I believe are relevant and interesting technical posts I thank you for at least taking that trouble. But I think that this is probably where the difference lies. This newsgroup/mailing list is primaril

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Tim Chase
On 2018-06-24 05:03, Steven D'Aprano wrote: > I'd like to run a quick survey. There is no right or wrong answer, > since this is about your EXPECTATIONS, not what Python actually > does. > > Given this function: > > def test(): > a = 1 > b = 2 > result = [value for key, value in local

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-25 Thread Tim Chase
On 2018-06-23 23:08, Jim Lee wrote: >>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote: def test(): a = 1 b = 2 result = [value for key, value in locals().items()] return result what would you expect the result of calling test() to be? >>>

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-26 Thread Tim Chase
From: Tim Chase On 2018-06-24 05:03, Steven D'Aprano wrote: > I'd like to run a quick survey. There is no right or wrong answer, > since this is about your EXPECTATIONS, not what Python actually > does. > > Given this function: > > def test(): > a = 1 >

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-26 Thread Tim Chase
From: Tim Chase On 2018-06-23 23:08, Jim Lee wrote: >>> On 06/23/2018 10:03 PM, Steven D'Aprano wrote: >>>> def test(): >>>> a = 1 >>>> b = 2 >>>> result = [value for key, value in locals().items()] >>>>

Re: Where's the junk coming from?

2018-06-28 Thread Tim Golden
On 28/06/2018 09:05, Kerr Avon wrote: On Wed, 27 Jun 2018 21:43:12 +1200, Avon wrote: Hey Cameron, Apologies for this. I have contacted the Fido system connected to the gateway I run into news.bbs.nz and have asked them to urgently sort / check what's up. If I don't get any joy from them withi

Re: PEP 526 - var annotations and the spirit of python

2018-07-02 Thread Tim Daneliuk
On 07/01/2018 12:17 PM, MRAB wrote: > On 2018-07-01 18:06, Abdur-Rahmaan Janhangeer wrote: >> was viewing pep526, so, finally, python cannot do without hinting the type >> as other languages? >> will python finally move to >> int x = 3 where int is a pre annotation? >> >> i am not arguing it's usef

Re: PEP 526 - var annotations and the spirit of python

2018-07-02 Thread Tim Daneliuk
On 07/02/2018 06:22 PM, Gregory Ewing wrote: > A > truly good programmer will be able to learn about the language > being used on the job. Except that the current attempt is to use techniques like agile, scrum, pair programming, and so forth to turn programming into a factory activity. High degre

Re: Is there a nice way to switch between 2 different packages providing the same APIs?

2018-07-05 Thread Tim Williams
On Thu, Jul 5, 2018 at 9:02 AM Mark Summerfield via Python-list < python-list@python.org> wrote: > For GUI programming I often use Python bindings for Qt. > > There are two competing bindings, PySide and PyQt. > > Ideally I like to have applications that can use either. This way, if I > get a prob

Re: Generate a static back-of-a-book style index?

2018-07-07 Thread Tim Chase
On 2018-07-08 12:12, Cameron Simpson wrote: > On 07Jul2018 20:11, Skip Montanaro wrote: > >> Have you looked at the ptx command? Might be called "gptx" > > > >Thanks, Cameron. I was unaware of it. Will check it out. > > BTW, it well predates the GNU coreutils; I used it on V7 UNIX. Interesti

Re: Generate a static back-of-a-book style index?

2018-07-08 Thread Tim Chase
On 2018-07-08 13:34, Cameron Simpson wrote: > On 07Jul2018 21:57, Tim Chase wrote: > >On 2018-07-08 12:12, Cameron Simpson wrote: > >> On 07Jul2018 20:11, Skip Montanaro > >> wrote: > >> >> Have you looked at the ptx command? Might be called "gp

Re: Guido van Rossum resigns as Python leader

2018-07-14 Thread Tim Daneliuk
On 07/14/2018 10:16 AM, Skip Montanaro wrote: >> Is it irrational to wonder whether projects should be looking to migrate to >> new languages? This kind of announcement makes me worry for the future. > > Umm, yeah. The language is stable, widely used packages are stable. > Guido actually has littl

Re: Cult-like behaviour [was Re: Kindness]

2018-07-14 Thread Tim Daneliuk
On 07/14/2018 04:09 AM, Christian Gollwitzer wrote: > I agree with this observation and it feels quite strange to me. I regularly > use three languages (C++, Python and Tcl), all three are under active > development, and IMHO all of them have flaws, there are is always something > which is elega

Re: Cult-like behaviour [was Re: Kindness]

2018-07-15 Thread Tim Daneliuk
On 07/14/2018 07:40 PM, Chris Angelico wrote: > You'd better avoid most of JavaScript, C++, and most other languages, > then. Every language feeps a little, and Python is definitely not as > bad as some. Point Of Order: C++ is one gigantic feep to be avoided at all costs... :) -- https://mail.pyt

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Tim Chase
On 2018-07-16 18:31, Steven D'Aprano wrote: > You say that all you want is a switch to turn off Unicode (and > replace it with what? Kanji strings? Cyrillic? Shift_JS? no of > course not, I'm being absurd -- replace it with ASCII, what else > could any right-thinking person want, right?). But we a

Re: Unicode [was Re: Cult-like behaviour]

2018-07-16 Thread Tim Chase
On 2018-07-16 23:59, Marko Rauhamaa wrote: > Tim Chase : > > While the python world has moved its efforts into improving > > Python3, Python2 hasn't suddenly stopped working. > > The sword of Damocles is hanging on its head. Unless a consortium is > erected to suppo

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Tim Chase
On 2018-07-17 01:08, Steven D'Aprano wrote: > In English, I think most people would prefer to use a different > term for whatever "sh" and "ch" represent than "character". The term you may be reaching for is "consonant cluster"? https://en.wikipedia.org/wiki/Consonant_cluster -tkc -- https:/

Re: Glyphs and graphemes [was Re: Cult-like behaviour]

2018-07-16 Thread Tim Chase
On 2018-07-17 01:21, Steven D'Aprano wrote: > > This doesn’t mean that UTF-32 is an awful system, just that it > > isn’t the magical cure that some were hoping for. > > Nobody ever claimed it was, except for the people railing that > since it isn't a magically system we ought to go back to the G

Moderator interjection [WAS: Re: What "cult-like behavior" meant]

2018-07-17 Thread Tim Golden
[Moderator hat on] Please. Step back. We've gone over and over this (and not for the first time). This has ceased to be a enlightening discussion into possibly interesting issues of Unicode implementation. It has effectively become a restatement of entrenched positions. If the key participa

Re: Unicode [was Re: Cult-like behaviour]

2018-07-17 Thread Tim Chase
On 2018-07-17 08:37, Marko Rauhamaa wrote: > Tim Chase : > > Wait, but now you're talking about vendors. Much of the crux of > > this discussion has been about personal scripts that don't need to > > marshal Unicode strings in and out of various functions/objec

Re: hello from a very excited and totally blind python programmer and game player

2018-07-25 Thread Tim Golden
Hi Daniel, I'm unsure how well your support tools will work with quoted emails. I'm going to place my answer below your text according to the convention on this list. On 24/07/2018 21:09, Daniel Perry wrote: Hi there everyone, my name is Daniel Perry and I'm a totally blind new Python user.

Re: ESR "Waning of Python" post

2018-10-12 Thread Tim Daneliuk
On 10/11/2018 12:15 AM, Gregory Ewing wrote: > Paul Rubin wrote [concerning GIL removal]: >> It's weird that Python's designers were willing to mess up the user >> language in the 2-to-3 transition but felt that the C API had to be kept >> sarcosanct.  Huge opportunities were blown at multiple leve

Re: ESR "Waning of Python" post

2018-10-12 Thread Tim Daneliuk
On 10/12/2018 11:43 AM, Skip Montanaro wrote: > I sort of skimmed ESR's post, and sort of skimmed this thread, so > obviously I'm totally qualified to offer my observations on the post > and follow ups. :-) Skip - In the 15-ish years I've been reading this group, this has NEVER been an obstacle f

Re: Accessing clipboard through software built on Python

2018-10-28 Thread Tim Daneliuk
't recall, but either clipboard or pyperclip have a way to get to them all IIRC ... HTH, -Tim -- https://mail.python.org/mailman/listinfo/python-list

Re: Accessing clipboard through software built on Python

2018-10-28 Thread Tim Daneliuk
On 10/28/2018 02:08 PM, Akkana Peck wrote: > Tim Daneliuk writes: >> However, the highlighted text must be copied explicitly: >> >> Highlight >> Ctl-C > [ ... ] >> X actually has several clipboard buffers and it can be tricky to get this >> going.

Re: Accessing clipboard through software built on Python

2018-10-28 Thread Tim Daneliuk
On 10/28/2018 02:08 PM, Akkana Peck wrote: > Tim Daneliuk writes: >> However, the highlighted text must be copied explicitly: >> >> Highlight >> Ctl-C > [ ... ] >> X actually has several clipboard buffers and it can be tricky to get this >> going.

<    5   6   7   8   9   10   11   12   13   14   >