> Intro
这是 Docs 的L0 入门闯关作业.
# Linux 基础
0. 申请开发机器
1. 添加ssh公钥
2. ssh 连接
3. 配置ssh config, 以便vscode连接
4. 配置端口映射, 创建hello_world.py
从教程里copy hello_world.py
安装python依赖包 pip install gradio==4.29.0
启动端口映射: 在本机运行 ssh intai -CNg -L 7860:127.0.0.1:7860
启动服务程序 python hello_world.py
# Python 基础
text = """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""
# text = """Hello world!
# This is an example.
# Word count is fun.
# Is it fun to count words?
# Yes, it is fun!"""
def wordcount(text):
# 1. remove punctuation mark
# 2. get split words
# 3. count num of each word
import re
from collections import Counter
remove_punc = re.sub(r'[^\w\s]', '', text)
words = map(str.lower,remove_punc.split())
word_count = Counter(words)
return dict(word_count)
print(wordcount(text))
debug 过程: (在vscode里改文件, 直接在命令行run)
# Git 基础
1. 提交自我介绍的PR
2. 创建个人项目