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 sys from _winreg import * # tweak as necessary version = sys.version[:3] installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version) insta..原创 2021-04-07 11:08:12 · 145 阅读 · 0 评论 -
python入门1基础语法
1.变量类型 # coding=UTF-8 counter = 100 # 赋值整型变量 miles = 1000.0 # 浮点型 name = "John" # 字符串 print counter print miles print name 2.运算符运算 # coding=UTF-8 #初始化ab,c的值 a=21 b=10 c=0 c=a+b print c c=a-b print c c=a*b print c c=a/b #默认保持整形向下取整 print c #对abc原创 2021-04-07 10:58:16 · 159 阅读 · 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 · 146 阅读 · 0 评论