当前位置: 首页 > 编程日记 > 正文

python学习笔记(一)之入门

1、python的安装

官网下载.exe文件直接安装即可,在安装过程中选择加入环境变量,就不用在安装后再去增添环境变量了。
本文选择的是python3.6版本,没有选择2.7版本。

2、启动python解释器和运行.py文件

安装过程中选择创建桌面图标连接,在安装过后可以直接点击图标即可,或者在cmd下输入python即可。
我们可以看到如下图所示内容:

Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 

在python解释器中>>>是主提示符,...是次要提示符。

>>> str = '''python
...is cool!'''
>>> print(str)
python
is cool!

python程序文件是以.py结尾,运行该文件可以在cmd中转到代码目录,然后使用以下命令即可:

> python filename.py

也可以使用各种编辑器如pycharm,可以在编辑器中直接执行。

3、print语句和“Hello World!”

在python3.6 版本中,print语句采用print()的形式。

#!/usr/bin/env python
# _*_coding:utf-8_*_
# name:'first.py'
print('Hello World!')

执行first.py

> python first.py
Hello World!

也可以直接打开python解释器直接输入:

>>> print('Hello World!')
Hello World!

在解释器中“_”有着特别的意义:表示最后一个表达式的值,是表达式而不是普通语句。

>>> _
Traceback (most recent call last):File "<stdin>", line 1, in <module>
NameError: name '_' is not defined
>>> str = 'Hello World!'
>>> str
'Hello World!'
>>> _
'Hello World!'

print语句的标准化输出

采用的是类似于C语言的printf()类似的写法:

>>> print('I want to say %s' % (str))
I want to say Hello World!

此外,在了解到stdout:

>>> import sys
>>> sys.stdout.write('Hello World!')
Hello World!>>>

这里的sys.stdout.write()不会在句尾自动回车。

疑问

在学习到标准化输出时,了解到重定向,采用的是linux中的>>符号:
运行下一段代码时出现错误:

#!/usr/bin/env python
import sys
logfile = open('log.txt', 'w+')
ser = sys.stderr
print >> logfile, 'Hello World!'
print >> ser, 'stderr'
logfile.close()

输出错误:

Hello World!
Traceback (most recent call last):File "G:/Code/python/fan.py", line 6, in <module>print >> logfile, 'Hello World!'
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?Process finished with exit code 1

怀疑是平台的问题,之后再linux上测试了一下,没有问题:

$ python fan.py
stderr
$ cat log.txt
Hello World!

至于具体原因还不知,望哪位大神告知!

输入与input()内建函数

python使用input()函数进行程序输入,它读取标准输入,并将读取到的数据复制给指定的变量。在这之中你可以使用int()内建函数将用户输入的字符串转换为整型。

>>> name = input('Please input your name:')
Please input your name:yt
>>> num = input('Please input your num:')
Please input your num:22
>>> print('Your name is %s' % (name))
Your name is yt
>>> print('Your age is %d' % (num))
Traceback (most recent call last):File "<stdin>", line 1, in <module>
TypeError: %d format: a number is required, not str
>>> print('Your age is %d' % (int(num)))
Your age is 22
>>> print('Your age is %s' % (num))
Your age is 22

可见input()得到的标准化输入为字符串,当需要整型数值是需要使用int()内建函数。可以使用help(input)查看帮助信息:

>>> help(input)
Help on built-in function input in module builtins:input(prompt=None, /)Read a string from standard input.  The trailing newline is stripped.The prompt string, if given, is printed to standard output without atrailing newline before reading input.If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.On *nix systems, readline is used if available.

在python2中使用的是raw_input()函数,查看帮助信息会发现其标准化输入为字符串,输出也为字符串:

Help on built-in function raw_input in module __builtin__:raw_input(...)raw_input([prompt]) -> string  Read a string from standard input.  The trailing newline is stripped.If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.On Unix, GNU readline is used if enabled.  The prompt string, if given,is printed without a trailing newline before reading.
(END)

注释

python使用的和其他的unix-shell脚本的注释一样都是:#.

# Author:yt
# 标注作者

此外,在函数中的注释使用的是双引号;

#!/usr/bin/env pythondef test(x):"This is a test function"print('The result is %d' % (x+x))
test(1)
$ python3 fan.py
The result is 2

需要注意最好在脚本开始加上这两句代码:

#!/usr/bin/env python 指定代码执行程序
# _*_coding:utf-8_*_ 指定编码格式

操作符

主要包括算术操作符、比较操作符和逻辑操作符。
算术操作符:

+   加
-   减
/   算术除
*   乘
//  相除取整
%   取余
**  乘方
>>> 5/3
1.6666666666666667
>>> 5//3
1
>>> 5%3
2
>>> 5**3
125

比较操作符:
< > == <= >= != <>
python目前支持两种不等于比较操作符,但是对于2和3支持却不相同:

$ python
Python 2.7.13 (default, Mar 13 2017, 20:56:15)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 5!=1
True
>>> 5<>1
True
----------------------------------------------------------
$ python3
Python 3.6.1 (default, Mar 21 2017, 21:49:16)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 5!=1
True
>>> 5<>1File "<stdin>", line 15<>1^
SyntaxError: invalid syntax

逻辑操作符:
and or not
有一个特殊的现象:
>>> 3<4<5 True >>> 3<4 and 4<5 True

变量与赋值

python的变量名是大小敏感的,其命名是以字母开头,大小写皆可,在加上数字和下划线。
python是动态语言,不需要预先声明变量的类型,其类型和值在被赋值的那一刻就已经被初始化了。
python支持增量赋值,即:

>>> n = 10
>>> n += 10
>>> n
20

但是并不支持自增与自减。

数字

主要包括:有符号整型、长整型、布尔值、浮点值和复数
eg:
long 27879898L -7867L
complex 6.23+1.5j 0+1j 1+0j

其中长整型在3.6版本应该发生了变化:

$ python3、
Python 3.6.1 (default, Mar 21 2017, 21:49:16)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> nj = 1231321LFile "<stdin>", line 1nj = 1231321L^
SyntaxError: invalid syntax
-----------------------------------------------------------
$ python
Python 2.7.13 (default, Mar 13 2017, 20:56:15)
[GCC 5.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> nj = 182391283L
>>>

更具体的需要去查询文档。

此外还包括第六种数字类型:decimal用于十进制浮点数,python2.4之后已经增加了。

>>> import decimal
>>> decimal.Decimal(1.1)
Decimal('1.100000000000000088817841970012523233890533447265625')
>>> print(decimal.Decimal('1.1'))
1.1

字符串

Python中的字符串被定义为引号之间的字符集合。python支持使用成队的单引号或者双引号,三引号可以用来包含特殊字符。使用索引和切片可以得到子字符串。字符索引从0开始,最后一个字符索引为-1.

#!/usr/bin/env python
# _*_coding:utf-8_*_
str1 = "python"
str2 = "cpython"print(str1)
print(str2)
print(str1[::-1])for i in range(len(str1)):print(str1[i])for i in range(len(str2)):print(str2[:i+1])

输出:

C:\Users\yanta\AppData\Local\Programs\Python\Python36\python.exe G:/Code/python/1.py
python
cpython
nohtyp
p
y
t
h
o
n
c
cp
cpy
cpyt
cpyth
cpytho
cpythonProcess finished with exit code 0

列表和元组

列表和元组可以当成普通的“数组”,能够保存任意数量的任意类型的Python对象。和数组一样,可通过数字索引访问元素,且索引从0开始。依然可以切片运算。

区别:list用中括号[]包裹,元素个数和值可以改变。tuple是使用小括号()包裹,不可改变,可以看成只读的列表。

list = [1, 2, 3, 4]
tuple = ('a', 'b', 'c', 'd')print(list[::-1])
print(tuple[::-1])for i in range(len(list)):print(list[i])for i in range(len(tuple)):print(tuple[i])for i in range(len(list)):print(list[:i+1])for i in range(len(tuple)):print(tuple[:i+1])

输出结果:

[4, 3, 2, 1]
('d', 'c', 'b', 'a')
1
2
3
4
a
b
c
d
[1]
[1, 2]
[1, 2, 3]
[1, 2, 3, 4]
('a',)
('a', 'b')
('a', 'b', 'c')
('a', 'b', 'c', 'd')

字典

字典是python的映射数据类型,有键值对构成。值可以为任意类型的python对象,字典元素用大括号({ })包裹。

# 字典
dict = {'name': 'yt', 'age': '17'}print(dict.keys())dict['name'] = 'boy'
print(dict)
for key in dict:print(dict[key])

输出结果:

dict_keys(['name', 'age'])
{'name': 'boy', 'age': '17'}
boy
17

这里的dict.keys()在2.7和3.6版本中有所变化:
$ python2 Python 2.7.13 (default, Mar 13 2017, 20:56:15) [GCC 5.4.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> dict = {'name': 'yt', 'age': '17'} >>> dict.keys() ['age', 'name'] ----------------------------------------- $ python3 Python 3.6.1 (default, Mar 21 2017, 21:49:16) [GCC 5.4.0] on cygwin Type "help", "copyright", "credits" or "license" for more information. >>> dict = {'name': 'yt', 'age': '17'} >>> dict.keys() dict_keys(['name', 'age'])

代码块缩进对齐

python的代码块书写时不要靠小括号(())和花括号({ })来区分代码块区域的,而是直接使用缩进的方式,通用的缩进距离是4。
在解释器中输入代码也要注意缩进:

>>> for i in range(3):
... print(i) #无缩进File "<stdin>", line 2print(i)^
IndentationError: expected an indented block
>>> for i in range(3):
...     print(i)  #有缩进
...
0
1
2

语句

if语句

语法如下:

if expression:pass

特别注意缩进和if语句后的:.

if expression1:pass1
elif expression2:pass2
else:pass3

while循环

语法如下:

while expression:pass

for循环

python中的for循环与传统的for循环不一样,更像shell脚本中的foreach迭代。每次选取迭代对象中的一个。

>>> for i in [1, 2, 3, 4]:
...     print(i)
...
1
2
3
4

此外,for循环经常与range()内建函数一起使用:

list = ['a', 'b', 'c', 'd']for i in range(3):print(i)for i in range(len(list)):print(list[i])

输出结果:

0
1
2
a
b
c
d

列表解析

就是你可以在这一行中使用一个for循环将所有的值放到一个列表中;

>>> [x**2 for x in range(4)]
[0, 1, 4, 9]

还可以加入过滤条件:

>>> [x**2 for x in range(4) if not x%2]
[0, 4]
>>> [x**2 for x in range(4) if  x%2]
[1, 9]

文件与内建函数open()

python可以进行文件访问:
open()函数可以打开文件,并且可以指定使用什么方式:

myfile = open('filename', 'r,w,a,b,[+]')

其中‘+’表示读写,‘b’表示二进制,默认为‘r’。如果执行成功,一个文件对象句柄会被返回。后续文件操作必须通过此文件句柄进行。

文件对象有一些方法,如readlines()和close(),通过句点标识法访问。

logfile = open('log.txt', 'r')
for eachline in logfile:print(eachline)
logfile.close()

执行结果:

$ python3Python 3.6.1 (default, Mar 21 2017, 21:49:16)[GCC 5.4.0] on cygwinType "help", "copyright", "credits" or "license" for more information.

错误与异常

主要就是将代码封装进入try-except语句中就可以了。try之后是你打算管理的代码,expect之后则是处理错误的代码。

# python3.6
try:logfile = open('log.txt', 'r')for eachline in logfile:print(eachline)logfile.close()
except IOError:print('file open error')
# python2.7
try:logfile = open('log.txt', 'r')for eachline in logfile:print(eachline)logfile.close()
except IOError, e:print('file open error:', e)

从商可以看到两个版本中还是有多不同的,也可以使用as来达到同样的效果:

try:logfile = open('log.txt', 'r')for eachline in logfile:print(eachline)logfile.close()
except IOError as e:print('file open error', e)

当删除log.txt后可以看到异常:

file open error [Errno 2] No such file or directory: 'log.txt'

此外在还可以增加else语句,else语句表示当没有异常,try后代码语句执行成功后,执行else后的语句;而且在执行异常处理expect语句后可以执行再finaily语句。

try:logfile = open('log.txt', 'r')for eachline in logfile:print(eachline)logfile.close()
except IOError as e:print('file open error', e)
else:print('Open log.txt sucessful!')
finally:print('IOError ...')

输出结果:

$ python3Python 3.6.1 (default, Mar 21 2017, 21:49:16)[GCC 5.4.0] on cygwinType "help", "copyright", "credits" or "license" for more information.Open log.txt sucessful!

函数

定义函数语法:

def functionName([arguments]):"说明语句"pass

调用函数:

functionName(arg)

此外,参数可以设置默认值

def test(name = 'yt'):print(name)test('hehe')
test()

测试结果:

hehe
yt

定义类语法:

class ClassName(base_class[es]):         "optional documentation string"          static_member_declarations          method_declarations 

eg:

class test(object):name = 'yt'def __init__(self, num = 17):self.age = numprint('age is ', num)def show(self): print(self.name, ' is ', self.age, 'years old!')print(self.__class__.__name__)foo = test() #定义类后需要创建实例
foo.show()  #再调用方法

输出:

age is  17
yt  is  17 years old!
test

模块

模块实际上就是一个python程序文件,包括可执行代码、函数和类或者其他的东西组合。

当你创建一个python源文件,模块的名字就是不带.py后缀的文件名。

模块的导入方法:

import module
from module improt method

eg:

>>> import sys
>>> sys.stdout.write('Hello World!')
>>> Hello World!

补充

dir([obj]):描述对象的属性,如果没有提供参数,则会显示全局变量的名字

>>> dir(3)
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']
>>> dir()
['__annotations__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__spec__', 'dict', 'i']

转载于:https://www.cnblogs.com/iskylite/p/7739589.html

相关文章:

丽水风光(二)—劫色“古堰画乡”

丽水风光 &#xff08;二&#xff09; 劫色古堰画乡 驱车从鸥江到古堰画乡大约二十分钟。一路由同学&#xff2c;老弟相陪&#xff0c;车刚停在江边&#xff0c;我就被美景陶醉&#xff0c;撇下老同学&#xff0c;旁若无人地与&#xff38;兄一边卡嚓卡嚓去了&#xff0c;一副“…

爱情神话:庄妃用美色套牢洪承畴之谜

题记&#xff1a;庄妃&#xff0c;一个蒙古族的美丽&#xff0c;用她的美色俘获了大明王朝铁血将军洪承畴之心&#xff0c;不仅为满清开国立下了不世之功&#xff0c;而且也打造了一个千古流传的爱情神话。庄妃&#xff0c;孝庄文皇后&#xff0c;博尔济吉特氏&#xff0c;蒙古…

SQLServer2005数据库自动备份

一。SqlServer自动作业备份 1、打开SQL Server Management Studio 2、启动SQL Server代理 3、点击作业->新建作业 4、"常规"中输入作业的名称 5、新建步骤&#xff0c;类型选T-SQL&#xff0c;在下面的命令中输入下面语句 DECLARE strPath NVARCHAR(200)set strP…

JavaScript Array相关方法

JavaScript 标准内置对象 Array常用方法Array.prototype.every()Array.prototype.some()Array.prototype.filter()Array.prototype.find()Array.prototype.findIndex()Array.prototype.indexOf()Array.prototype.includes()Array.prototype.map()其他1. [JavaScript数组去重](h…

Web API之基于H5客户端分段上传大文件

http://www.cnblogs.com/OneDirection/articles/7285739.html 查询很多资料没有遇到合适的&#xff0c;对于MultipartFormDataStreamProvider 也并是很适合&#xff0c;总会出现问题。于是放弃&#xff0c;使用了传统的InputStream 分段处理完之后做merge处理。 前台分段规则 命…

对MySQL进行逻辑卷备份与恢复

ZRM 我之前我介绍过&#xff0c;这里就不多少了。以下是关于用mysql-zrm 来测试 基于LVM 逻辑卷管理的数据库全库备份。我这里用的是SUN 的VBOX 虚拟机来做的测试&#xff0c;基于Red Hat AS 5.3。1. 先建立逻辑卷。fdisk 我就不介绍了&#xff0c;这里演示下怎么用创建逻辑卷以…

医保退费主要流程

1.系统初始化Init GetInvoiceInfo with QryInvoice dobeginClose;ParamByName(DanJuID).AsString:edtDjid.Text;Open;vJiuZhenID:FieldByName(JiuZhenID).AsInteger;GetClinicInfo(vJiuZhenID);//获得就诊信息pnlDjrq.Caption:FieldByName(SerialNo).AsString;pnlSkr.Caption:F…

oo第一单元总结

第一次作业 第一次作业自己虽然很想向着面向对象的方向上写&#xff0c;但写出来还是很C语言式的程序。从头到尾扫描字符串&#xff0c;扫到加减号便认为接下来是一项&#xff0c;再用正则表达式去分情况匹配出这一项。用Hashmap来存储数据&#xff0c;方便合并同类项。最后套一…

npm run build打包失败

使用npm run build命令打包Angular项目时报错&#xff0c;错误信息如下&#xff1a; WARNING in budgets, maximum exceeded for initial. Budget 2 MB was exceeded by 3.33 MB.ERROR in budgets, maximum exceeded for initial. Budget 5 MB was exceeded by 340 kB. npm ER…

YII2 models非常好用的控制输出数据【重写Fields】

models里重写Fields真的很好用&#xff0c;用于分类、评论功能 列子&#xff1a;评论表models/Comment.php 1、关联商品表 2、获取父级&#xff08;即管理员&#xff09;评论 public function Fields()//添加parentComment自定义字段输出 { $fields parent::Fields(); $fi…

Visual studio 2005如何实现源码管理

转自CSDN Visual studio 2005如何实现源码管理(Visual Studio .Net团队开发)目录&#xff1a; 〇、 摘要一、 开发前的准备 二、 创建空的SourceSafe数据库 三、 新建项目并加入版本控制 四、 获取SourceSafe中的项目 五、 版本控制的几个概念 六、 版本控制项目的管理 七、 总…

error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS64

今天部署一个探针在运行的时候报了这样一个错&#xff1a;error while loading shared libraries: libstdc.so.5: wrong ELF class: ELFCLASS64 [rootdb152 rma_p_unix]# ldd xxxxlinux-gate.so.1 > (0x00dd7000)libstdc.so.5 > not found # 发现这边动态库找不着 这…

package.json 依赖包版本号

依赖包版本号格式&#xff1a;major.minor.patch major 为主版本号(大版本号)&#xff0c;变化了表示有了一个不兼容上个版本的大更改。 minor 为次版本号(小版本号)&#xff0c;变化了表示增加了新功能&#xff0c;并且可以向后兼容。 patch 为修订版本号&#xff0c;变化了…

.net下绘制统计图工具-请推荐

需要利用到行情、数据频道需要多种样式的表现形式&#xff0c;包括 饼图、柱图、折线图等等 重点是&#xff1a;展示效果好&#xff0c;开发效率高 以前用过dundas chart&#xff0c;不知道有没能生产flash的。 小弟初来乍到&#xff0c;还请给位不吝赐教 放两天置顶&#xff…

wireless(二维数组前缀和)

1 &#xff0e; 无线网络发射器选址(wireless.cpp/c/pas)【问题描述】随着智能手机的日益普及&#xff0c;人们对无线网的需求日益增大。某城市决定对城市内的公共场所覆盖无线网。假设该城市的布局为由严格平行的129条东西向街道和129条南北向街道所形成的网格状&#xff0c;并…

SQL Server 2000 从哪里看是哪个版本

有两种方法&#xff1a; 第一步&#xff1a;使用SQL语句查询 select version 查询结果如下&#xff1a; Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on Windows NT 5.1 (Build 2…

【洛谷p1313】计算系数

&#xff08;%%%hmr&#xff09; 计算系数【传送门】 算法呀那个标签&#xff1a; &#xff08;越来越懒得写辽&#xff09;&#xff08;所以今天打算好好写一写&#xff09; 首先&#xff08;axby&#xff09;k的计算需要用到二项式定理&#xff1a; 对于&#xff08;xy&#…

CMD——ping及用其检测网络故障

Ping命令全称Packet Internet Grope&#xff0c;即因特网包探测器。通过调用ICMP&#xff08;因特网控制报文协议&#xff09;&#xff0c;发送一份ICMP回显请求给目的主机&#xff0c;并等待返回ICMP回显应答。一般用来测试源主机到目的主机网络的连通性&#xff08;只有在安装…

TSLint 规则

除了在全局配置中使用TSLint规则&#xff0c;还可以在文件中使用TSLint规则。 当不想修改全局配置中的TSLint规则时&#xff0c;可以在文件中使用以下注释规则标志对TSLint规则进行修改。 // tslint:disable —— 忽略该行以下所有代码出现的错误提示&#xff0c;可以在文件首…

Weblogic禁用SSLv3和RC4算法教程

weblogic在启用https时一样会报同WebSphere那样的一SSL类漏洞&#xff0c;中间件修复这些漏洞原理上来说是一样的&#xff0c;只是在具体操作上有着较大的区别。 1. weblogic禁用SSLv3算法 编缉$DOMAIN_HOME/bin目录下的setDomainEnv.sh&#xff0c;找到"JAVA_OPTIONS&quo…

转《两个个很形象的依赖注入的比喻》

何谓控制反转&#xff08;IoC Inversion of Control&#xff09;&#xff0c;何谓依赖注入&#xff08;DI Dependency Injection&#xff09;&#xff1f;一直都半懂不懂&#xff0c;今天看到两个比喻&#xff0c;觉得比较形象。 IoC&#xff0c;用白话来讲&#xff0c;就是…

线程上下文设计模式

import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream;public class Test {public static void main(String[] args){ThreadLocalExample.test();} }/*21.2 线程上下文设计*/class ApplicationConfigurat…

自定义控件--基础2

Control类程序按控件的步骤: 呈现控件的步骤 1.RenderControl方法 代码如下: protected void RenderControl(HtmlTextWriter writer) { if(Visible) { Render(writer);}} 先判断Visible,然后进行Render.2.Render方法 public virtual void Render(HtmlTextWriter writer) { Rend…

input输入框为number类型时,去掉上下小箭头

input输入框type为number时&#xff0c;去掉上下小箭头&#xff0c;方式如下&#xff1a; <input type"number" ...><style>/* 在Chrome浏览器下 */input::-webkit-outer-spin-button,input::-webkit-inner-spin-button {-webkit-appearance: none;}/* 在…

数据库和数据仓库的区别

简而言之&#xff0c;数据库是面向事务的设计&#xff0c;数据仓库是面向主题设计的。 数据库一般存储在线交易数据&#xff0c;数据仓库存储的一般是历史数据。 数据库设计是尽量避免冗余&#xff0c;一般采用符合范式的规则来设计&#xff0c;数据仓库在设计是有意引入冗余&a…

我是主考官:两次弃用的变态笔试题

故事&#xff08;3&#xff09;&#xff1a;两次弃用的变态笔试题电话的沟通虽然不可能对一个程序员作全面的了解&#xff0c;但基本上能有一个比较概括的判断&#xff0c;这也许就是所谓的第一印象吧&#xff01;通过电话的初步沟通我对来面试的程序员已经有了初步的印象&…

[Swift]LeetCode901. 股票价格跨度 | Online Stock Span

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号&#xff1a;山青咏芝&#xff08;shanqingyongzhi&#xff09;➤博客园地址&#xff1a;山青咏芝&#xff08;https://www.cnblogs.com/strengthen/&#xff09;➤GitHub地址&a…

java基础===点餐系统

public class OrderMsg {public static void main(String[] args) throws Exception { /** * 订餐人姓名、选择菜品、送餐时间、送餐地址、订单状态、总金额 * 01.创建对应的数组 * 02.数组的初始化 * 03.显示菜单 * 04.根据用户的选择进去指定的模块 */ String[] names new S…

HTML页面中使两个div并排显示

在HTML中实现两个div并排显示&#xff0c;方法如下&#xff1a; 方法1&#xff1a;设置float浮动对需要并排显示的div设置样式&#xff1a;style"float:left;" <div style"float:left;">div1</div>方法2&#xff1a;设置div为行内样式对需要并…

备案网站管理系统是JSP做的

备案网站管理系统 http://www.miibeian.gov.cn/ 浪费了我一上午的时间没成功.靠!转载于:https://www.cnblogs.com/splyn/archive/2009/12/24/1631281.html