这次支持连接到后台的数据库,直接和数据库进行交互,实现基本的增删查改 #!/usr/bin/python3 # coding=utf-8 """ ***********************help document**************************************** Usage: this is a simple student grades system,now is simple when start the programming,you
name=['刘备','关羽','张飞','赵云','马超'] print('名片管理系统1.0\n1.增加一个新的名片\n2.删除一个名片\n3.修改一个名片\n4.查找一个名片\n5.退出名片管理系统') a=int(input('请输入你要执行的选项:')) i=0 while i <= 4: if a == 1: names = input('请输入新的名片:') name.append(names) print(name) if a == 2: print(name) names =
今天在网上看到一段代码,其中使用了with seam:初见不解其意,遂查询资料. 代码: #! /usr/bin/env python # -*- coding:utf-8 -*- import time from random import random from threading import Thread,Semaphore sema = Semaphore(3) def foo(tid): with sema: print("{} acquire sema".format(t