python
tom有了cat
积跬步,以至千里
展开
-
python入门 python安装mysqldb Python version 2.7 required, which was not found in the registry
安装的时候报错Python version 2.7 required, which was not found in the registry执行一下脚本import sysfrom _winreg import *# tweak as necessaryversion = sys.version[:3]installpath = sys.prefixregpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)insta..原创 2021-04-07 11:08:12 · 130 阅读 · 0 评论 -
python入门1基础语法
1.变量类型# coding=UTF-8counter = 100 # 赋值整型变量miles = 1000.0 # 浮点型name = "John" # 字符串print counterprint milesprint name2.运算符运算# coding=UTF-8#初始化ab,c的值a=21b=10c=0c=a+bprint cc=a-bprint cc=a*bprint cc=a/b #默认保持整形向下取整print c#对abc原创 2021-04-07 10:58:16 · 130 阅读 · 1 评论 -
python入门2类
员工类# -*- coding: UTF-8 -*-class Employee: '所有员工的基类' empCount = 0 def __init__(self, name, salary): self.name = name self.salary = salary Employee.empCount += 1 def displayCount(self): print "Total E.原创 2021-04-07 10:58:00 · 131 阅读 · 0 评论