![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习
星星星星️
我要学好Python!
展开
-
python matplotlib中文字体无法显示问题
以下面的例子说明如何解决matplotlib画图中出现中文字体无法显示问题要画出10-12点气温变化的图像from matplotlib import pyplot as pltimport randomx = range(0,120)y = [random.randint(20,35) for i in range(120)]plt.figure(figsize=(20,8),dpi=80)plt.plot(x,y)x_ticks = ['10点{}分'.format(i) for i i原创 2020-10-31 13:19:21 · 3835 阅读 · 2 评论 -
Python对指定文件内容进行全局替换
关于对指定文件内容进行全局替换的Python实现具体解释都附在代码里了代码如下:import osimport syscs = sys.argvold_cs = cs[1] # 将要替换掉的值赋给old_csnew_cs = cs[2] # 将要替换成的值赋给new_csfilename = cs[3] # 将操作的文件名赋给filenamenew_file...原创 2020-05-02 14:46:15 · 980 阅读 · 0 评论 -
Python中关于字符串你应该知道这些...
Python中的字符串常见用法基本上都在这了原创 2020-04-16 22:20:49 · 306 阅读 · 0 评论 -
双色球的Python实现
代码如下:red_ball = []blue_ball = []count = 0while count < 6: n = int(input('\033[31mPlease enter the red ball of your choice(1-32):\033[0m')) if 0 < n < 33: if n in red_ball:...原创 2020-04-09 21:33:54 · 1329 阅读 · 0 评论 -
BMI的Python实现
str1 = float(input('请输入您的身高(单位:米):')) # input默认转化为字符串型 用float转化为浮点型str2 = float(input('请输入您的体重(单位:千克):'))BMI = str2/str1**2 # BMI=体重除以身高的平方msg = '''--------BMI---------您的身高是: %f # %f 对应以浮点...原创 2020-04-08 17:02:02 · 3133 阅读 · 0 评论 -
Python--初识庐山真面目
Python学习中最常用也最基础的知识。原创 2020-04-06 20:53:28 · 213 阅读 · 0 评论