Re: [Tutor] META: Moderation and subscription to the tutor list

2016-04-30 Thread boB Stepp
On Sun, May 1, 2016 at 12:35 AM, wrote: > On 01May2016 14:18, Steven D'Aprano wrote: >> >> Hi Alan, >> >> I thought I'd mention that the list-owners of "python-list" have now >> decided to only allow people to post if they are subscribed to the list: >> >> https://mail.python.org/pipermail/pytho

Re: [Tutor] META: Moderation and subscription to the tutor list

2016-04-30 Thread cs
On 01May2016 14:18, Steven D'Aprano wrote: Hi Alan, I thought I'd mention that the list-owners of "python-list" have now decided to only allow people to post if they are subscribed to the list: https://mail.python.org/pipermail/python-list/2016-April/707571.html The motivation is to ensure th

[Tutor] int(1.99...99) = 1 and can = 2

2016-04-30 Thread boB Stepp
Life has kept me from Python studies since March, but now I resume. Playing around in the interpreter I tried: py3: 1. 2.0 py3: 1.999 1.999 py3: int(1.) 2 py3: int(1.999) 1 It has been many years since I did problems in convertin

Re: [Tutor] Issue with Code [SOLVED]

2016-04-30 Thread Olaoluwa Thomas
Thank you so much, Alan. That fixed it (See Script 2[SOLVED] below). For the purpose of record-keeping, I'm pasting the entire code of all scripts below as I should have done from the very beginning. P.S. How were you able to open attachments with the restrictions on this mailing list? Script 1

[Tutor] META: Moderation and subscription to the tutor list

2016-04-30 Thread Steven D'Aprano
Hi Alan, I thought I'd mention that the list-owners of "python-list" have now decided to only allow people to post if they are subscribed to the list: https://mail.python.org/pipermail/python-list/2016-April/707571.html The motivation is to ensure that if people ask a question, and people re

Re: [Tutor] Sorting a list in ascending order [RESOLVED]

2016-04-30 Thread Steven D'Aprano
On Fri, Apr 29, 2016 at 07:05:27PM -0400, Ken G. wrote: > Martin: I have been using Python2 for several years now and I have yet > been able to change over to Python3. I am not together sure if Python3 > is now more stable to use and more commonly use. If so, I will gradually > change over but

Re: [Tutor] "List" object is not callable

2016-04-30 Thread Steven D'Aprano
On Sat, Apr 30, 2016 at 06:51:17PM +, Jason N. via Tutor wrote: > Hello, > I found this simple script online but when I execute it I get the > following error: "TypeError: 'list' object is not callable" Here is > the code sample: > > import subprocess > ls_output= subprocess.check_output(['di

Re: [Tutor] Issue with Code

2016-04-30 Thread Alan Gauld via Tutor
On 01/05/16 01:16, Alan Gauld via Tutor wrote: > I can't see anything obviously wrong in your code I was too busy focusing on the calculations that I didn't check the 'if' test closely enough. You need to convert your values from strings before comparing them. hours = float(raw_input ('How many

Re: [Tutor] Issue with Code

2016-04-30 Thread Matt Ruffalo
On 2016-04-30 11:30, Olaoluwa Thomas wrote: > I would appreciate a logical explanation for why the "else" statement in > the 2nd script isn't working properly. > > I'm running Python v2.7.8 on a Windows 7 Ultimate VM via Command prompt and > my scripts are created and edited via Notepad++ v6.7.3 >

Re: [Tutor] Is there a library which has this object?

2016-04-30 Thread Alan Gauld via Tutor
On 30/04/16 08:48, Yeh wrote: > start = input("please input the value of start: ") > end = input("please input the value of end: ") > dur = input("please input the value of dur: ") > array = np.linspace(float(start),float(end),1000) > dur = float(dur)/len(array) > for i in array: > print(float(i))

Re: [Tutor] Fwd: Issue with Code

2016-04-30 Thread Alan Gauld via Tutor
On 30/04/16 22:32, Olaoluwa Thomas wrote: > I sent this forwarded email earlier but hadn't subscribed to the mailing > list so I guess that's why I didn't get a response. When you first subscribe all messages are moderated so there is a delay. Plus remember that email is pretty much the lowest pr

Re: [Tutor] Issue with Code

2016-04-30 Thread Alan Gauld via Tutor
On 30/04/16 16:30, Olaoluwa Thomas wrote: > I've attached the scripts in question (created via Notepad++). attachments often get stripped by the mail system as a security risk. Since your code is very short just post it in the mail message as plain text. > The problem with this script is that th

[Tutor] Fwd: Issue with Code

2016-04-30 Thread Olaoluwa Thomas
Hi All, I sent this forwarded email earlier but hadn't subscribed to the mailing list so I guess that's why I didn't get a response. Please review and advise. *Warm regards,* *Olaoluwa O. Thomas,* *+2347068392705* -- Forwarded message -- From: Olaoluwa Thomas Date: Sat, Apr 30

Re: [Tutor] Is there a library which has this object?

2016-04-30 Thread Yeh
 > You need to post in plain text otherwise the mail system mangles your  > code, as you can see. I'm sorry for it. :( my code is: import time import numpy as np start = input("please input the value of start: ") end = input("please input the value of end: ") dur = input("please input the valu

[Tutor] Issue with Code

2016-04-30 Thread Olaoluwa Thomas
Hi, I'm new to Python and programming in general. I came across a simple exercise that is used to compute gross pay when prompted to enter number of hours and hourly rate. I've attached the scripts in question (created via Notepad++). The 1st script I wrote worked perfectly. The 2nd script makes

Re: [Tutor] "List" object is not callable

2016-04-30 Thread bob gailer
On 4/30/2016 3:27 PM, Alex Kleider wrote: On 2016-04-30 11:51, Jason N. via Tutor wrote: Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_o

Re: [Tutor] "List" object is not callable

2016-04-30 Thread Alex Kleider
On 2016-04-30 11:51, Jason N. via Tutor wrote: Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_output(['dir']) It works on my system: Ubun

[Tutor] "List" object is not callable

2016-04-30 Thread Jason N. via Tutor
Hello, I found this simple script online but when I execute it I get the following error: "TypeError: 'list' object is not callable" Here is the code sample:import subprocess ls_output= subprocess.check_output(['dir']) I searched online and found a another similar code sample (http://www.opentec

Re: [Tutor] Extracting bits from an array

2016-04-30 Thread Oscar Benjamin
On 30 Apr 2016 08:14, "Peter Otten" <__pete...@web.de> wrote: > > Peter Otten wrote: > > > Anish Kumar wrote: > > > >> Right shifting is well defined in Python? > > > > Yes. What might surprise someone used to fixed-size integers: > > > -1 >> 1 > > -1 > > > > Any negative int will eventually e

Re: [Tutor] Extracting bits from an array

2016-04-30 Thread Peter Otten
Peter Otten wrote: > Anish Kumar wrote: > >> Right shifting is well defined in Python? > > Yes. What might surprise someone used to fixed-size integers: > -1 >> 1 > -1 > > Any negative int will eventually end as -1: > -1234 >> 10 > -2 -1234 >> 11 > -1 I just checked and C work