Re: [Tutor] Inserting long URL's into comments & docstrings?

2019-08-05 Thread Ben Finney
dgement. -- \ “An expert is a man who has made all the mistakes which can be | `\ made in a very narrow field.” —Niels Bohr | _o__) | Ben Finney ___ Tutor mai

Re: [Tutor] Lengthy copyright notices?

2019-07-18 Thread Ben Finney
e for details” is notifying the reader without over-burdening them every time they open the file. -- \ “Theology is the effort to explain the unknowable in terms of | `\ the not worth knowing.” —Henry L. Mencken | _o__)

Re: [Tutor] Web framework module for Python.

2019-07-18 Thread Ben Finney
Initial Mystery that attends any journey is: how did the | `\ traveller reach his starting point in the first place?” —Louise | _o__) Bogan, _Journey Around My Room_ | Ben Finney ___ Tutor maillist - Tutor@pyt

[Tutor] Installing Python on Server

2019-06-18 Thread Ben Wadsworth
Hi, When installing Python on a windows server, will the server require a restart? Thank you! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Collating date data from a csv file

2019-05-13 Thread Ben Hancock via Tutor
s.read_sql` function to read data from a SQL database into a pandas dataframe, which you then can manipulate: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_sql.html Good luck! -- Ben Hancock https://elwha1.github.io ___ Tuto

Re: [Tutor] how to get the weeks of a month

2019-03-04 Thread Ben Finney
dar/days/> -- \ “I went to San Francisco. I found someone's heart.” —Steven | `\Wright | _o__) | Ben Finney __

[Tutor] Python Help

2018-10-26 Thread Ben Placella
I need to write code that runs a cost calculating program with many different variables and I honestly don't understand it, my code is: beefmeals=int(input("Enter number of beef meals: ")) shitmeals=int(input("Enter number of vegan meals: ")) party=beefmeals+shitmeals print(party) if party<=50 a=7

[Tutor] Python Help (shits killing me)

2018-10-26 Thread Ben Placella
So I have to make a fibonacci sequence, and I'm not sure what is wrong with my code #This program illustrates the fibonacci sequence nterms=int(input("Please enter how many terms you would like to know: ")) n1 = 1 n2 = 1 count = 0 if nterms <= 0: print("Please enter a positive integer") elif nterms

Re: [Tutor] understanding Python naming conventions & semantics

2018-08-15 Thread Ben Finney
y https://docs.python.org/3/glossary.html> can help with questions like this. -- \ “Not using Microsoft products is like being a non-smoker 40 or | `\ 50 years ago: You can choose not to smoke, yourself, but it's | _o__) hard to avoid second-hand sm

Re: [Tutor] Stuck on some basics re floats

2018-07-18 Thread Ben Finney
car in a tow-away zone. When I came back | `\ the entire area was missing.” —Steven Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subsc

Re: [Tutor] Choice of tools

2018-05-09 Thread Ben Finney
u're not | `\aiming high enough.” —Alan Kay | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription o

Re: [Tutor] Python HW question

2017-09-16 Thread Ben Finney
f you always want the latest and greatest, then you have to | `\ buy a new iPod at least once a year.” —Steve Jobs, MSNBC | _o__) interview 2006-05-25 | Ben Finney ___ Tutor maillist - Tutor@python.

Re: [Tutor] Select a string

2017-09-06 Thread Ben Southwell
ach "if" until the > problem became glaringly obvious. > > BTW, it isn't good to write tests like: > > if theo == True: > > "theo" a Boolean anyway. Just say: > > if theo: > > It reads more naturally as well. > > Cheers, > Came

Re: [Tutor] Select a string

2017-09-05 Thread Ben Finney
ignorant.” —Shaun Mason | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How does len() compute length of a string in UTF-8, 16, and 32?

2017-08-07 Thread Ben Finney
“In the long run, the utility of all non-Free software | `\ approaches zero. All non-Free software is a dead end.” —Mark | _o__)Pilgrim, 2006 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-07 Thread Ben Finney
to be nurtured by delusion.” | _o__) —Sam Harris, at _Beyond Belief 2006_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-04 Thread Ben Finney
rary Distutils. But not today. -- \ “Nothing is more sacred than the facts.” —Sam Harris, _The End | `\ of Faith_, 2004 | _o__) | Ben Finney ___

Re: [Tutor] setup.py "script" vs "console_scripts" Was: if __name__=='main' vs entry points: What to teach new comers?

2017-08-03 Thread Ben Finney
e know that ain't so.” —Artemus Ward | _o__) (1834–1867), U.S. journalist | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-02 Thread Ben Finney
st Law of Technology | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Daemons

2017-08-01 Thread Ben Finney
that, the definition is unlikely to help because it's making distinctions below the level you're used to thinking about. Did the Wikipedia article help? > In summary, and Ben will correct me if I'm wrong, a daemon is a > computer program that runs as a background task. That&#

Re: [Tutor] What is meaning of "/" in "pow(x, y, z=None, /)"?

2017-08-01 Thread Ben Finney
ne 1 def foo(lorem, /, ipsum): ^ SyntaxError: invalid syntax -- \ “Ignorance more frequently begets confidence than does | `\ knowledge.” —Charles Darwin, _The Descent of Man_, 1871 | _o__)

Re: [Tutor] if __name__=='main' vs entry points: What to teach new comers?

2017-08-01 Thread Ben Finney
t block as small as possible. Better than learning the idiom independently later on, and cramming half their program into that block :-/ -- \“But it is permissible to make a judgment after you have | `\examined the evidence. In some circles it is even encouraged.” | _o__)

Re: [Tutor] What is meaning of "/" in "pow(x, y, z=None, /)"?

2017-08-01 Thread Ben Finney
_Money: Whence It | _o__) Came, Where It Went_, 1975 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Daemons

2017-08-01 Thread Ben Finney
Profundis_, 1897 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Recommended Python Compiler

2017-07-30 Thread Ben Finney
ld quickly cease to become stranger than fiction, | `\ once we got as used to it.” —Henry L. Mencken | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-03 Thread Ben Finney
that easy. -- \ “Now Maggie, I’ll be watching you too, in case God is busy | `\ creating tornadoes or not existing.” —Homer, _The Simpsons_ | _o__) | Ben Finney ___ Tutor

Re: [Tutor] Coming from R, what's a good IDE editor? I've tried PyCharm and Spyder

2017-06-02 Thread Ben Finney
ill tired from the move. Day 2: Everybody | _o__) talks to me like I'm an idiot.’” —Steven Wright | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] sub-modules and python3

2017-05-31 Thread Ben Finney
Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using venv

2017-05-29 Thread Ben Finney
nities discussing how to do it. -- \ “I distrust those people who know so well what God wants them | `\to do to their fellows, because it always coincides with their | _o__) own desires.” —Susan Brownell Anthony, 1896 | Ben Finney _

Re: [Tutor] Another set question

2017-04-29 Thread Ben Finney
the status quo, | `\ or die trying. Either is better than actually WORKING for a | _o__) living.” —ringsnake.livejournal.com, 2007-11-12 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription

Re: [Tutor] Another set question

2017-04-29 Thread Ben Finney
Phil writes: > Thank you Ben and Martin for your detailed replies. I was debating > whether or not to post my question at all because it looked vague, > even to me. That's not the issue; the question was posed clearly enough. The problem is that your purpose is opaque, and we

Re: [Tutor] Another set question

2017-04-28 Thread Ben Finney
—_Pinky and The Brain_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Precision of floating-point number representation (was: Count for loops)

2017-04-11 Thread Ben Finney
Frustration_, H. G. Wells, 1936 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] asking about run the python 3 script in terminal

2017-04-03 Thread Ben Finney
o, and try to see what you're seeing when you do it – then we may be able to help. -- \ “To have the choice between proprietary software packages, is | `\ being able to choose your master. Freedom means not having a | _o__)master.” —Richard M. Stallman, 2

Re: [Tutor] pygrib issues involving wind

2017-02-28 Thread Ben Iannitelli
exactly, you might rule case sensitivity out. Traceback (most recent call last): File "testgrib.py", line 16, in uwind = grbs.select(name='U-Component of wind')[0] File "pygrib.pyx", line 609, in pygrib.open.select (pygrib.c:6175) ValueError: no matches found HTH, -Ben I. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] The benefits of a junior programmer (was: Learning Objectives?)

2017-02-28 Thread Ben Finney
“Firmness in decision is often merely a form of stupidity. It | `\indicates an inability to think the same thing out twice.” | _o__) —Henry L. Mencken | Ben Finney ___ Tutor maillist - Tutor@

Re: [Tutor] Test for type(object) == ???

2017-02-10 Thread Ben Finney
ll different. https://en.wikipedia.org/wiki/The_Treachery_of_Images> -- \ “Programs must be written for people to read, and only | `\incidentally for machines to execute.” —Abelson & Sussman, | _o__) _Structure and Interpretation of Computer Programs_ | Ben Finney

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-04 Thread Ben Finney
to a text file, and execute that. -- \ “Nature is trying very hard to make us succeed, but nature does | `\ not depend on us. We are not the only experiment.” —Richard | _o__) Buckminster Fuller, 1978-04-30 | Ben Finney __

Re: [Tutor] Lock File Usage

2017-02-01 Thread Ben Finney
“I think it would be a good idea.” —Mohandas K. Gandhi (when | `\asked what he thought of Western civilization) | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Lock File Usage

2017-01-30 Thread Ben Finney
cs.io/en/latest/examples.html#lock-decorator> seem to be what you want. -- \“… Nature … is seen to do all things Herself and through | `\ herself of own accord, rid of all gods.” —Titus Lucretius | _o__)

Re: [Tutor] file opened by open() are closed automaticaly

2017-01-14 Thread Ben Finney
ght that he is unwilling to accord to | `\ his fellow-men is dishonest and infamous.” —Robert G. | _o__) Ingersoll, _The Liberty of Man, Woman and Child_, 1877 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python code

2016-11-24 Thread Ben Finney
xley | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python Help

2016-11-16 Thread Ben Finney
en it.” —Steven | _o__) Wright | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Call an external program and capture its output (was: Q regarding external program calling)

2016-11-05 Thread Ben Finney
le.” —Mark Twain, _Pudd'n'head Wilson_ | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] tar a directory

2016-11-03 Thread Ben Finney
aviour. -- \ “Try to learn something about everything and everything about | `\ something.” —Thomas Henry Huxley | _o__) | Ben Finney ___ Tutor mai

Re: [Tutor] compress directory

2016-11-03 Thread Ben Finney
is, so | `\ why should they care about it?” —Thomas Hesse, Sony BMG, 2006 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: h

[Tutor] Turn off digest mode before participating in the forum (was: Module webbrowser.os)

2016-11-03 Thread Ben Finney
-- \ “The future always arrives too fast, and in the wrong order.” | `\—Alvin Toffler | _o__) | Ben Finney ___ Tutor mailli

Re: [Tutor] Assessing local variable outside function

2016-10-28 Thread Ben Finney
| _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What is wrong with my Python program that causes it to run but not give results?

2016-10-25 Thread Ben Finney
| _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Alternative to for/while loop

2016-10-25 Thread Ben Finney
to the end of a long stick.” | _o__) —Jack Handey | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Attaching program text to messages

2016-10-24 Thread Ben Finney
Intellectual property is to the 21st century what the slave | `\ trade was to the 16th.” —David Mertz | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

[Tutor] Attaching program text to messages (was: Python v3 Tkinter GUI program)

2016-10-24 Thread Ben Finney
e message. So I'd say that is inferior to attaching the program text. -- \ “Now Maggie, I’ll be watching you too, in case God is busy | `\ creating tornadoes or not existing.” —Homer, _The Simpsons_ | _o__)

[Tutor] How to employ a Python programmer to help (was: Help please)

2016-10-20 Thread Ben Finney
obs/>. -- \ “I was trying to daydream, but my mind kept wandering.” —Steven | `\Wright | _o__) | Ben Finney ___

Re: [Tutor] Passing functions as arguments to other functions

2016-09-30 Thread Ben Finney
ger, 2001-11-05 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Passing functions as arguments to other functions

2016-09-29 Thread Ben Finney
o education.” —Alvin | _o__)Toffler, _Future Shock_, 1970 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Google is not your friend (was: NumPy and SciPy)

2016-09-27 Thread Ben Finney
we can test our ideas.… But | `\ until we do, until we have data, it is just one more proposal.” | _o__) —Darren Saunders, 2015-12-02 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] python coding problem

2016-09-26 Thread Ben Finney
It does indeed cease executing the function, but that's because it continues elsewhere (back at the site where the function was called). -- \ “No smoothen the lion.” —lion cage, zoo, Czech Republic | `\

Re: [Tutor] Questions as to how to run the same unit test multiple times on varying input data.

2016-09-24 Thread Ben Finney
f fear.” —Mark Twain, _Pudd'n'head Wilson_ | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Running Python code without python installed

2016-08-27 Thread Ben Finney
sts can do to weaken the hold of | `\religion should be done and may in the end be our greatest | _o__) contribution to civilization.” —Steven Weinberg | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] project directory structure

2016-08-26 Thread Ben Finney
me at chess, but it was no match for me | `\ at kick boxing.” —Emo Philips | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] project directory structure

2016-08-25 Thread Ben Finney
s, so that all the small things go in the right | _o__) direction.” —Alvin Toffler | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] OOP help needed

2016-07-26 Thread Ben Finney
tance’. -- \ “I believe our future depends powerfully on how well we | `\ understand this cosmos, in which we float like a mote of dust | _o__) in the morning sky.” —Carl Sagan, _Cosmos_, 1980 | Ben Finney ___ Tutor

Re: [Tutor] Writing decorators?

2016-07-20 Thread Ben Finney
rec.humor.oracle.d | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Writing decorators?

2016-07-20 Thread Ben Finney
or English!” “Pff! English, who needs | `\ that? I'm never going to England!” —Barney & Homer, _The | _o__) Simpsons_ | Ben Finney ___ Tutor maillist - Tutor@python.org To uns

Re: [Tutor] Help with 'if' statement and the concept of None

2016-05-31 Thread Ben Finney
artily, but good men; the rest love | `\ not freedom, but license.” —John Milton | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Newcomer with organizational questions

2016-05-26 Thread Ben Finney
ole in issues of state | _o__)[of] a modern democracy.” —Lawrence M. Krauss, 2012-05-28 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Getting started in testing

2016-05-24 Thread Ben Finney
Terry Carroll writes: > Thanks to Alan, Danny, Albert-Jan and Ben for their suggestions. I've > now gotten my feet wet in unittest and have gone from not quite > knowing where to start to making substantial progress, with a small > suite of tests up and running. Great start!

Re: [Tutor] Python 3: string to decimal conversion

2016-05-21 Thread Ben Finney
any mangling. -- \ “Give a man a fish, and you'll feed him for a day; give him a | `\religion, and he'll starve to death while praying for a fish.” | _o__) —Anonymous | Ben Finney __

Re: [Tutor] Getting started in testing

2016-05-21 Thread Ben Finney
tart, or you may be more comfortable with Make. -- \“The problem with television is that the people must sit and | `\keep their eyes glued on a screen: the average American family | _o__) hasn't time for it.” —_The New York Times_, 1939 | Ben Finney ___

[Tutor] Never need to apologise for top-posting: just don't do it (was: Getting started in testing)

2016-05-21 Thread Ben Finney
ing machine in my car. It says, ‘I'm home now. | `\ But leave a message and I'll call when I'm out.’” —Steven Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.

Re: [Tutor] Python Homework

2016-05-01 Thread Ben Finney
“The best in us does not require the worst in us: Our love of | `\ other human beings does not need to be nurtured by delusion.” | _o__) —Sam Harris, at _Beyond Belief 2006_ | Ben Finney ___ Tutor maillist - Tutor@pyth

Re: [Tutor] def __init__(self):

2016-04-26 Thread Ben Finney
een as far as others, it is because giants were | `\ standing on my shoulders.” —Hal Abelson | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscr

Re: [Tutor] customizing dark_harvest problems

2016-04-07 Thread Ben Finney
ease not to read notice.” —hotel, | _o__) Kowloon, Hong Kong | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Declaring variables

2016-04-07 Thread Ben Finney
Apologize, v. To lay the foundation for a future offense.” | `\ —Ambrose Bierce, _The Devil's Dictionary_, 1906 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python OOP question

2016-04-02 Thread Ben Finney
Moriarty: “Forty thousand million billion dollars? That money | `\must be worth a fortune!” —The Goon Show, _The Sale of | _o__) Manhattan_ | Ben Finney ___ Tutor maillist - Tuto

Re: [Tutor] week 10 synthesizing assignment

2016-04-02 Thread Ben Finney
it seriously.” —Douglas Adams | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fw: About the Round Function

2016-04-01 Thread Ben Finney
them to sit down and shut up.” —Phyllis Diller | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How python keeps track of data types

2016-03-28 Thread Ben Finney
Kulawiec | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
boB Stepp writes: > On Sun, Mar 20, 2016 at 8:19 PM, Ben Finney > wrote: > > if rng is None: > > rng = random._inst > > > > which is the default RNG instance in the module. > > Can I not use: > > if rng is None: > rng = random.Random

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
Steven D'Aprano writes: > On Mon, Mar 21, 2016 at 12:18:01AM +1100, Ben Finney wrote: > > No, I meant what I wrote. The ‘rng’ parameter is expected to be > > bound to a RNG. If the caller has not specified a custom RNG > > instance, we bind ‘rng’ to the stan

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
boB Stepp writes: > On Sat, Mar 19, 2016 at 8:03 AM, Steven D'Aprano wrote: > > On Sat, Mar 19, 2016 at 04:05:58PM +1100, Ben Finney wrote: > >> if rng is None: > >> rng = random.random > > > > Typo: you want rng = random.

Re: [Tutor] How to test function using random.randint()?

2016-03-18 Thread Ben Finney
known seed. Hopefully you can take this as an example of how to better design systems so they don't have tightly-entangled external dependencies. -- \ “The good thing about science is that it's true whether or not | `\ you believe in it.” —Neil deGrasse Tyson, 2011-02-04 | _o__)

[Tutor] Code Problem

2016-03-10 Thread Ben Conklin
Hi, I'm having troubles with my code, specifically at the area with the comment mark. Basically you are to enter three sides of a triangle, and have it show if it is a equilateral, isosceles, or right triangle. I have it so that it makes s1 the longest side, and s2 and s3 the other 2 sides. The ri

Re: [Tutor] newbie in programming

2016-03-09 Thread Ben Finney
ve only joined recently; so they do not automatically benefit from past conversations here. -- \ “DRM doesn't inconvenience [lawbreakers] — indeed, over time it | `\ trains law-abiding users to become [lawbreakers] out of sheer | _o__)frustration.” —Charles Stros

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
g; where would you put it?” —Steven | `\Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
Ben Finney writes: > The first one is defined (by the syntax for literals) to create a > *single* string object. Semantically, the fragments are specifying one > object in a single step. > > The second is semantically (i.e. by the semantics of how such > expressions are defined

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
ution to mountains of waste is not more | `\ landfill sites but fewer shopping centres.” —Clive Hamilton, | _o__)_Affluenza_, 2005 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread Ben Finney
Ben Finney writes: > Hmm. That is a confusing inconsistency, I agree. It is deliberate, and > explicitly documented: > > Note that leading zeros in a non-zero decimal number are not > allowed. This is for disambiguation with C-style octal literals, > which Python u

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread Ben Finney
ion was made, and on the face of it I disagree. -- \“But it is permissible to make a judgment after you have | `\examined the evidence. In some circles it is even encouraged.” | _o__)—Carl Sagan, _The Burden of Skepticism_, 1987 | Ben Finney _

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread Ben Finney
e very interested to see that. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\Brain, but don't you need a swimming pool to play Marco Polo?” | _o__) —_Pinky and The Bra

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
Ben Finney writes: > In that case, my recommendation is to learn a good programmer's > editor, and let your students gain exposure to that. > > Emacs and Vim are the unchallenged masters here […] > > They aren't a small investment, though. […] it may be too much t

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
Ben Finney writes: > Short of [the heavyweights Vim and Emacs], I'd still recommend a > community-owned, free-software, highly flexible programmer's editor. > If you're on GNU+Linux, use the Kate or GEdit editors; they integrate > very nicely with the default desktop

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
Lisa Hasler Waters writes: > Ben, in terms of time for learning curve, I suppose we do have some > limitations as we are up against school schedules. However, if it is > something I could learn in a reasonable time that I could then more > quickly walk my students through then I

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
learn. -- \ “Unix is an operating system, OS/2 is half an operating system, | `\Windows is a shell, and DOS is a boot partition virus.” —Peter | _o__)H. Coffin | Ben Finney ___ Tutor ma

Re: [Tutor] library terminology and importing

2016-02-21 Thread Ben Finney
Namespaces are a honking good idea in Python, you should not seek to avoid them. -- \ “I may disagree with what you say, but I will defend to the | `\death your right to mis-attribute this quote to Voltaire.” | _o__) —A

[Tutor] Mock filesystem operations only for specific test doubles (was: mock file reader object)

2016-02-11 Thread Ben Finney
o/testing-in-python>. -- \ “I never forget a face, but in your case I'll be glad to make | `\ an exception.” —Groucho Marx | _o__) | Ben Finney _

Re: [Tutor] recursion

2016-02-05 Thread Ben Finney
the purpose. An opaque name like ‘n’ is not helpful. -- \ “Why doesn't Python warn that it's not 100% perfect? Are people | `\ just supposed to “know” this, magically?” —Mitya Sirenef, | _o__)

Re: [Tutor] recursion

2016-02-05 Thread Ben Finney
1 >>> "Z"[:i] + "Z"[i+1:] 'Z' Can you explain why that would be the case? -- \ “I think a good gift for the President would be a chocolate | `\ revolver. And since he's so busy, you'd pr

Re: [Tutor] Syntax for list comps

2016-02-03 Thread Ben Finney
unbearable.” —hotel, Bucharest | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Enumerate vs DictReader object manipulation:

2016-02-03 Thread Ben Finney
“The generation of random numbers is too important to be left | `\to chance.” —Robert R. Coveyou | _o__) | Ben Finney ___ Tutor maillist -

  1   2   3   4   >