跳至内容
Python基础

Python基础

  • Python
  • Linux

Python基础

col啊实打实大1coa’s’da’s’dal2阿达阿达是的col3
测试

计算机组成

冯诺依曼体系:

  1. 输入设备 2. 输出设备 3. 运算器 4. 控制器 5. 存储器

2. 软件组成

  • 系统软件:Windows macOS Linux Unix(macos基于unix系统)
  • 应用软件:IE 网易云…
  1. Python特点

Python版本:3.x ,开发≥3.5 不是向下兼容

  • 优点:简单易学、免费开源、应用领域广
  • 缺点:运行速度慢、不适合底层开发
  1. Python学习路线

    col1col2col3
代码块 Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import multiprocessing
import time


def func1():
    try:
            f = open('tste.txt', 'r')
    except:
        f = open('tste.txt', 'w')
    else:
        # 使用for循环
        for line in f:
            print(line) 
            time.sleep(0.5)

        # 使用while循环
        # line = f.readline()
        # while line:
            # print(line)
            # time.sleep(0.5)
            # line = f.readline()
    
     finally:
        f.close()


def func2():
    for i in range(5):
        print('hello')
        time.sleep(0.3)

if __name__ == '__main__':
    func1_process = multiprocessing.Process(target=func1)
    func2_process = multiprocessing.Process(target=func2)
    func1_process.start()
    func2_process.start()
  

图片说明