Re: Python homework

2017-12-13 Thread Lorenzo Sutton
Hi, On 05/12/17 06:33, nick martinez2 via Python-list wrote: I have a question on my homework. My homework is to write a program in which the computer simulates the rolling of a die 50 times and then prints (i). the most frequent side of the die (ii). the average die value of all rolls. For t

Re: request fails on wikipedia (https) - certificate verify failed (Posting On Python-List Prohibited)

2017-12-13 Thread Jon Ribbens
On 2017-12-13, Lawrence D’Oliveiro wrote: > On Wednesday, December 13, 2017 at 10:17:15 AM UTC+13, Jon Ribbens wrote: >> Try `pip install certifi` > > It really is preferable to install standard distro packages where available, > rather than resort to pip: > > sudo apt-get install python3-cer

Re: request fails on wikipedia (https) - certificate verify failed (_ss

2017-12-13 Thread Jon Ribbens
On 2017-12-11, F Massion wrote: > Am Dienstag, 12. Dezember 2017 14:33:42 UTC+1 schrieb Jon Ribbens: >> On 2017-12-11, F Massion wrote: >> > ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed > (_ssl.c:748) >> >> Try `pip install certifi` > > certifi was installed. > If I ma

Re: request fails on wikipedia (https) - certificate verify failed (Posting On Python-List Prohibited)

2017-12-13 Thread Chris Angelico
On Wed, Dec 13, 2017 at 10:38 PM, Jon Ribbens wrote: > On 2017-12-13, Lawrence D’Oliveiro wrote: >> On Wednesday, December 13, 2017 at 10:17:15 AM UTC+13, Jon Ribbens wrote: >>> Try `pip install certifi` >> >> It really is preferable to install standard distro packages where available, >> rather

Re: request fails on wikipedia (https) - certificate verify failed (Posting On Python-List Prohibited)

2017-12-13 Thread Antoon Pardon
Op 13-12-17 om 13:01 schreef Chris Angelico: > On Wed, Dec 13, 2017 at 10:38 PM, Jon Ribbens > wrote: >> On 2017-12-13, Lawrence D’Oliveiro wrote: >>> On Wednesday, December 13, 2017 at 10:17:15 AM UTC+13, Jon Ribbens wrote: Try `pip install certifi` >>> It really is preferable to install s

Re: request fails on wikipedia (https) - certificate verify failed (Posting On Python-List Prohibited)

2017-12-13 Thread Chris Angelico
On Wed, Dec 13, 2017 at 11:26 PM, Antoon Pardon wrote: > Op 13-12-17 om 13:01 schreef Chris Angelico: >> On Wed, Dec 13, 2017 at 10:38 PM, Jon Ribbens >> wrote: >>> On 2017-12-13, Lawrence D’Oliveiro wrote: On Wednesday, December 13, 2017 at 10:17:15 AM UTC+13, Jon Ribbens wrote: > Try

Re: Python homework

2017-12-13 Thread boffi
nick.martin...@aol.com (nick martinez2) writes: > def rollDie(number): > rolls = [0] * 6 > for i in range(0, number): > roll=int(random.randint(1,6)) > rolls[roll - 1] += 1 > return rolls def rollDie(number): from random import choices return choices((1,2,3,4,5

Re: request fails on wikipedia (https) - certificate verify failed (Posting On Python-List Prohibited)

2017-12-13 Thread Jon Ribbens
On 2017-12-13, Chris Angelico wrote: > On Wed, Dec 13, 2017 at 10:38 PM, Jon Ribbens > wrote: >> On 2017-12-13, Lawrence D’Oliveiro wrote: >>> On Wednesday, December 13, 2017 at 10:17:15 AM UTC+13, Jon Ribbens wrote: Try `pip install certifi` >>> >>> It really is preferable to install stan

Re: Python homework

2017-12-13 Thread paul
from random import randint rolls = [randint(1, 6) for x in range(50)] print("Average: %s" % (sum(rolls) / len(rolls))) print("Most Common: %s" % max(rolls, key=rolls.count)) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python homework

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 3:23 AM, wrote: > from random import randint > > rolls = [randint(1, 6) for x in range(50)] > print("Average: %s" % (sum(rolls) / len(rolls))) > print("Most Common: %s" % max(rolls, key=rolls.count)) Great demo of a bad algorithm. :) ChrisA -- https://mail.python.org/ma

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread eryk sun
On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: > > A Windows equivalent would be to have a .py file associated normally > with the regular console, but some individual ones associated with > pythonw.exe - without renaming them to .pyw. AFAIK there is no way to > do this on Windows short of

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 7:56 AM, eryk sun wrote: > On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: >> >> A Windows equivalent would be to have a .py file associated normally >> with the regular console, but some individual ones associated with >> pythonw.exe - without renaming them to .pyw

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread eryk sun
On Wed, Dec 13, 2017 at 9:04 PM, Chris Angelico wrote: > On Thu, Dec 14, 2017 at 7:56 AM, eryk sun wrote: >> On Wed, Dec 13, 2017 at 5:43 AM, Chris Angelico wrote: >>> >>> A Windows equivalent would be to have a .py file associated normally >>> with the regular console, but some individual ones

Re: Python homework

2017-12-13 Thread ROGER GRAYDON CHRISTMAN
On Wed, Dec 13, 2017, Lorenzo Sutton wrote: > On 05/12/17 06:33, nick martinez2 via Python-list wrote: >> I have a question on my homework. My homework is to write a program in >which >> the computer simulates the rolling of a die 50 times and then prints >> (i). the most frequent side of the die (

Re: Python homework

2017-12-13 Thread Terry Reedy
On 12/13/2017 8:28 AM, bo...@choices.random.py wrote: nick.martin...@aol.com (nick martinez2) writes: def rollDie(number): rolls = [0] * 6 for i in range(0, number): roll=int(random.randint(1,6)) One could just as well use randint(0, 5) and skip the -1 below. rol

ANN: Wing Python IDE v. 6.0.9 released

2017-12-13 Thread Wingware
Hi, We've just released Wing 6.0.9, which adds support for Vagrant, improves support for Django and Plone, further improves remote development, fixes startup problems seen on some OS X systems, and makes about 35 other improvements. For details, see https://wingware.com/pub/wingide/6.0.9/CHA

Re: Python homework

2017-12-13 Thread jladasky
On Thursday, December 7, 2017 at 7:11:18 AM UTC-8, Rhodri James wrote: > Sigh. Please don't do people's homework for them. It doesn't teach > them anything. Now Nick had got 90% of the way there and shown his > working, which is truly excellent, but what he needed was for someone to > hint a

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Rick Johnson
On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: [...] > That said, I don't see this feature as being very useful > compared to just using "open with" when I occasionally need > to open a file with a non-default program. That's the point i was trying to make, but i think it may

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson wrote: > On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: > [...] >> That said, I don't see this feature as being very useful >> compared to just using "open with" when I occasionally need >> to open a file with a non-default progra

Re: Python GUI application embedding a web browser - Options?

2017-12-13 Thread yuriv1127
On Wednesday, October 19, 2016 at 3:08:15 AM UTC-7, Paul Moore wrote: > I'm looking to write a GUI application in Python (to run on Windows, using > Python 3.5). The application is just a relatively thin wrapper around a > browser - it's presenting an existing web application, just in its own wi

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Christian Gollwitzer
Am 14.12.17 um 02:55 schrieb Chris Angelico: On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson wrote: On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: [...] That said, I don't see this feature as being very useful compared to just using "open with" when I occasionally need to o

Re: Please tell me how to execute python file in Ubuntu by double

2017-12-13 Thread Chris Angelico
On Thu, Dec 14, 2017 at 5:44 PM, Christian Gollwitzer wrote: > Am 14.12.17 um 02:55 schrieb Chris Angelico: >> >> On Thu, Dec 14, 2017 at 12:35 PM, Rick Johnson >> wrote: >>> >>> On Tuesday, December 12, 2017 at 10:42:54 PM UTC-6, eryk sun wrote: >>> [...] That said, I don't see this fe