mattharrison / tiny-python-3.6-notebook Goto Github PK
View Code? Open in Web Editor NEWThis repository contains the text for the Tiny Python 3.6 Notebook.
This repository contains the text for the Tiny Python 3.6 Notebook.
>>> name = 'Wizard'
>>> f'Hello, {name}!'
'Hello, Wizard!'
I found it's missed.
The Tiny Notebook would be easier to read and handle if it were a smidge larger, including the font size.
Current physical size is 6 inches by 4.
Would be nice if it were an inch taller to fit more content vertically (feels too short to me as it is). A half inch wider to have more inner margin space, and to possibly reduce the number of line breaks in tables (though an increase in font size might negate this).
Also, the font is rather small, and the code font particularly so. I find it a bit difficult to read, but I understand it's difficult to fit monospace code examples if the font were made larger. Is there a narrower monospace font available?
A possible drawback to increasing the book's dimensions: it would probably no longer easily fit into a pocket. I don't know if that's something readers want. I personally have no reason to have it in my pocket.
In set methods, the result of "s.issuperset(s2)" should be "All elements of s2 in s". Anyway, this is a great book!
Hi, I found this tiny python summary very helpful for catching up with the language.
During an online course I stumbled upon the file modes of the 'open()' method. The "r+" and "w+" file modes seem to be missing in this book. The only "+" mode which is mentioned is "w+b".
I think adding the "r+", "w+", "rb+", "a+" and "ab+" modes would be helpful. (Especially the difference between "r+" and "w+" is not obvious.)
From python help:
`
========= ====
Character Meaning
'r' open for reading (default)
'w' open for writing, truncating the file first
'x' create a new file and open it for writing
'a' open for writing, appending to the end of the file if it exists
'b' binary mode
't' text mode (default)
'+' open a disk file for updating (reading and writing)
'U' universal newline mode (deprecated)
========= ====`
From: https://stackoverflow.com/a/23566951
`
r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode.
rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode.
r+ Opens a file for both reading and writing. The file pointer will be at the beginning of the file.
rb+ Opens a file for both reading and writing in binary format. The file pointer will be at the beginning of the file.
w Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.
wb Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing.
w+ Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
wb+ Opens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
a Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.
ab Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing.
a+ Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
ab+ Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
`
Great book - after reading the CC license I'm pretty sure creating Anki Cards wouldn't be allowed, but if it's possible I'd like to.
Thoughts / comments / feelings on this?
>>> def start(env):
... return '\begin{}'.format(env)
will cause start('center')
to return egincenter
. You need to escape the backslash and the curly braces like so:
>>> def start(env):
... return '\\begin{{{}}}'.format(env)
same for end(env)
:
>>> def end(env):
... return '\\end{{{}}}'.format(env)
edit:
the same applies for Function Based Context Managers and Class Based Context Managers
It is a awesome notebook. Can I translate it to Chinese?
Thank you for the book ! Very good book !
I do have only one question for you. How you create a pdf file or hard book for amazon from rst files ?
And last but not least congratulations for good book !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.