9-line access access management access point accessibility ADA air quality alignment amenity antiplanner atlanta BART BID bike Blogs boston branded bus branded buses brookings brt bus Bus Rapid Transit BYU capacity car pool cars central link Centrality certification commuter rail condo congestion congestion pricing connections consistency coverage crossings CRT cycling DART dedicated dedicated right of way density denver depreciation developers development economics efficiency Envision Utah equity eugene exclusive extension FAQ favela Federal Funding Flex Bus florida free fare zone freeways Frequent Transit Network frontrunner frontunner Gallivan garden cities gas prices geotagging goat Google grade-separation Granary District growth headway heavy rail hedonic High Speed Rail history housing housing affordability housing bubble housing prices HOV income infill innovative intersections intensity ITS junk science LA land use LEED legacy city light rail linear park location LRT lyft M/ART malls mapping maps metrics metro MetroRail missoula mixed mixed traffic mixed-traffic mobile mode choice Mode Share multi-family MXD neighborhood networks news NIMBY office online op-ed open letter Operations parking parking meters peak travel pedestrian environment phasing Photomorphing planning Portland property property values Provo proximity quality_transit rail railvolution rant rapid rapid transit RDA real estate redevelopment reliability research retail Ridership ridesharing right of way roadway network ROW salt lake city san diego schedule schedule span seattle separated shuttle silver line single family SLC SLC transit master plan slums smartphone snow sprawl standing stop spacing streetcar streetscape streetscaping subdivision subsidy Sugarhouse Sugarhouse Streetcar Tacoma taxi technology tenure termini time-separation TOD townhouse traffic signal tram transit transit networks transit oriented development Transit Planning transponder transportation travel time TRAX trip planning trolley tunnel uber university of utah urban design urban economics urban land UTA UTA 2 Go Trip Planner utah Utah County Utah Transit Authority vmt walking distance web welfare transit Westside Connector WFRC wheelchairs zoning

Monday, January 9, 2012

Intro to Python Notes

Integrated window--IDLE. Type in, responds directly. There are a lot of things that python just does automatically, through automatic presets--simpler once you know it, but more of a learning curve. Python is case sensitive.

If you want to get decimals, you need to include at least one of the numbers as a non integers. 19.0/3 will return decimals, 19/3 will only return a integer--6. Standard order of operations. 19%3=1  % is the character for 'remainder'. Considered as 'division' in order of operations. ^ is not used for exponent--** is used instead.

Alt+P retypes the last command you exectuted--may 'scroll back' through multiple commands--not just last, but commands previous to that.
#/Sharp/Hashtag used for commenting.
Used for commenting code.  

Seems like variables can be any string. Will accept strings or numbers.

Allows and echo like:
frog*6 gets communismcommunismcommunismcommunismcommunismcommunism
May set mathematical operations as variables:

Saving, must add the extension .py. If you miss it, not critical--will have to open IDLE and then open the file rather than just being able to double-click it.

Create new is out of the main python terminal, which allows you to execute multiple line scripts. In the main editor it runs each line as you type it in.

Variable types = string, number, tuple, list, dictionary...
List needs end-brackets [], separated by commas.

>>> print "My number is", MyNum
My number is 1
#automatically adds the space before a variable?

"append" adds a name to a list.
>>> names.append('catherine')