CS61A 2022 fall lab0
CS61A 2022 fall lab0:Getting Started
不得不感叹实验网站是真的高级…
打算用ubuntu做实验
文章目录
- CS61A 2022 fall lab0:Getting Started
- Introduction
- Setup
- 1.Install a terminal
- 2.Install Python 3
- Python3.7
- 基于update-alternatives的Python默认版本系统级修改:屡试屡败...
- 基于软链接的Python版本系统级修改
- Python3.9
- 3.Install a text editor
- (1)试试vscode的 remote development
- (2)学学Vim
- ①Introduction
- ②Goals
- ③Getting Vim on your own computer
- ④Example: `greet.py`
- Opening files
- Normal mode and Insert mode
- Editing files
- Saving files
- Running Python
- Closing Vim
- Summary
- ⑤Keyboard Shortcuts
- Different modes
- Navigating
- Entering Insert mode
- Undo and redo 实用芜湖!
- Deleting text (like cut,删了可以复制回来,相当于剪切)
- Copying text
- Pasting text
- Searching
- Visual mode
- ⑥Customizing Vim
- Syntax highlighting
- Line numbers
- Tabs
- Key bindings
- 4.Pair Programming
- 5.Backup setups
- Soda lab computers
- Online editors as a backup
- Walkthrough:Using the terminal
- 1.Home Directory
- 2.Path
- 3.Terminal vs Python Interpreter
- Walkthrough:Organizing your files
- 给阿里云轻量应用服务器配置图形界面
- Directories
- Changing directories
- macOS/Linux
- Making new directories
- macOS/Linux
- More directory changing
- Downloading the assignment
- 将文件从windows上传到Linux上面
- 方法1 scp指令
- 方法2 xftp 7
- Extracting starter files
- Moving files
- Summary
- Review:Python basics
- 安装vscode
- python review
- Primitive Expressions 原始表达式
- Arithmetic Expressions
- Strings
- Assignment Statements 赋值表达式
- Required: Doing the assignment
- What Would Python Do? (WWPD)
- Using OK
- Signing in with Ok
- Troubleshooting
- Not enrolled
- Wrong email
- Can't authenticate/browser issues/redirections to `127.0.0.1`/etc.
- Crashed or did not load
- Testing with Ok
- Test specific questions
- Test all questions
- Display all tests
- Test locally (貌似这个可以???)
- Adding your own tests
- Running your own tests
- Submit assignment
- Viewing submissions
- Code writing questions
- Understanding problems
- Writing code
- Running tests
- Required:Submitting the assignment (无账号的局外人 看看热闹罢了
- Step 1: Submit with `ok`
- Step 2: Verify your submission
- Appendix:Useful Python command line options
- 一些总结
- 参考资源
Introduction
emmm 还有个顺带的目的是学英语,所以复制过来让自己也看一看一些地道的表达
This lab explains how to setup your computer to complete assignments and introduces some of the basics of Python.
This lab is required. The setup is necessary in completing all other assignments in the course.
This lab looks really long, but it’s mostly setup and learning how to use the essential tools for this class. These may seem a bit difficult now, but will quickly become second nature as we move further into the course.
become second nature 好地道的用法~
Here’s a breakdown of the major parts of the lab:
- Setup: Setting up the essential software for the course. This will require several components, listed below.
- Install a Terminal: Install a terminal so you can interact with files in this course and run OK commands. If you have a terminal on your computer and feel comfortable using it, you can skip this part.
- Install Python 3: Install the Python programming langauge to your computer. If you already have Python 3.7 or later (ideally Python 3.9) installed, you can skip this part.
- Install a Text Editor: Install software to edit
.py
files for this course (e.g. VSCode, Atom, etc.). You can skip this part if you already have a text editor you like.
- Walkthrough: Using the Terminal: This walks you through(walk sb through,耐心地给某人示范) how to use the terminal and Python interpreter. If you already feel comfortable with both of these you do not need to read this section.
- Walkthrough: Organizing your Files: This section walks you through how to use your terminal to organize and navigate files for this course. Everyone should at least skim(浏览) this section, as it has important information specific to this class, but if you are already comfortable navigating directory structures with a terminal much of this will feel familar.
- Review: Python Basics: This is a review on many of the basic components of Python introduced in lecture. You should have already seen this material, but we like to include a brief review of relevant content on each lab in case you need a refresher (你需要复习一下)on anything.
- Required: Doing the Assignment: You must complete this section to get points for the assignment. Here you will practice the different types of problems you will be asked to do in lab, homework, and project assignments for this course. The main goal of this assignment is to give you practice using our software.
- Required: Submitting the Assignment: You must complete this section to get points for the assignment. This will walk you through how to turn in your work after completing the previous section and how to verify that your work is turned in on OKPY.
- Appendix: Useful Python Command Line Options: These are commands that are useful in debugging your work, but not required to complete the lab. We include them because we imagine they’re likely to be helpful to you throughout the course.
Setup
lab教程真的是循序渐进,十分详实啊
1.Install a terminal
macOS/Linux:already have a program called
Terminal
打算拿阿里云上搞的一个ubuntu来试试
Windows
Option1:WSL(the Windows subsystem for Linux)
感觉推荐这个,足见课程的先进…
Alternative option:Windows Powershell
2.Install Python 3
Python3.7
- 看到这里以为装3.7就行,没想到后面还得装个3.9
基于update-alternatives的Python默认版本系统级修改:屡试屡败…
Ubuntu 18.04默认已经安装Python 2.7与Python 3.6,
Installing Python3
针对每种操作系统都给出了教程
Linux:
sudo apt install python3
我的阿里云服务器已经自带了,但是默认python2是python2.7.15rcl,默认的python3是python3.6
于是我参照这篇博客折腾了一下,将默认的设置为了3.7
首先看看python在哪
whereis python python: /usr/bin/python /usr/bin/python3.6m /usr/bin/python3.6 /usr/bin/python2.7 /usr/lib/python3.6 /usr/lib/python2.7 /usr/lib/python3.7 /etc/python /etc/python3.6 /etc/python2.7 /usr/local/lib/python3.6 /usr/local/lib/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz
可使用
update-alternatives
来为整个系统更改 Python 版本。首先罗列出所有可用的 python 替代版本信息:
update-alternatives --list python update-alternatives: error: no alternatives for python
出现以上所示的错误信息,表示 Python 的替代版本尚未被
update-alternatives
命令识别我们需要更新一下替代列表,将
python2.7
和python3.6
和python3.7
放入其中update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2 update-alternatives: using /usr/bin/python3.6 to provide /usr/bin/python (python) in auto mode update-alternatives --install /usr/bin/python python /usr/lib/python3.7 3 update-alternatives: using /usr/lib/python3.7 to provide /usr/bin/python (python) in auto mode
我们再list一下
再配置一下
sudo update-alternatives --config python There are 3 choices for the alternative python (providing /usr/bin/python).Selection Path Priority Status ------------------------------------------------------------ * 0 /usr/lib/python3.7 3 auto mode1 /usr/bin/python2.7 1 manual mode2 /usr/bin/python3.6 2 manual mode3 /usr/lib/python3.7 3 manual modePress <enter> to keep the current choice[*], or type selection number: 3
原以为配置大功告成了,结果…麻了
python居然变成了directory…我猜是因为我的python3.7是在usr/lib/目录下,而不是在usr/bin目录下,于是去做了一些尝试
把配置调为usr/bin/python3.6,再试试
接下来分别尝试python2、python3、python指令,结果如下
去看看那个python3.7到底咋回事…
呃不知道为啥一堆乱码
再去usr/bin目录下看到了python和python3.6
得重新整理下思路了…
- 一方面python3.7得重装一下,先贴几个可能的参考资料在这
- ubuntu安装python3.7
- Ubuntu上安装Python3.7
- 如何在 Ubuntu 18.04上安装 Python3.7
- 另一方面那个config得再研究研究
- Ubuntu 18.04将Python3设置为Python默认版本
- Ubuntu修改默认Python版本
- Ubuntu更改默认python版本
- Linux下切换Python版本的3种方法
- Ubuntu16.04下完美切换Python版本
- 一方面python3.7得重装一下,先贴几个可能的参考资料在这
继续干
尝试安装python3.7失败
emmm 肿么办
当我转头求助这个教程的时候
试着安装
sudo apt-get install software-properties-common
,如下
于是我去google这个问题:
Package 'software-properties-common' has no installation candidate
,看到了一个解答
- 于是
sudo apt-get update
,好耶! - 然后选择yes
然后接着试试能不能装py3.7了
直接
sudo apt-get install python3.7
,没有利用那个software-properties-common好耶
再来grep看看
ls -l /usr/bin | grep python
有python3.7了
有py3.7了,那么再来试试那个config
update-alternatives --list python sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 4 update-alternatives --list python sudo update-alternatives --config python 选择4 : python3.7
本来以为这回稳了啊…结果
CS61A 2022 fall lab0相关推荐
- CS61A 2022 fall lab01
CS61A 2022 fall lab01 文章目录 CS61A 2022 fall lab01 Topics Division, Floor Div, and Modulo Functions Ca ...
- 博士申请 | 美国布兰迪斯大学张初旭教授招收机器学习方向全奖博士生
合适的工作难找?最新的招聘信息也不知道? AI 求职为大家精选人工智能领域最新鲜的招聘信息,助你先人一步投递,快人一步入职! 布兰迪斯大学 布兰迪斯大学(Brandeis University)坐落在 ...
- 【堪萨斯州立大学】电子和计算机工程系智能能源研究室、硬件安全实验室招募博士,提供多个全额奖学金机会...
关注公众号,获取更多AI领域发展机会 堪萨斯州立大学电子和计算机工程系的两个实验室(智能能源研究室, 硬件安全实验室)招募博士生,并提供多个全额奖学金机会. (图片来自学习官网) 学校及院系介绍 In ...
- 乔治亚大学招收计算机视觉/深度学习/机器人/自动驾驶博士生from 2023 spring
University of Georgia(佐治亚大学)ECE系的Intelligent Vision and Sensing 实验室现有多个全奖博士生名额,以及1-2个csc资助的博士名额(学费由导 ...
- Social Justice Awards秋季赛正式启动
Social Justice Awards 2022 Fall 大赛正式开启! Social Justice Awards是由青少年非营利组织Social Justice Watcher (SJW) ...
- 一位计算机准PhD的大四和博零
最新个人信息可见:Home - Zhuoning Guo 完整版请见:知乎 攻读PhD 大一开始有读博念头 大二计划去香港,理由:学制短,奖学金高,环境(导师和同学)容易适应,海外麻烦也申不到特别好的 ...
- Fall 2020 Berkeley cs61a Hog Project
** Fall 2020 Berkeley cs61a Hog Project ** Fall 2020 的Hog和之前project有些变化,Github找不到,所以分享一下- "&quo ...
- Fall 2020 Berkeley cs61a hw01答案
Fall 2020 Berkeley cs61a hw01答案 from operator import add, subdef a_plus_abs_b(a, b):""&quo ...
- 2020 UCB CS61A FALL -- project1 hog
UCB2020的秋季课,老师是Hany Farid和John DeNero hog是第一个项目,做的时候感觉细节挺多的,主要是熟悉下python的一些语法和高阶函数的使用 代码 "" ...
最新文章
- main方法_错误: 在类 ZiFUChuan.Pyramid 中找不到 main 方法, 请将 main 方法定义为:
- Java机器学习库ML之八关于模型迭代训练的试验
- 关于script的放置位置
- 备战“双11”,阿里云为企业提供一站式资源保障服务
- python opengl加速_OpenGL with python 渲染加速
- java future接口_java Future 接口介绍
- [当当网,你意欲何为]之二:无奈,配送之痛
- Oauth协议是否会泄露用户的密码
- 前端快来!最火的 Vue.js 开源项目出炉
- ios开发text kit_TextKit
- 新句子:没有谁比我更懂XX,抓普也不行
- vue-table-with-tree-grid的使用(黑马笔记)
- 计算机考试准考证怎么下载
- python交通流预测算法_使用KNN方法进行的短时交通流预测和结果分析
- 一个新手RHCE的酸甜苦辣
- 全网最通俗易懂的「插屏广告」接入方法
- 团队管理31-典型场景(向上沟通)
- 仙人掌之歌——路转峰回(4)
- Mac:Permission denied XXX
- Json和List互相转化
热门文章
- 使用FeatureTask多线程优化in,提高查询速度
- protect 继承_c++三种继承方式public,protect,private
- vue配置多页面应用~
- 2023 华为 Datacom-HCIE 真题题库 07/12--含解析
- java期末_Java期末总结
- 关于tools:ignore=“Suspicious0dp“的问题父类定向为竖向时,别横向等分父类的高
- 各省份非金融类对外直接投资存量(2003-2020年)
- 荣耀电脑怎样更改计算机名称,王者荣耀荣耀战区怎么修改别的地区?手机电脑改荣耀战区不封号操作方法[多图]...
- BZOJ4585 [Apio2016]烟火表演
- Springboot+Vue实现简单的前端后分离数据交互
- CS61A 2022 fall lab01