'''
def descrip_city(city_name, coury_name):
#return(city_name + "is belong to "+ coury_name)
city_info = {"city":city_name, "country":coury_name}
return city_info
result = descrip_city(city_name='Reykjavik', coury_name='Iceland.')
print(result)
'''
def mname(*arg):
# TODO: write code...
for a in arg:
......................
阅读全部
|
感v
贴于 2022年3月29日 11:15
hide
bbsi
#!/usr/bin/python3
from bottle import route,hook,template, run,request,response,get
import pymysql,json
@hook('after_request')
def enable_cors():
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, OPTIONS'
response.headers['Access-Control-Allow-Headers'] = 'Authorization, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, X-Requested-By, If-Modified-Since, X-File-Name, X-File-Type, Cache-Control, Origin'
@get('/hello')
def hello():
db = pymysql.connect(host="172.16.8.224",user= "reader", password="123456",database= "student_information",port=1432)
cursor = db.cursor()
......................
阅读全部
|
mimijilu
贴于 2021年11月16日 12:44
hide
bbsi
#!/usr/bin/python3
print('y=应用层,b=表示层,h=会话层,c=传输层,wa=网络层,s=数据链路层,wu=物理层')
print('请输入答案,以空格隔开:')
while True:
b=[-1,-1,-1,-1,-1,-1,-1]
a=input().split()
if a[0]=='exit' : break;
if a[0]=='js':
c=eval(a[1])
print (c)
continue
for i in range(0,len(a)):
......................
阅读全部
|
mimijilu
贴于 2020年11月23日 12:53
hide
bbsi
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import turtle
import time
# 画心形圆弧
def hart_arc():
for i in range(200):
turtle.right(1)
turtle.forward(2)
......................
阅读全部
|
苍凌
贴于 2020年5月2日 19:12
hide
bbsi
python中有没有方法实现下面的代码?
就是用变量代替函数名,使用变量名也能实现函数的功能。
def test1():
print("----1----")
local_name = test1
local_name()
阅读全部
|
eakit67
贴于 2019年1月7日 22:04
hide
bbsi
客户端
#!/usr/bin/env python3
#coding=utf-8
from socket import *
import sys
import getpass
def main():
if len(sys.argv) < 3:
print("argv is error")
return
......................
阅读全部
|
网贷小黑人
贴于 2018年9月28日 21:00
hide
bbsi
print("-----------Welcom to Guess Game----------")
i=0
while i<6:
temp = input("猜猜我在想什么:")
guess = int(temp)
if guess == 6:
print("You are so great!")
i=6
else:
if guess > 6:
print("Bigger")
else:
......................
阅读全部
|
漠河狼烟
贴于 2017年6月3日 23:01
hide
bbsi
from datetime import datetime
import math
from tkinter import*
class StillClock(Canvas):
def __init__(self):
super().__init__()
self.setcurrenttime()
self.pack()
self.mainloop()
def gethour(self):
return self.__hour
......................
阅读全部
|
Jangle_
贴于 2016年12月28日 15:16
hide
bbsi