Re: [Tutor] Parsing JSON with Python

2014-12-11 Thread Ben Finney
Alan Gauld writes: > On 11/12/14 23:15, Ben Finney wrote: > > >> *array = json.load( { "name": "Joe", "address": "111 Street" } )* > > > > You are passing a Python dict value to the function. JSON is a > > serialisation

[Tutor] Posting and quoting style (was: Learning to program, not code.)

2014-12-20 Thread Ben Finney
, until then, switch to a better client program. -- \ “To punish me for my contempt of authority, Fate has made me an | `\ authority myself.” —Albert Einstein, 1930-09-18 | _o__)

Re: [Tutor] Learning to program, not code.

2014-12-21 Thread Ben Finney
hours of 9 and 11 a.m. daily.” —hotel, Athens | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python script

2014-12-25 Thread Ben Finney
ou, and to everyone here good cheer. -- \ “If consumers even know there's a DRM, what it is, and how it | `\ works, we've already failed.” —Peter Lee, Disney corporation, | _o__) 2005 | Ben Finney __

Re: [Tutor] Python script

2014-12-26 Thread Ben Finney
Alex Kleider writes: > On 2014-12-25 16:59, Ben Finney wrote: > > > http://sscce.org/>. > > It may be that this link will go away. > http://www.coderanch.com/t/628405/Ranch-Office/SSCCE-org-document-disappearing Almost certainly at some future time, but not because o

Re: [Tutor] multiple objects with one assignment?

2015-01-02 Thread Ben Finney
to, the collection. -- \“Laurie got offended that I used the word ‘puke’. But to me, | `\ that's what her dinner tasted like.” —Jack Handey | _o__) | Ben Finney ___ Tutor

Re: [Tutor] PyDeadObjectError: MainFrame deleted

2015-01-14 Thread Ben Finney
t makes them secure from their customers.” —Cory | _o__) Doctorow, 2014-02-05 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Timing a python program

2015-01-16 Thread Ben Finney
nappropriate for religion to play any role 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

Re: [Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread Ben Finney
yeah, | `\ Brain, but where are we going to find rubber pants our size?” | _o__) —_Pinky and The Brain_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread Ben Finney
fast acting relief, try slowing down.” —Jane Wagner, via | `\ Lily Tomlin | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Does the Python way of doing things have a definite preference for the structure and content of program file header comments?

2015-01-22 Thread Ben Finney
Ben Finney writes: > I would consider it good practice to have a copyright statement and a > grant of license at the top; a handful of lines should suffice. > […] > But none of that belongs in the docstring. > > […] > There is PEP 257 https://www.python.org/dev/peps/pep-0

Re: [Tutor] functions first?

2015-01-26 Thread Ben Finney
—Richard Buckminster Fuller, _Critical Path_, 1981 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help writing code with python

2015-02-08 Thread Ben Finney
g me because I'm gay.” | _o__) —postsecret.com, 2010-01-19 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need help writing code with python

2015-02-08 Thread Ben Finney
it does mystify me that otherwise intelligent people take | _o__) 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] OT: Preferred email client for sending plain text programming code snippets

2015-02-17 Thread Ben Finney
oever procures | `\it at the expense of ten thousand desires makes a wise and | _o__) happy purchase.” —J. Balguy | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Topic focus of ‘python-tutor’ (was: mySQL and Python)

2015-02-18 Thread Ben Finney
p.lang.python’. So it is evident that your needs are already met :-) -- \“[R]ightful liberty is unobstructed action, according to our | `\will, within limits drawn around us by the equal rights of | _o__) others.” —Thomas Jefferson, 1819 | Ben Finney

Re: [Tutor] unittest for: Raises an exception

2015-02-18 Thread Ben Finney
ake code more elegant and readable. They might seem a little magic for now if you haven't learned about them yet, but this is a good demonstration of the improvement they can make. -- \ “… one of the main causes of the fall of the Roman Empire was | `\ that, l

Re: [Tutor] Suggestions on pyserial for RS232 com monitor?

2015-02-18 Thread Ben Finney
in programming Python. -- \ “For fast acting relief, try slowing down.” —Jane Wagner, via | `\ Lily Tomlin | _o__) | Ben Finney ___

Re: [Tutor] BinaryTrees

2015-02-28 Thread Ben Finney
in time.” —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] How linux software centers make “search” operation?

2015-03-11 Thread Ben Finney
doing this? -- \ “I never forget a face, but in your case I'll be glad to make | `\ an exception.” —Groucho Marx | _o__) | Ben Finney ___

Re: [Tutor] passing dictionaries through a file

2015-03-16 Thread Ben Finney
several serialisation / persistence tools. https://docs.python.org/3/library/persistence.html> -- \ “Software patents provide one more means of controlling access | `\ to information. They are the tool of choice for the internet | _o__) highwayma

Re: [Tutor] set current working dir

2015-03-16 Thread Ben Finney
as I am about fairies and the | `\ Flying Spaghetti Monster.” —Richard Dawkins, 2006-10-13 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or chang

Re: [Tutor] What is the best approach to organizing the order of functions in a module?

2015-03-19 Thread Ben Finney
t | _o__) goes downhill from there.” —Will Larson, 2008-11-04 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Semantic division of source code with U+000C FORM FEED (was: What is the best approach to organizing the order of functions in a module?)

2015-03-19 Thread Ben Finney
(Since this has moved beyond “tutor” material, I'm redirecting to the ‘python-list’ forum; anyone interested, please follow up there.) Steven D'Aprano writes: > On Fri, Mar 20, 2015 at 09:09:16AM +1100, Ben Finney wrote: > > > Use a page break (the U+000C FORM FEED) whit

Re: [Tutor] Python OO

2015-03-28 Thread Ben Finney
long. So, those classes should be named ‘Actor’, ‘Movie’, ‘Series’. -- \ “I thought I'd begin by reading a poem by Shakespeare, but then | `\ I thought ‘Why should I? He never reads any of mine.’” —Spike | _o__)

Re: [Tutor] What is wrong with my code?

2015-03-29 Thread Ben Finney
an is not a state.… a state must have people. There | `\are no Vaticanians.… No-one gets born in the Vatican except by | _o__)an unfortunate accident.” —Geoffrey Robertson, 2010-09-18 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] How do I make pattern to find only '.html' file using Python Regular Expression?

2015-04-01 Thread Ben Finney
stakes which can be | `\ made in a very narrow field.” —Niels Bohr | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail

Re: [Tutor] python3.4m

2015-04-02 Thread Ben Finney
e the author is right | `\ there, in the room talking to you, which is why I don't like to | _o__) read good books.” —Jack Handey | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change

[Tutor] Please disable “digest” mode in order to participate (was: Tutor Digest, Vol 134, Issue 32 - amazing range)

2015-04-12 Thread Ben Finney
`\ But it does mystify me that otherwise intelligent people take | _o__)it seriously.” —Douglas Adams | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-12 Thread Ben Finney
Laura Creighton writes: > In a message of Sun, 12 Apr 2015 18:05:16 +1000, Ben Finney writes: > >Please disable that in order to receive individual messages, so you > >can participate properly: responding to individual messages that the > >rest of us see. > > Or se

Re: [Tutor] still breaking chains

2015-04-12 Thread Ben Finney
s. Chaining long strings of operations together in a single statement goes directly against that principle, and hence is to be avoided. -- \ “[T]he speed of response of the internet will re-introduce us | `\to that from which our political systems have separated us for | _o_

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-13 Thread Ben Finney
keeping the attribution lines matching the quoted material helps to make sense of it all. -- \ “The long-term solution to mountains of waste is not more | `\ landfill sites but fewer shopping centres.” —Clive Hamilton, | _o__)

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

[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] 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

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-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] 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] 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] 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] 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] 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] 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] 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] 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
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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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

[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

[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

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] 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] 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

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] 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

[Tutor] Memory management in Python

2014-11-26 Thread Mohamed Ben Mosbah
Hi I'm new to Python and I would like to know how he deals with memory space. I thought I had understood but I made a test and the results were uncoherenent with my understanding, here is the thing: >>> a=[1,2] >>> l=[a,a] >>> id(a); id(l[0]); id(l[1]); 61659528 61659528 61659528 >>> #All Have the

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

<    1   2   3   4