Re: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-02, Python wrote: > > >>> from random import choice > >>> choice(words[choice(list(words.keys()))]) > 'apple' > >>> choice(words[choice(list(words.keys()))]) > 'kangaroo' > >>> choice(words[choice(list(words.keys()))]) > 'koala' > >>> choice(words[choice(list(words.keys()))]) > 'apple'

Re: A random word from one of two lists

2021-01-01 Thread Bischoop
On 2021-01-01, Cameron Simpson wrote: > > kinds = list(words.keys()) > Yes, solved it with that exeactly. -- thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Control stript which is runing in background.

2021-01-01 Thread Alan Bawden
jak writes: Il 01/01/2021 06:23, Alan Bawden ha scritto: > jak writes: > > Running the command: > > $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe > > the three texts do not mix > > The three texts do not mix as long a

Re: A random word from one of two lists

2021-01-01 Thread Marco Sulla
Try this: >>> animal = ['koala', 'kangaroo'] >>> fruit = ['banana', 'apple'] >>> words = {'animals': animal, 'fruits': fruit} >>> kinds = tuple(words.keys()) >>> kind = random.choice(kinds) >>> kind 'animals' >>> word = random.choice(words[kind]) >>> word 'koala' -- https://mail.python.org/mailma

Re: A random word from one of two lists

2021-01-01 Thread Cameron Simpson
On 01Jan2021 22:58, Bischoop wrote: >I have two lists *animal* and *fruit* and I try to get a random variable >animal or fruit and then random word from that list. >I thought that dictionary(*words*) could help me but no succes, the only way >I've >done partially what was with list *kinds* and by

Re: A random word from one of two lists

2021-01-01 Thread Richard Damon
On 1/1/21 5:58 PM, Bischoop wrote: > I have two lists *animal* and *fruit* and I try to get a random variable > animal or fruit and then random word from that list. > I thought that dictionary(*words*) could help me but no succes, the only way > I've > done partially what was with list *kinds* and

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 21:41:24 +0100, jak wrote: > Sorry if I made you argumentative ... And I didn't mean to be argumentative. :-) We both offered alternatives, and we both argued for them (in the sense of claiming that our own ideas were good). Each solution is better, depending on certain detai

A random word from one of two lists

2021-01-01 Thread Bischoop
I have two lists *animal* and *fruit* and I try to get a random variable animal or fruit and then random word from that list. I thought that dictionary(*words*) could help me but no succes, the only way I've done partially what was with list *kinds* and by using two times random.choice. However pr

Re: Funny error message

2021-01-01 Thread Bob van der Poel
> Assuming Python is maintained only at the system-level (cf --user or > > venv) then it may be possible that installing some application that > runs > > 'on' Python added the local-library (as a "dependency"). Alternately, > > many beginners following installation instructions on a

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 9:39 AM, Bob van der Poel wrote: > > > On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list > mailto:python-list@python.org>> wrote: > > On 1/2/21 6:35 AM, Bob van der Poel wrote: > > Found it! > > Well done! > > > >>     I had the proper urllib3 installed. But, i

Re: Control stript which is runing in background.

2021-01-01 Thread Cameron Simpson
On 01Jan2021 03:43, jak wrote: >Maybe the fact that I'm not English and I don't know the language well >doesn't allow me to express myself clearly. Try it one more time: >The OP would like to give some command to a script that is running. How? >With a script that sends commands to it. One of the w

Re: ANN: unicode 2.8

2021-01-01 Thread garabik-news-2005-05
Terry Reedy wrote: > On 12/31/2020 9:36 AM, garabik-news-2005...@kassiopeia.juls.savba.sk wrote: >> unicode is a simple python command line utility that displays >> properties for a given unicode character, or searches >> unicode database for a given name. > ... >> Changes since previous versions:

Re: Control stript which is runing in background.

2021-01-01 Thread jak
Il 01/01/2021 14:49, 2qdxy4rzwzuui...@potatochowder.com ha scritto: On 2021-01-01 at 11:11:47 +0100, jak wrote: Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto: On 2021-01-01 at 03:43:43 +0100, jak wrote: I think you were clear enough before, but you may not have consider

Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Fri, Jan 1, 2021 at 12:17 PM DL Neil via Python-list < python-list@python.org> wrote: > On 1/2/21 6:35 AM, Bob van der Poel wrote: > > Found it! > > Well done! > > > >> I had the proper urllib3 installed. But, in my .local/lib/ a > previous > >> version was installed. Removing .local/li

Re: Funny error message

2021-01-01 Thread DL Neil via Python-list
On 1/2/21 6:35 AM, Bob van der Poel wrote: > Found it! Well done! >> I had the proper urllib3 installed. But, in my .local/lib/ a previous >> version was installed. Removing .local/lib/python3.8 has resolved the >> problem. >> >> Anyone hazard a guess as to why I had a .local tre

Re: Funny error message

2021-01-01 Thread Bob van der Poel
Found it! > > I had the proper urllib3 installed. But, in my .local/lib/ a previous > version was installed. Removing .local/lib/python3.8 has resolved the > problem. > > Anyone hazard a guess as to why I had a .local tree (nope, I did not create > it ... I don't think!). > > > That is where "pyth

Re: Does windows edit .py file shebangs?

2021-01-01 Thread Eryk Sun
On 1/1/21, Barry Scott wrote: > I found python scripts have had their shebang lines edited behind my back. > > The shebang line I'm seeing is: > > #!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE > > Is this Microsoft being "helpful"? > Does anyone know what I will have done to

Re: Does windows edit .py file shebangs?

2021-01-01 Thread Abdur-Rahmaan Janhangeer
Greetings list, Being a windows user since long, this made me laugh. Tell me 1/ What version of Python are you running? 2/ What editor/IDE are you using? Kind Regards, Abdur-Rahmaan Janhangeer about | blog github

Re: Funny error message

2021-01-01 Thread Barry Scott
> On 1 Jan 2021, at 16:50, Bob van der Poel wrote: > > On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list < > python-list@python.org > wrote: > >> On 1/1/21 11:46 AM, Bob van der Poel wrote: >>> When I run python from the command line and generate an error

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott
> On 1 Jan 2021, at 16:42, Chris Angelico wrote: > > On Sat, Jan 2, 2021 at 3:36 AM Barry Scott > wrote: >> >> FYI this is what I have installed (lspy is a personal script): >> >> $ lspy >> /bin/python: 3.9.1 final 0 >> /bin/python2: 2.7.18 final 0 >> /bin/pyt

Re: Funny error message

2021-01-01 Thread Bob van der Poel
On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list < python-list@python.org> wrote: > On 1/1/21 11:46 AM, Bob van der Poel wrote: > > When I run python from the command line and generate an error I get the > > following: > > > > Python 3.8.5 (default, Jul 28 2020, 12:59:40) > > [GCC 9.3.0] on

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Chris Angelico
On Sat, Jan 2, 2021 at 3:36 AM Barry Scott wrote: > > FYI this is what I have installed (lspy is a personal script): > > $ lspy > /bin/python: 3.9.1 final 0 > /bin/python2: 2.7.18 final 0 > /bin/python2.7: 2.7.18 final 0 > /bin/python3: 3.9.1 final 0 > /bin/python3.10: 3.10.0 alpha 3 > /bin/python

Re: Funny error message

2021-01-01 Thread Bob van der Poel
It appears that a couple of things are happening ... and not being a python install expert by a long shot, none of it makes sense to me. But, let me first state that I've never screwed around with the python installation. I let the Ubuntu packager take care of that. - running "python -v" I get A

Does windows edit .py file shebangs?

2021-01-01 Thread Barry Scott
I found python scripts have had their shebang lines edited behind my back. The shebang line I'm seeing is: #!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE Is this Microsoft being "helpful"? Does anyone know what I will have done to best with this "help"? What do I need to d

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott
> On 29 Dec 2020, at 15:10, Chris Green wrote: > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > x[ubuntu] system? > > /usr/lib/python3 has just the dist-packages directory in it, > /usr/lib/python3.8 has lots of individual python files in it as well > as quite a number o

Re: help

2021-01-01 Thread Eryk Sun
On 1/1/21, Sibylle Koczian wrote: > > But that doesn't help, if the script raises an exception. In that case > the input() call won't be reached and the window will close anyway > before you could see anything. And in a script with errors that's even > worse. Same effect with the "run" window. Th

Re: Control stript which is runing in background.

2021-01-01 Thread 2QdxY4RzWzUUiLuE
On 2021-01-01 at 11:11:47 +0100, jak wrote: > Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto: > > On 2021-01-01 at 03:43:43 +0100, > > jak wrote: > > > > I think you were clear enough before, but you may not have > > considered things the OP did not specify. One of the hard

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread john steve
On Wednesday, December 30, 2020 at 9:03:28 AM UTC-8, Chris Green wrote: > Anssi Saari wrote: > > Chris Green writes: > > > > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > > > x[ubuntu] system? > > > > While it's more of an Ubuntu (or Debian) question better asked in s

Re: help

2021-01-01 Thread Sibylle Koczian
Am 31.12.2020 um 18:06 schrieb Mats Wichmann: What you're doing is going to give you probably unexpected results anyway. Here's why:  (when it's set up properly) when clicking from explorer Windows will create a window to run the Python interpreter in, and when your script finishes, Python quit

Plotting in python for Monte Carlo Method

2021-01-01 Thread Meghna Karkera
Dear Respected Sir May I request you to help me plot the number of histories versus standard deviation along with mean for integral of 2x dx from 0 to 5 abtained using the Monte Carlo python program. I've calculated the integral of 2x dx from 0 to 5 using the Monte Carlo method described in the f

Re: Control stript which is runing in background.

2021-01-01 Thread jak
Il 01/01/2021 04:14, 2qdxy4rzwzuui...@potatochowder.com ha scritto: On 2021-01-01 at 03:43:43 +0100, Regarding "Re: Control stript which is runing in background.," jak wrote: Il 01/01/2021 01:43, Cameron Simpson ha scritto: On 01Jan2021 01:21, jak wrote: Il 01/01/2021 00:58, 2qdxy4rzwzuui..

Re: Funny error message

2021-01-01 Thread Peter Otten
On 31/12/2020 23:46, Bob van der Poel wrote: When I run python from the command line and generate an error I get the following: Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. z /home/bob/.local/lib/pyth

Re: Control stript which is runing in background.

2021-01-01 Thread jak
Il 01/01/2021 06:23, Alan Bawden ha scritto: jak writes: Running the command: $ cat bible.txt > cmdpipe & cat bible.txt > cmdpipe & cat bible.txt > cmdpipe the three texts do not mix The three texts do not mix as long at the contents of bible.txt is short enough (and provide