Re: Installing python

2016-09-05 Thread alister
On Mon, 05 Sep 2016 12:46:58 -0700, emaraiza98 wrote: > I installed pycharm for a computer science class I'm taking, and also > downloaded python 3.5.2. However, my computer for some reason won't use > 3.5.2 and my professor told me I needed to download an earlier version > to change the project i

Re: libdivecomputer

2016-09-09 Thread alister
On Fri, 09 Sep 2016 02:26:02 -0700, Lawrence D’Oliveiro wrote: > On Wednesday, August 24, 2016 at 1:29:55 AM UTC+12, alister wrote: >> I already have an application that works fine (sub-surface) so this is >> more of a curiosity, delving into ctypes is not something I want to

Re: [Python-ideas] Inconsistencies

2016-09-12 Thread alister
On Mon, 12 Sep 2016 16:12:02 +0300, Marko Rauhamaa wrote: > "Eric S. Johansson" : > >> On 9/11/2016 10:26 PM, Chris Angelico wrote: >>> No, God isn't part of the universe, any more than an author is part of >>> his novel. >>> >> as any fiction writer will tell you, the author is found in one or m

Re: How to split value where is comma ?

2016-09-12 Thread alister
On Mon, 12 Sep 2016 14:30:32 +, Grant Edwards wrote: > On 2016-09-12, jmp wrote: >> On 09/11/2016 02:12 PM, Chris Angelico wrote: >>> On Thu, Sep 8, 2016 at 7:27 PM, Joaquin Alzola >>> wrote: > I have worked places where they put stuff like this at the bottom of > emails sent to the

Re: Why don't we call the for loop what it really is, a foreach loop?

2016-09-15 Thread alister
On Wed, 14 Sep 2016 22:01:34 -0700, Paul Rubin wrote: > Travis Griggs writes: >> for each in ['cake'] + ['eat', 'it'] * 2: >> print(each) > > https://pbs.twimg.com/media/Cr-edT2VUAArpVL.jpg the "Cowboy Song" buy Furrokh Bulsara -- Olmstead's Law: After all is said and do

Re: Oh gods can we get any more off-topic *wink* [was Re: [Python-ideas] Inconsistencies]

2016-09-15 Thread alister
On Wed, 14 Sep 2016 18:04:26 -0700, Chris Kaynor wrote: > On Wed, Sep 14, 2016 at 1:19 PM, wrote: > >> It is so blantantly obvious that the world is not flat I find this >> discussion flabbergasting. Anybody who has tried to take any form of >> vehicle up, or probably more dangerously down, any

Re: How to reduce the DRY violation in this code

2016-09-28 Thread alister
On Wed, 28 Sep 2016 01:49:56 +1000, Steve D'Aprano wrote: > I have a class that takes a bunch of optional arguments. They're all > optional, with default values of various types. For simplicity, let's > say some are ints and some are floats: > > > class Spam: > def __init__(self, bashful=10.

Re: How to make a foreign function run as fast as possible in Windows?

2016-09-28 Thread alister
On Tue, 27 Sep 2016 19:13:51 -0700, jfong wrote: > eryk sun at 2016/9/27 11:44:49AM wrote: >> The threads of a process do not share a single core. The OS schedules >> threads to distribute the load across all cores > > hmmm... your answer overthrow all my knowledge about Python threads > comp

Re: Is there a way to change the closure of a python function?

2016-09-28 Thread alister
On Wed, 28 Sep 2016 21:48:20 +1000, Steve D'Aprano wrote: > On Wed, 28 Sep 2016 08:03 pm, Lawrence D’Oliveiro wrote: > >> On Wednesday, September 28, 2016 at 9:53:05 PM UTC+13, Gregory Ewing >> wrote: >>> Essentially you write the whole program in continuation- >>> passing style, with a state obj

Re: Is that forwards first or backwards first? (Re: unintuitive for-loop behavior)

2016-10-03 Thread alister
On Mon, 03 Oct 2016 22:10:52 +1300, Gregory Ewing wrote: > Rustom Mody wrote: >> My new car goes in reverse when I put it in first gear but only on >> full-moon nights with the tank on reserve when the left light is >> blinking > > OT aside: When I went to take my current car (a manual) for a tes

Re: User Interface Suggestions? (newbie)

2016-10-05 Thread alister
On Wed, 05 Oct 2016 06:10:05 -0700, Beverly Howard wrote: > I'm new to Python, but have three decades of experience with FoxPro and > VFP plus I started programming in Basic and still comfortable with that. > > I have spent some time with Python and am now fairly familiar with the > syntax and fu

Re: Passing Variable to Function

2016-10-05 Thread alister
On Wed, 05 Oct 2016 19:17:33 +, John McKenzie wrote: > Hello, all. > > I have a function that takes three arguments, arguments to express an > RGB > colour. The function controls an LED light strip (a Blinkytape). > > Sometimes I might need to be change what colour is sent to the > funct

Re: I am comfused about the name behavior of Python in recursion

2016-10-06 Thread alister
On Wed, 05 Oct 2016 17:30:22 -0700, 380162267qq wrote: > Google told me Python name is a label attaching to the object. > But in this recursive function,the name 'a' will point to different > number object. > > def rec(a): > a+=1 if a<10: > rec(a) > print(a) > > rec(0)

Re: User Interface Suggestions? (newbie)

2016-10-06 Thread alister
On Wed, 05 Oct 2016 14:33:43 -0700, Beverly Howard wrote: >>> if it is a pi controlling the system I would tend towards controlling >>> it > from a web page via the network. to keep it updating would require AJAX > style programming of the web page. << > > Thanks. I am interested in eventually d

Re: BeautifulSoup help !!

2016-10-06 Thread alister
On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: > So I've just started up with python and an assignment was given to me by > a company as an recruitment task. > so by your own admission you have just started with python yet you consider your self suitable for employment? -- "Unibus

Re: BeautifulSoup help !!

2016-10-06 Thread alister
On Thu, 06 Oct 2016 08:50:25 -0700, Navneet Siddhant wrote: > On Thursday, October 6, 2016 at 9:00:21 PM UTC+5:30, alister wrote: >> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: >> >> > So I've just started up with python and an assignment was given

Re: BeautifulSoup help !!

2016-10-09 Thread alister
On Fri, 07 Oct 2016 03:12:32 +1100, Steve D'Aprano wrote: > On Fri, 7 Oct 2016 02:30 am, alister wrote: > >> On Thu, 06 Oct 2016 08:22:05 -0700, desolate.soul.me wrote: >> >>> So I've just started up with python and an assignment was given to me &g

Re: Passing Variable to Function

2016-10-09 Thread alister
On Fri, 07 Oct 2016 19:06:54 +, John McKenzie wrote: > Brendan and Alister, thank you both for responding. > > I am very inexperienced with python, but not new to computers so on my > own I realized the strings vs number mistake. (I seem to work with and > learn about Python

Re: Scripting Help please

2016-10-12 Thread alister
On Wed, 12 Oct 2016 13:37:23 -0700, LongHairLuke wrote: > Hi l am on my way to make a bot for the game Piano Tiles 2. > But the code l have written so far saids invalid syntax at 2nd line. > Here is my code: > > > > while True: >If active then > FFSnapShot(areaX, areaY + height - offs

Re: How make the judge with for loop?

2016-10-16 Thread alister
On Sat, 15 Oct 2016 22:23:29 -0700, 380162267qq wrote: > c="abcdefghijk" > len=len(c) > n is a int sb=[[] for i in range(n)] > > while (i < len) { > for (int j = 0; j < n && i < len; j++) > sb[j].append(c[i++]); > for (int j = n-2; j >= 1 && i < len; j--) // >

Re: Python rules!

2016-11-10 Thread alister
On Wed, 09 Nov 2016 20:45:45 -0600, Skip Montanaro wrote: > On Wed, Nov 9, 2016 at 7:53 PM, Chris Angelico wrote: >> It's called Jython. :) > > Well, sure, but that didn't look enough like Python, so no chance that I > would mistake it for Jython. I suspect that whoever worked out that > arrange

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 06:00:20 -0800, Cai Gengyang wrote: > CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame -bash: import: > command not found > > > please do not top post as it makes the threads difficult to follow the preferred style is interleave posing (posting a reply after the text yo

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 07:09:22 -0800, Cai Gengyang wrote: > Hmm, so whats the solution ? > > The solution is to bottom post or interleave post as previously stated > > On Thursday, November 24, 2016 at 11:07:05 PM UTC+8, alister wrote: >> On Thu, 24 Nov 2016 06:00:20 -080

Re: NameError

2016-11-24 Thread alister
On Thu, 24 Nov 2016 07:25:37 -0800, Cai Gengyang wrote: > I mean whats the solution to import pygame ? How to import pygame ? > > > On Thursday, November 24, 2016 at 11:22:07 PM UTC+8, alister wrote: >> On Thu, 24 Nov 2016 07:09:22 -0800, Cai Gengyang wrote: >> >>

Re: Parsing a potentially corrupted file

2016-12-14 Thread alister
On Wed, 14 Dec 2016 03:43:44 -0800, Paul Moore wrote: > I'm looking for a reasonably "clean" way to parse a log file that > potentially has incomplete records in it. > > The basic structure of the file is a set of multi-line records. Each > record starts with a series of fields delimited by [...

Re: python list index - an easy question

2016-12-18 Thread alister
On Sat, 17 Dec 2016 11:10:22 -0800, John wrote: > Hi, > >I am new to Python, and I believe it's an easy question. I know R and >Matlab. > > x=[1,2,3,4,5,6,7] x[0] > 1 x[1:5] > [2, 3, 4, 5] * > > My question is: what does x[1:5] mean? By Python

Re: python list index - an easy question

2016-12-18 Thread alister
On Sun, 18 Dec 2016 16:21:20 +, BartC wrote: > On 18/12/2016 10:59, Paul Götze wrote: >> Hi John, >> >> there is a nice short article by E. W. Dijkstra about why it makes >> sense to start numbering at zero (and exclude the upper given bound) >> while slicing a list. Might give a bit of additi

Re: Pexpect

2017-01-07 Thread alister
On Fri, 06 Jan 2017 12:00:32 +1200, Iranna Mathapati wrote: > Hi Team, > > How to match latter(caps and small) ,numbers and # symbol in python > pexpect. > > > Thanks, > Iranna M Simple just write a small program -- New screensaver released: Curtains for Windows. -- https://mail.python.

Re: Emulating Final classes in Python

2017-01-18 Thread alister
On Wed, 18 Jan 2017 13:10:41 +1100, Steven D'Aprano wrote: > On Tuesday 17 January 2017 20:37, Antoon Pardon wrote: > >> Op 17-01-17 om 08:05 schreef Steven D'Aprano: >>> I wish to emulate a "final" class using Python, similar to bool: >>> >>> py> class MyBool(bool): >>> ... pass ... >>> Trac

Re: How coding in Python is bad for you

2017-01-23 Thread alister
On Tue, 24 Jan 2017 07:19:42 +1100, 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

Re: How coding in Python is bad for you

2017-01-24 Thread alister
On Tue, 24 Jan 2017 08:11:02 +1100, Chris Angelico wrote: > On Tue, Jan 24, 2017 at 8:04 AM, Adam M > wrote: >> On Monday, January 23, 2017 at 3:41:17 PM UTC-5, Jon Ribbens wrote: >>> On 2017-01-23, alister wrote: >>> > On Tue, 24 Jan 2017 07:19:42 +1100, Chris

Re: How coding in Python is bad for you

2017-01-24 Thread alister
On Mon, 23 Jan 2017 20:39:26 +, Jon Ribbens wrote: > On 2017-01-23, alister wrote: >> On Tue, 24 Jan 2017 07:19:42 +1100, Chris Angelico wrote: >>> I believe that's "bad for you" in the sense that chocolate is bad for >>> you. >>> >>&

Re: How coding in Python is bad for you

2017-01-24 Thread alister
On Tue, 24 Jan 2017 14:28:55 +, Jon Ribbens wrote: > On 2017-01-24, alister wrote: >> On Mon, 23 Jan 2017 20:39:26 +, Jon Ribbens wrote: >>> That's a meaningless statement. *Everything* is a poison in sufficient >>> quantities. >> >> indees

Re: How coding in Python is bad for you

2017-01-25 Thread alister
On Tue, 24 Jan 2017 20:09:45 -0500, Dennis Lee Bieber wrote: > On Tue, 24 Jan 2017 16:03:45 GMT, alister > declaimed the following: > >>On Tue, 24 Jan 2017 14:28:55 +, Jon Ribbens wrote: >> >>> On 2017-01-24, alister wrote: >>>> On Mon, 23

Re: The argparse docs don't say who's responsible for closing FileType objects

2017-01-25 Thread alister
On Wed, 25 Jan 2017 07:16:24 -0800, Bob Kline wrote: > The subject line pretty much says it all. Should the programmer close > the file? If the programmer does that, and the user has asked that the > file object be hooked up to standard in (or standard out) what will > happen? If the programmer do

Re: best way to ensure './' is at beginning of sys.path?

2017-02-04 Thread alister
On Sat, 04 Feb 2017 09:19:38 -0600, Wildman wrote: > On Sat, 04 Feb 2017 11:27:01 +0200, Jussi Piitulainen wrote: > >> Wildman writes: >> >> [snip] >> >>> If anyone is interested the correct way is to add this to /etc/profile >>> (at the bottom): >>> >>> PATH=$PATH:./ >>> export PATH >> >> Out

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Alister
To: Abdur-Rahmaan Janhangeer From: Alister On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote: > i think he means like for a loop to iterate over a list you might do > > list = [1,2,3] > for i in range(len(list)): > print(list[i]) > > > but the you

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Alister
To: Mark Lawrence From: Alister On Mon, 25 Jun 2018 11:42:27 +0100, Mark Lawrence wrote: > On 25/06/18 10:10, Alister via Python-list wrote: >> On Mon, 25 Jun 2018 11:36:25 +0400, Abdur-Rahmaan Janhangeer wrote: >> >>> i think he means like for a loop to iterate

Re: The next major Python version will be Python 8

2016-04-01 Thread alister
On Fri, 01 Apr 2016 11:13:43 +1100, Chris Angelico wrote: > On Fri, Apr 1, 2016 at 11:09 AM, Ethan Furman > wrote: >> On 03/31/2016 05:02 PM, Roel Schroeven wrote: >>> >>> Victor Stinner schreef op 2016-03-31 23:40: >> >> Python 3 becomes more and more popular and is close to a dangerous >>>

Re: [beginner] What's wrong?

2016-04-03 Thread alister
On Sun, 03 Apr 2016 02:04:05 +0100, Mark Lawrence wrote: > On 03/04/2016 01:48, Steven D'Aprano wrote: >> On Sun, 3 Apr 2016 07:42 am, Michael Selik wrote: >> >>> Gaming also helps your reaction time. Normally 0.3 ms, but 0.1 ms for >>> top gamers. And fighter pilots. >> >> Does gaming help reacti

Re: Promoting Python

2016-04-05 Thread alister
On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote: > On Tue, Apr 5, 2016 at 3:31 AM, Rustom Mody > wrote: >> On Tuesday, April 5, 2016 at 12:53:13 PM UTC+5:30, Gordon( Hotmail ) >> wrote: >>> I am struggling to understand the basic principles of Python having >>> spent many years as a pure

Re: Promoting Python

2016-04-05 Thread alister
On Tue, 05 Apr 2016 19:47:00 +0100, BartC wrote: > On 05/04/2016 19:02, alister wrote: >> On Tue, 05 Apr 2016 08:06:02 -0400, Joel Goldstick wrote: > >>>>> REM BBC Basic FOR c = 1 TO 15 : COLOUR c >>>>>PRINT "Color ";c >>>>>

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread alister
On Fri, 08 Apr 2016 20:20:02 -0400, Dennis Lee Bieber wrote: > On Fri, 8 Apr 2016 11:04:53 -0700 (PDT), Rustom Mody > declaimed the following: > >>Its reasonably likely that all our keyboards start QWERT... >> Doesn't make it a sane design. >> > It was a sane design -- for early mechanical

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread alister
On Sat, 09 Apr 2016 20:13:15 +0100, Mark Lawrence wrote: > On 09/04/2016 01:43, Ben Finney wrote: >> Dennis Lee Bieber writes: >> >> > Yet another completely irrelevant thread that has nothing to do with > Python. As this is meant to be the main Python mailing list, why don't > the moderators pu

Re: IdentationError; unexpected indent

2016-04-13 Thread alister
On Wed, 13 Apr 2016 16:53:09 +0100, salma ammar wrote: > Hi, > > I am about to run this code using python 2.7. But when executing this > code, > an error appears (see attachement): IdentationError; unexpected indent > > What should I rectify to correct this error please? > > > *import sys* > *

Re: How to XOR a byte output?

2016-04-13 Thread alister
On Wed, 13 Apr 2016 06:18:22 -0700, durgadevi1 wrote: > Hi all, > > I have a doubt regarding a problem. > No, you have a question doubt means you don't believe something (sorry I know this is not an English language lesson) > First, I am required to read a given file. > > > The output from t

Re: Serious error in int() function?

2016-04-15 Thread alister
On Fri, 15 Apr 2016 12:05:18 +0100, John Pote wrote: > On 15/04/2016 03:38, Christian Gollwitzer wrote: >> Am 15.04.16 um 02:36 schrieb Dennis Lee Bieber: > I should also have said that the square root of integer squares with > between 15 and 30 decimal digits will only be correct if the s

Re: Guido sees the light: PEP 8 updated

2016-04-19 Thread alister
On Wed, 20 Apr 2016 01:50:00 +1000, Steven D'Aprano wrote: > Anyone who has played (say) Dungeons and Dragons, or other role-playing > games, will know that events with a probability of 1 in 20 occur very > frequently. To be precise, they occur one time in twenty. > Million to 1 chances happen 9 t

Re: Basic Concepts

2016-04-27 Thread alister
On Wed, 27 Apr 2016 11:29:12 +0200, Smith wrote: > Fill in the blanks to declare a variable, add 5 to it and print its > value: > > >>> x = 4 x_ = 5 print_ > > > Any suggestion ? > > Thanks 2 suggestions:- 1) Stay awake during your class so that you can complete basic homework assignments.

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

2016-04-28 Thread alister
On Fri, 29 Apr 2016 02:33:56 +1000, Steven D'Aprano wrote: > I have an application written in Python which accepts -h or --help to > show help. I can: > > (1) print the help text to stdout; > > (2) run the help text through a pager; > > (3) do something else? > > > Many command line tools sim

Have I ofended someone?

2016-04-28 Thread alister
I don't see my posts appearing, posting to news group using Pan on Linux. posts to other news groups are fine -- Just about every computer on the market today runs Unix, except the Mac (and nobody cares about it). -- Bill Joy 6/21/85 -- https://mail.python.org/mailman/listinfo/

Re: Have I ofended someone?

2016-04-28 Thread alister
On Thu, 28 Apr 2016 20:11:27 +, alister wrote: > I don't see my posts appearing, posting to news group using Pan on > Linux. > posts to other news groups are fine No just going blind Someone top-posted to my last reply & then everything got snipped to restore readability.

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

2016-05-01 Thread alister
On Sun, 01 May 2016 17:28:53 +1000, cs wrote: > On 01May2016 16:44, Chris Angelico wrote: >>On Sun, May 1, 2016 at 3:24 PM, wrote: >>> Yes, PAGER=cat would make "man" also not page, and likely almost >>> everything. >>> And yet I am unwilling to do so. Why? >>> >>> On reflection, my personal pr

Re: Whittle it on down

2016-05-06 Thread alister
On Thu, 05 May 2016 19:31:33 -0400, DFS wrote: > On 5/5/2016 1:39 AM, Stephen Hansen wrote: > >> Given: >> > input = [u'Espa\xf1ol', 'Health & Fitness Clubs (36)', 'Health Clubs > & Gymnasiums (42)', 'Health Fitness Clubs', 'Name', 'Atlanta city > guide', 'edit address', 'Tweet', 'PHY

Re: A fun python CLI program for all to enjoy!

2016-05-07 Thread alister
On Sat, 07 May 2016 18:24:45 +1200, Gregory Ewing wrote: > DFS wrote: >> Maybe it worked because the last time the file was written to was in a >> for loop, so I got lucky and the files weren't truncated? Don't know. > > It "works" because CPython disposes of objects as soon as they are not > re

Re: Python PygLatin

2016-05-08 Thread alister
On Mon, 09 May 2016 03:12:14 +1000, Steven D'Aprano wrote: > On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote: > >> If one looks at the Forbes List, you will see that there are 4 >> programmers amongst the top ten richest people in the world (Bill >> Gates, Mark Zuckerberg, Larry Ellison and Jeff

Re: Python PygLatin

2016-05-09 Thread alister
On Sun, 08 May 2016 11:01:58 -0700, Christopher Reimer wrote: > On 5/8/2016 10:53 AM, alister wrote: >> On Mon, 09 May 2016 03:12:14 +1000, Steven D'Aprano wrote: >> >>> On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote: >>> >>>> If one looks

Re: Python PygLatin

2016-05-09 Thread alister
On Sun, 08 May 2016 21:51:18 -0700, Cai Gengyang wrote: > I am guessing that the 2 you mentioned are Bill Gates and Larry Ellison > ? I heard that they have tons of lawsuits against them in their career > (anti-monopoly, anti-competitive laws filed against them both from the > government and from

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-12 Thread alister
On Tue, 10 May 2016 19:40:02 -0400, DFS wrote: > Sometimes I try to be a funny smart-aleck and it doesn't work. this is the problem everyone is having with your post, you acknowledge that it doesn't work so why keep trying. I too can fall guilty of this behavior (I can be a bit condescending of

Re: ValueError: I/O operation on closed file

2016-05-25 Thread alister
On Wed, 25 May 2016 05:29:53 -0700, San wrote: > Hi Gorup, > > why i am getting "ValueError: I/O operation on closed file" this error. > Pls let me know. > > Thanks in Advance. > san because you are trying to do something with a file that has been closed the error message is quite explanatory

Re: Coding systems are political (was Exended ASCII and code pages)

2016-05-28 Thread alister
On Sun, 29 May 2016 15:37:35 +1000, Steven D'Aprano wrote: > > [1] The worst being that my US English keyboard doesn't have a proper > curly apostrophe, forcing me to use a straight ' mark in my name like > some sort of animal. What do you expect after all US is standard engineering speak for Un

Re: Efficient handling of fast, real-time hex data

2016-06-02 Thread alister
On Thu, 02 Jun 2016 18:50:34 +1200, Gregory Ewing wrote: > jlada...@itu.edu wrote: >> One common data transmission error I've seen in other systems is >> added/dropped bytes. I may add a CRC-8 error-checking byte in place of >> the newline. > > Also maybe add a start byte with a known value at th

Re: Efficient handling of fast, real-time hex data

2016-06-02 Thread alister
On Thu, 02 Jun 2016 05:41:40 -0400, Gene Heskett wrote: > On Thursday 02 June 2016 04:13:51 alister wrote: > >> On Thu, 02 Jun 2016 18:50:34 +1200, Gregory Ewing wrote: >> > jlada...@itu.edu wrote: >> >> One common data transmission error I've seen in othe

Re: for / while else doesn't make sense

2016-06-10 Thread alister
On Thu, 09 Jun 2016 18:19:23 +1000, Steven D'Aprano wrote: > On Thursday 09 June 2016 10:34, Lawrence D’Oliveiro wrote: > >> In my undergraduate Comp Sci classes, we used to discuss arbitrary >> rules like limiting functions to n lines. With real-world experience, >> it soon became clear that suc

Re: for / while else doesn't make sense

2016-06-10 Thread alister
On Fri, 10 Jun 2016 15:31:11 +0300, Marko Rauhamaa wrote: > alister : > >> Or more simply a hard fixed RULE (MUST be less than X lines) is Bad. > > It's not X lines, it's "you must see the whole function at once." > > If your display can show

Re: for / while else doesn't make sense

2016-06-14 Thread alister
On Tue, 14 Jun 2016 12:43:35 +1000, Steven D'Aprano wrote: > > On this list, I daresay somebody will insist that if their computer is > on one of Jupiter's moons it will keep running fine and therefore I'm > wrong. > Anyone on a moon of Jupiter would not be able to get internet access (TCP/IP ti

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread alister
On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: > Hi everyone, > I am struggling writing a right regex that match what I want: > > Problem Description: > > Given a string like this: > > >>>string = "false_head aaa bbb false_tail \ > true_head some_text_here ccc ddd eee >

Re: python regex: variable length of positive lookbehind assertion

2016-06-15 Thread alister
On Wed, 15 Jun 2016 15:55:42 +0300, Jussi Piitulainen wrote: > alister writes: > >> On Tue, 14 Jun 2016 20:28:24 -0700, Yubin Ruan wrote: >> >>> Hi everyone, >>> I am struggling writing a right regex that match what I want: >>> >>>

Re: best text editor for programming Python on a Mac

2016-06-18 Thread alister
On Sat, 18 Jun 2016 12:40:09 +0300, Marko Rauhamaa wrote: > >> - integrated documentation so you don't have to lookup the syntax and >> arguments of a function > > I have seen that in action with eclipse and Java. It could never match > having a web browser window next to the editor window: htt

Re: (repost) Advisory: HTTP Header Injection in Python urllib

2016-06-18 Thread alister
On Sun, 19 Jun 2016 02:02:43 +1000, Steven D'Aprano wrote: > On Sat, 18 Jun 2016 01:52 pm, Random832 wrote: > >> On Fri, Jun 17, 2016, at 21:00, Steven D'Aprano wrote: >>> The author doesn't go into details of what sort of attacks against >>> localhost they're talking about. An unauthenticated se

Re: best text editor for programming Python on a Mac

2016-06-20 Thread alister
On Sun, 19 Jun 2016 07:23:15 -0600, Michael Torrie wrote: > On 06/19/2016 01:34 AM, Lawrence D’Oliveiro wrote: >> On Sunday, June 19, 2016 at 7:13:26 PM UTC+12, Christian Gollwitzer >> wrote: >> >>> Am 19.06.16 um 02:12 schrieb Lawrence D’Oliveiro: >>> But not vi/vim. It only lets you place

Re: while Loops

2016-06-22 Thread alister
On Tue, 21 Jun 2016 20:50:24 -0700, Elizabeth Weiss wrote: > i=1 while i<=5: >print(i) >i=i+1 > > The result is: > 1 > 2 > 3 > 4 > 5 > > Why is one of the results 5 since i=i+1? Should the maximum result be 4 > since 4 +1=5? > > Thanks for your help! check you loop condition while i le

Re: Break and Continue: While Loops

2016-06-23 Thread alister
On Wed, 22 Jun 2016 21:17:03 -0700, Elizabeth Weiss wrote: > CODE #1: > > i=0 while 1==1: >print(i) >i=i+1 if i>=5: > print("Breaking") break > > -- > I understand that i=0 and i will only be printed if 1=1 The results of > this is 0 > 1 > 2 > 3 > 4 > Breaking > > Why is Breaki

Re: Can math.atan2 return INF?

2016-06-23 Thread alister
On Thu, 23 Jun 2016 15:39:43 +0100, Ben Bacarisse wrote: > Steven D'Aprano writes: > >> On Thursday 23 June 2016 14:40, Dan Sommers wrote: >> Since x == y, the answer should be the same as for any other pair of x == y. >>> >>> When x == y == 0, then atan2(y, x) is 0. > > I see just a

Re: Question on compiling on linux

2016-06-28 Thread alister
On Mon, 27 Jun 2016 21:39:42 -0600, Michael Torrie wrote: > On 06/27/2016 08:28 PM, Steven D'Aprano wrote: >> On Tue, 28 Jun 2016 10:01 am, Dennis Lee Bieber wrote: >> >>> The Outlook style works well in a business environment where the >>> recipient is likely the original sender of the quoted te

Re: Can math.atan2 return INF?

2016-06-30 Thread alister
On Thu, 30 Jun 2016 09:24:43 +0300, Marko Rauhamaa wrote: > Lawrence D’Oliveiro : >> Every time somebody tries to point to an example of a “topic that is >> beyond the reach of science”, it seems to get knocked over eventually. > > Of course, an experiment trumps theory, always. > > > Marko in

Re: Creating a calculator

2016-07-01 Thread alister
On Fri, 01 Jul 2016 23:52:45 +1000, Steven D'Aprano wrote: > On Fri, 1 Jul 2016 10:25 pm, Christopher Reimer wrote: > >> For my BASIC interpreter, each line of BASIC is broken this way into >> tokens. > [...] >> By using * to unpack the split line, my program no longer crashes and >> no try/excep

Re: Quick poll: gmean or geometric_mean

2016-07-12 Thread alister
On Tue, 12 Jul 2016 15:17:58 -0700, Lawrence D’Oliveiro wrote: > On Monday, July 11, 2016 at 5:16:53 AM UTC+12, Ian wrote: > >> For local variables I usually wouldn't bother with the units, but in >> general it's a good practice to help avoid crashing your orbiter into >> Mars. > > The Mars Clim

Re: Quick poll: gmean or geometric_mean

2016-07-13 Thread alister
On Tue, 12 Jul 2016 18:42:44 -0700, Lawrence D’Oliveiro wrote: > On Wednesday, July 13, 2016 at 10:58:14 AM UTC+12, alister wrote: > >> a US gallon is smaller than an Imperial Gallon a US Mile is shorter >> than an Imperial mile and probably most importantly (because it

Re: Python code change

2016-07-18 Thread alister
On Sun, 17 Jul 2016 12:00:58 -0700, tsanchez117.ts wrote: > Im trying to run a Python application but im stuck on a problem. The > application requires a log in and password to run the application. The > only problem that I'm having is that the code was written to connect to > a data base and from

Re: Request for help

2016-07-18 Thread alister
On Mon, 18 Jul 2016 12:50:04 +0300, Eric kago wrote: > Hi Pythoners > > I need help in understanding hoe to put up the code to the following > command > > >- Create a constructor that takes in an integer and assigns this to a >`balance` property > > > > > Regards, > > Eric Kago +25

Re: Request for help

2016-07-19 Thread alister
On Tue, 19 Jul 2016 13:06:39 +1000, Steven D'Aprano wrote: > On Tue, 19 Jul 2016 06:20 am, alister wrote: > >> I suggest next time you stay awake during lessons. > > That's an uncalled for nasty comment. You don't know the O.P's issues or > why he is hav

Re: What exactly is "exact" (was Clean Singleton Docstrings)

2016-07-20 Thread alister
On Wed, 20 Jul 2016 02:09:58 +0300, Marko Rauhamaa wrote: > Ian Kelly : > >> Ah, the machinations that users of imperial units have to endure. > > Europeans often mistakenly believe that Americans haven't yet adopted > the SI units. They have: > > - the length of a ski is measured in centimete

Re: Why not allow empty code blocks?

2016-07-24 Thread alister
On Sun, 24 Jul 2016 19:14:10 +0100, BartC wrote: > On 24/07/2016 15:51, Chris Angelico wrote: >> On Mon, Jul 25, 2016 at 12:44 AM, BartC wrote: >>> Your attention is diverted, you're doing something on your desk, but >>> you hit one of the keys by mistake. You might have pressed Delete or >>> you

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 09:49:46 +1000, Chris Angelico wrote: > On Mon, Aug 1, 2016 at 9:43 AM, wrote: >> On Sunday, 31 July 2016 21:01:52 UTC+1, Michael Torrie wrote: >> >>> That said, I wish he'd stop posting his arguments here on this list as >>> he clearly doesn't use Python for anything, and h

Re: Why not allow empty code blocks?

2016-08-01 Thread alister
On Mon, 01 Aug 2016 01:05:53 -0700, bart4858 wrote: > On Monday, 1 August 2016 01:33:37 UTC+1, Chris Angelico wrote: >> On Mon, Aug 1, 2016 at 10:21 AM, wrote: > >> > However I do 'drive' as I've been programming for decades. And I can >> > have an opinion about a model of car that I don't nor

Re: Why not allow empty code blocks?

2016-08-03 Thread alister
On Wed, 03 Aug 2016 14:06:06 +, Grant Edwards wrote: > On 2016-08-03, Rustom Mody wrote: > >> The first nokia I used never crashed but could still run out of battery >> And the round-dial landlines of 30 years ago had not even that problem > > Yes, technically, it did. Except the batteries

Re: PyMyth: Global variables are evil... WRONG!

2013-11-12 Thread Alister
On Mon, 11 Nov 2013 18:06:09 -0800, Rick Johnson wrote: > > In this thread, i want to get to the bottom of this whole > "global-phobia" thing once and for all, and hopefully help you folks > understand that globals are not all that bad -- when DESIGNED and USED > correctly that is! it is the fin

Re: datetime question

2013-11-12 Thread Alister
On Tue, 12 Nov 2013 09:54:44 -0600, Tim Chase wrote: > On 2013-11-12 17:24, Ferrous Cranus wrote: >> But what of the server was in California and i live in Greece? >> >> How would datetime.now() work then? > > Best practices say to move the value from local time to UTC as soon as > possible, the

Re: To whoever hacked into my Database

2013-11-14 Thread Alister
On Thu, 14 Nov 2013 12:46:29 +0200, Ferrous Cranus wrote: >> This must have happened when i was handling my root passwords out in >> the open. >> >> Served me well. > At least you seem to be learning this lesson > > > Can somebody explain to me why there is so many failed attempts to login > int

Re: To whoever hacked into my Database

2013-11-14 Thread Alister
On Thu, 14 Nov 2013 15:24:32 +0200, Ferrous Cranus wrote: > Στις 14/11/2013 2:32 μμ, ο/η Alister έγραψε: >> On Thu, 14 Nov 2013 12:46:29 +0200, Ferrous Cranus wrote: >>>> This must have happened when i was handling my root passwords out in >>>> the open. >>

Re: Automation

2013-11-14 Thread Alister
On Thu, 14 Nov 2013 17:10:02 +, Mark Lawrence wrote: > On 14/11/2013 03:56, renato.barbosa.pim.pere...@gmail.com wrote: >> I apologize again for my bad english and any inconvenience that I have >> generated. >> >> > I do wish that people would stop apologising for poor English, it's an > extre

Re: PyMyth: Global variables are evil... WRONG!

2013-11-14 Thread Alister
On Thu, 14 Nov 2013 09:56:04 -0800, Ethan Furman wrote: > On 11/14/2013 09:37 AM, Joel Goldstick wrote: >> >> So, beyond that, what is the point of the thread? > > You haven't met Ranting Rick yet? He's a troll's troll, outdone only by > one other whose name I don't remember. > > His posts are,

Re: Automation

2013-11-15 Thread Alister
On Sat, 16 Nov 2013 02:12:16 +1100, Chris Angelico wrote: > On Sat, Nov 16, 2013 at 2:02 AM, Grant Edwards > wrote: >> And yes, people can _easily_ tell the difference between errors caused >> by being lazy/sloppy and errors caused by writing in a second language. > > Yes, and even among people

Re: Automation

2013-11-15 Thread Alister
On Fri, 15 Nov 2013 16:53:58 +, Neil Cerutti wrote: > On 2013-11-15, Steven D'Aprano > wrote: >> On Thu, 14 Nov 2013 20:03:44 +, Alister wrote: >>> As a native of England I have to agree it is far to arrogant to expect >>> everyone else to be able to s

Re: Automation

2013-11-15 Thread Alister
On Fri, 15 Nov 2013 20:12:27 +, Alister wrote: > On Fri, 15 Nov 2013 16:53:58 +, Neil Cerutti wrote: > >> On 2013-11-15, Steven D'Aprano >> wrote: >>> On Thu, 14 Nov 2013 20:03:44 +, Alister wrote: >>>> As a native of England I have t

Re: Automation

2013-11-19 Thread Alister
On Tue, 19 Nov 2013 22:58:35 +1100, Chris Angelico wrote: > On Tue, Nov 19, 2013 at 10:53 PM, Walter Hurry > wrote: >> On Tue, 19 Nov 2013 21:48:10 +1100, Chris Angelico wrote: >> >>> I guessed Scots for the second one because it didn't look Welsh and it >>> seemed plausible to get a mostly-Engli

Re: Automation

2013-11-19 Thread Alister
On Tue, 19 Nov 2013 23:52:09 +1100, Chris Angelico wrote: > On Tue, Nov 19, 2013 at 11:36 PM, Alister > wrote: >> the language & nationality is Scottish, the people are Scots & Scotch >> is a type of whisky. > > Hmm, I don't know that it's that c

Re: Automation

2013-11-19 Thread Alister
On Tue, 19 Nov 2013 23:52:09 +1100, Chris Angelico wrote: > On Tue, Nov 19, 2013 at 11:36 PM, Alister > wrote: >> the language & nationality is Scottish, the people are Scots & Scotch >> is a type of whisky. > > Hmm, I don't know that it's that c

Re: Automation

2013-11-19 Thread Alister
On Tue, 19 Nov 2013 23:52:09 +1100, Chris Angelico wrote: > On Tue, Nov 19, 2013 at 11:36 PM, Alister > wrote: >> the language & nationality is Scottish, the people are Scots & Scotch >> is a type of whisky. > > Hmm, I don't know that it's that c

<    1   2   3   4   5   6   7   8   >