Join Michele Vallisneri for an in-depth discussion in this video ✓ Solution: Mars map web server, part of Python: Programming Efficiently.
(chime)…- [Instructor] Let's go through my solution.…It consists of two files,…The python module, marsmap.py…and the python script, server.py.…Marsmap.py follows the path that we traced…in the plotting of maps video.…It passes the XML file locations.xml.…It obtains a list of location elements.…In the function findcuriousity,…we look through the locations until we find one…where the time spend…includes the requested sol…and will return longitude and latitude.…
Then we load the Gale crater image…and create the map.…Notice that locations.xml…and the big image are loaded only once…when the module is first imported.…In the function plotcuriosity,…we first plot the image on the map.…Then a red dot for curiosity…and we save the resulting image as a PNG file…into BytesIO buffer.…Server.py is almost identical to the server…that we wrote to show stylographs,…except that is calls marsmap functions findcuriousity,…to determine the code in itself over on a given day.…
In plotcuriosity, to plot on a map of Gale crater.…Let's see if this will work.…
- Designing efficient loops
- Exploiting Python collections
- Writing Pythonic code
- Choosing the best libraries for your tasks
- Downloading webpages with requests
- Parsing HTML with Beautiful Soup
- Manipulating images with Pillow
- Making videos and drawing on maps with matplotlib
- Serving webpages with Jinja2 and Flask
- Working with Python classes
- Taking advantage of functional techniques
- Profiling CPU and memory use
- Exploiting parallelism
Skill Level Intermediate
1. Installation and Setup
Jupyter notebooks3m 19s
2. Writing Python Efficiently
3. Exploiting Python Libraries
4. Advanced: Python Object-Oriented and Functional Programming
5. Introduction to Performance Optimization in Python
Next steps1m 2s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.