Discover and read the best of Twitter Threads about #python

Most recents (4)

THREAD - How about a bunch of blog posts on #Space and #Astronomy? Yes, I have more than you can imagine - especially since these are really just #physics topics. Hold on - because this is going to be a bit large.
2/ Here is an answer to my fav astronomy question EVER - "What would the phases of the moon look like if the moon was a cube?" wired.com/2015/09/moon-c…
3/ The great thing about the cube moon question is that it really tests if students understand phases of the moon rather than just recalling factual stuff. Here is my python model of a cube and spherical moon
Read 70 tweets
If you're new to #python programming, welcome aboard! I've spotted a few techniques that newcomers miss out on and thus learn more slowly.
First, and most important: install and use ipython. You will learn APIs much faster with tab completion and the ability to write foo? to see documentation for foo.

The default python interpreter will slow you down.
Second, install a linter in your editor. I suggest pyflakes for newcomers. This will catch lots of silly errors and give you fast feedback on syntax.
Read 5 tweets
High level #python #tutorial thread:
Python is a high level language that runs bytecode in its virtual machine.
Everything is an object.
It supports OOP up to multiple inheritance and functional programming.
Typing is polymorphic - duck typing is preferred
A Python script is a file with a name like name.py - we indent at four spaces (it matters), comments (after #) don't execute - and is typically written like:

def main(): # function
print("Hello world")

if __name__ == '__main__': # then entry point
main()
A module is a reusable script:

"""this is a docstring at the top of the module - gives help on the module"""

import this # do imports at the top

def main(): # main at top or bottom
"""functions get docstrings too"""

if __name__... always at the bottom, assumed from now on
Read 68 tweets
learn How Compiler Works in 20 minutes xahlee.info/parser/compile…
What's the Difference Between BNF, EBNF, ABNF?
xahlee.info/parser/bnf_ebn…
#golang #haskell #lisp #python
this, still the best book on writing a compiler. Though, not as clear and broad as i thought.
there are thievery pdf versions online, but all code/formula are screwed. You better buy the real thing.
Dragon Book Table of Contents
xahlee.info/parser/dragon_…
Read 46 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!