Comments (6)
Barring any major package conflicts, plan to use 3. Need to go through and update ipython notebook and markdown files accordingly. Double-check all packages! Make another file listing all packages used in course so we can keep track of issues with later updates/versions.
from ps239t.
Remember to change the installation instructions too!
from ps239t.
Rochelle will send notes on how to easily update from 2 to 3!
from ps239t.
To create a python 3 environment, use the commands outlined here
In brief:
Open up a terminal. You can be anywhere for this to work. The first time you do this, you need to create a python 3 environment (here it's called "py3k"):
$ conda create -n py3k python=3 anaconda
Then you activate that environment by typing
$ source activate py3k
At that point you should now see an indication that you are in py3k
. At which point you can spin up an ipython notebook and it will use a python 3 kernel. You can also cd
into wherever or do any of your bash things. Python 3 will be used until you end the environment or close the terminal window.
from ps239t.
Note that the 03_python-basics/madlib.py
script will break in Python 3.
from ps239t.
Here's the edited madlib.py for Python 3
"""
String Substitution for a Mad Lib
Adapted from code by Kirby Urner
"""
story = """
Once upon a time, deep in an ancient jungle,
there lived a %(animal)s. This %(animal)s
liked to eat %(food)s, but the jungle had
very little %(food)s to offer. One day, an
explorer found the %(animal)s and discovered
it liked %(food)s. The explorer took the
%(animal)s back to %(city)s, where it could
eat as much %(food)s as it wanted. However,
the %(animal)s became homesick, so the
explorer brought it back to the jungle,
leaving a large supply of %(food)s.
The End
"""
def tellStory():
userPicks = dict()
addPick('animal', userPicks)
addPick('food', userPicks)
addPick('city', userPicks)
print(story % userPicks)
def addPick(cue, dictionary):
prompt = "Enter a specific example for %s: " % cue
dictionary[cue] = input(prompt)
tellStory()
input("Press Enter to end the program.")
from ps239t.
Related Issues (17)
- na
- na HOT 1
- na
- na
- na
- na HOT 1
- na HOT 3
- Course templates for homework + lessons
- Tech set up: BCE? Loaned Laptops? Ala Carte installs? HOT 2
- Course schedule / Units HOT 1
- Guest Speakers
- R edits
- bcourses?
- Department Marketing HOT 5
- What goes on bCourses?
- New Branch (Fall 2015) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ps239t.