文章目录

  • Python for Everybody
    • 课程简介
    • Installing Python
      • Getting started with Python on a Macintosh
      • Writing a Python 3 program on Macintosh
      • Starting Terminal on Macintosh OS/X
      • Where Are You?
      • Where can you go?
      • Running Your Python Program in the Terminal

Python for Everybody

Exploring Data Using Python 3
Dr. Charles R. Severance


课程简介

Python for Everybody 零基础程序设计(Python 入门)

  • This course aims to teach everyone the basics of programming computers using Python. 本课程旨在向所有人传授使用 Python 进行计算机编程的基础知识。
  • We cover the basics of how one constructs a program from a series of simple instructions in Python. 我们介绍了如何通过 Python 中的一系列简单指令构建程序的基础知识。
  • The course has no pre-requisites and avoids all but the simplest mathematics. Anyone with moderate computer experience should be able to master the materials in this course. 该课程没有任何先决条件,除了最简单的数学之外,避免了所有内容。任何具有中等计算机经验的人都应该能够掌握本课程中的材料。
  • This course will cover Chapters 1-5 of the textbook “Python for Everybody”. Once a student completes this course, they will be ready to take more advanced programming courses. 本课程将涵盖《Python for Everyday》教科书的第 1-5 章。学生完成本课程后,他们将准备好学习更高级的编程课程。
  • This course covers Python 3.

coursera

Python for Everybody 零基础程序设计(Python 入门)

Charles Russell Severance
Clinical Professor

个人主页
Twitter

University of Michigan


课程资源

coursera原版课程视频
coursera原版视频-中英文精校字幕-B站
Dr. Chuck官方翻录版视频-机器翻译字幕-B站

PY4E-课程配套练习
Dr. Chuck Online - 系列课程开源官网



Installing Python

Getting started with Python on a Macintosh


Getting started with Python on a Macintosh

Python 2 and Python 3 are already installed on Macintosh OS/X operating system so all you need to add is a programmer text editor.

Installing A Programmer Text Editor

If you already have a programmer text editor like VS-Code installed you can use it in the class or you can install it on your system.

https://code.visualstudio.com/

If the installation for VSCode looks a little too complex, we recommend the free and open source Brackets text editor. It is easy to install and is very capable for your needs in the course.

https://brackets.io/

Writing a Python 3 program on Macintosh

We have a short step-by-step video showing how to use a programmer editor and write your first Python 3 program.
This video uses the Bracket editor - which we suggest you to install and use, or the VS-Code, if you don’t already have a programming text editor.

https://www.youtube.com/watch?v=9lOdVSNUKfY

Starting Terminal on Macintosh OS/X

The Terminal program on Macintosh is kind of buried under Macintosh HD -> Applications -> Utilities -> Terminal

There are several shortcuts that you might find helpful. You can go into the upper-right of your screen and click on the Spotlight search button and type terminal and you can execute Terminal from the pop-up list of items.

You can get Terminal to stay in your dock once terminal is launched by clicking and holding on the Terminal icon in the dock and then selecting “Keep in Dock”. Then you can quickly launch Terminal by clicking on the icon in the dock.

Where Are You?

When the command line starts up, you are in your “home” directory. In each of these examples, your logged in account should be used instead of csev.

    Macintosh Home Directory:        /Users/csev

The command line prompt usually includes some clue as to where you are at in the folder structure on your hard drive. If you want to really figure out where you are, on Macintosh use the pwd command.

    udhcp-macvpn-624:~ csev$ pwd/Users/csevudhcp-macvpn-624:~ csev$

Where can you go?

Generally the first thing you want to do when you open a command line interface is to navigate to the right folder. Say you wanted to run a file from your desktop. The command is cd Desktop

    udhcp-macvpn-624:~ csev$ pwd/Users/csevudhcp-macvpn-624:~ csev$ cd Desktopudhcp-macvpn-624:Desktop csev$ pwd/Users/csev/Desktopudhcp-macvpn-624:Desktop csev$

Nifty Trick: On the cd command, you can partially type a folder name like Desktop and then press the TAB key and the system will auto-complete the folder name if you have typed enough that the system can accurately guess what you mean to type.

Going Backwards (or Upwards)

You can change directory to the parent folder (the folder “above” the folder you are in using the cd … command.
It just says “go up one”.

    udhcp-macvpn-624:Desktop csev$ pwd/Users/csev/Desktopudhcp-macvpn-624:Desktop csev$ cd ..udhcp-macvpn-624:~ csev$ pwd/Users/csevudhcp-macvpn-624:~ csev$

If you get Lost…
If you can’t figure out what folder you are in and/or cannot figure out how to get to the folder you want to get to “home” simply close and re-open the Command Line / Terminal window.

What Files/Folders are Here?

You can list the contents of the current directory using the ls -l command.

    udhcp-macvpn-624:Desktop csev$ pwd/Users/csev/Desktopudhcp-macvpn-624:Desktop csev$ ls -l total 8-rw-r--r--  1 csev  staff   15 Sep 16 15:17 hello.pyudhcp-macvpn-624:Desktop csev$

Running Your Python Program in the Terminal

Start the Terminal program, navigate to the proper directory and type the following command:

    python3 hello.py

This loads the Python 3 interpreter and runs firstprog.py, showing the program output and / or errors in the Terminal window.

Some Cool Hints on The Macintosh Terminal Program

You can scroll back through previous commands by pressing the up and down arrows and re-execute commands using the enter key. This can save a lot of typing. If you like keeping your screen uncluttered, you can clear the scroll back buffer by pressing the Command key and the K key at the same time.

Chapter 1-2: Installing Python - Installing Python 3 on a Macintosh | Python for Everybody 讲义笔记_En相关推荐

  1. 初学者python编辑器_Thonny:适合初学者的Python编辑器

    初学者python编辑器 Are you a Python beginner looking for a tool that can support your learning? This artic ...

  2. python防反编译_Python - 浅谈Python的编译与反编译

    1 - Python编译过程涉及的文件 py 源代码文件,由python.exe解释,可在控制台下运行,可用文本编辑器进行编辑: pyc 源代码文件经过编译后生成的二进制文件,无法用文本编辑器进行编辑 ...

  3. python手机版下载3.7.2-QPython - Python for Android

    QPython - Python for Android 介绍 QPython - Python for Android QPython is a script engine that runs Py ...

  4. python提示install无效_为什么是python设置.py给我“错误:选项installdir无法识别”错误?...

    当我尝试将python项目安装到自定义的本地python repo中时,我使用以下命令:python setup.py install --install-dir /home/peng/python- ...

  5. python+[:]+切片_我从C ++到Python的方式:概念上的改变

    python+[:]+切片 by asya f 由asya f 我从C ++到Python的方式:概念上的改变 (How I went from C++ to Python: a conceptual ...

  6. asp python 定时任务_Ubuntu使用crontab定时执行python脚本

    转载其他博主的博客,记录过程,及使用中的一些问题 有时会遇到需要在linux的主机上定时的执行某个python脚本来处理事情的需求,这时可以考虑使用crontab来实现. 关于crontab的介绍,参 ...

  7. python解析器打包_打包发布Python模块的方法详解

    前言 昨天把自己的VASP文件处理库进行了打包并上传到PyPI,现在可以直接通过pip和easy_install来安装VASPy啦(同时欢迎使用VASP做计算化学的童鞋们加星和参与进来), 由于自己的 ...

  8. python实现数据可视化_使用Matplotib python实现数据可视化

    python实现数据可视化 I Feel: 我觉得: In today's digital world data has become as important as air. Machines &a ...

  9. python版本管理工具_使用 Python 官方工具在 windows 上管理 Python 多版本

    0. 使用官方工具 网上很多教程还在用修改Python.exe文件名的方式来进行多版本的管理,其实Python官方在3.3已经有了一个官方的工具,使用起来也很方便. 1. 下载 2.x 和 3.x(3 ...

最新文章

  1. 果粉们注意了 外媒爆料以下机型不再支持iOS 13
  2. 八皇后问题python_python求解八皇后问题
  3. Vue.js项目新建及目录结构分析
  4. HttpClient 学习整理[转]
  5. 基于Vue-cli和Vux的webpack配置
  6. 你很可能需要知道这个调试小技巧
  7. java语言 爱我,语言篇:Java环境
  8. 迁移pg_塑料包装袋中添加剂迁移到食品和药品中危害健康
  9. 苹果计算机音乐谱大全,macOS乐谱制作软件大全推荐~
  10. IDEA导入已有Maven项目
  11. 超级账本(关键概念)
  12. 域控服务器更新规则,由服务器升级为域控制器的方法
  13. laravel easywechat 网页授权
  14. 【Robot】Rookit简介
  15. 体脂秤方案——体脂秤的原理是什么?
  16. Proteus 中 Virtual Terminal无法自动弹出窗口的问题的解决
  17. List(双向链表)
  18. CCleaner安装错误怎么办
  19. SpringBoot中: Incorrect result size: expected 1, actual 0以及column xxxx not found解决
  20. 苏宁java二面,苏宁二面+三面

热门文章

  1. IOS疯狂基础之键盘挡住输入框
  2. 华为OD在线编程题准备
  3. 原码、反码、补码,带你深入理解计算机的补码运算原理(附图片解说过程),为什么计算机中数据要以补码的形式存储呢?解释补码运算规则的合理性。
  4. esp32-cam 实现定时拍照并发送邮件
  5. 02.青龙面板——薅京东羊毛,自动获取京豆、自动浇水、做任务
  6. 扑克牌八次洗牌等于没洗牌
  7. electron app开发笔记
  8. 数据加密:你应该知道的数仓安全
  9. 非遗造物 匠心守护 南亚风情第壹城非遗文化节等你来玩
  10. 向浏览器console 里面导入JQuery在线CDN