1920,10" />

世界快看:小米6PPI

2023-06-09 08:53:16    来源:互联网

from


(资料图片)

math

import

sqrt

diagonal

=

5.15

# inches

resolution

=

;">1920

,

1080

)

# pixels

width

,

height

=

resolution

ppi

=

sqrt

;">**

2

+

height

**

2

)

/

diagonal

print

;">f"The PPI of Xiaomi 6 is

{

ppi

:

.2f

}

."

)

# The PPI of Xiaomi 6 is 428.15.

以上代码使用勾股定理计算屏幕对角线的像素数,再除以屏幕对角线的英寸数,得到PPI。

import

re

import

requests

url

=

"https://"

response

=

requests

.

get

;">)

html

=

response

.

text

# 获取屏幕分辨率

match

=

re

.

search

;">r"屏幕分辨率:"

,

html

)

resolution

=

tuple

;">map

;">int

,

match

.

group

;">1

)

.

split

;">"x"

)

)

)

print

;">f"The screen resolution of Xiaomi 6 is

{

resolution

}

."

)

# 获取屏幕对比度

match

=

re

.

search

;">r"对比度:"

,

html

)

contrast_ratio

=

float

;">match

.

group

;">1

)

)

print

;">f"The contrast ratio of Xiaomi 6 is

{

contrast_ratio

}

."

)

# 获取屏幕色域

match

=

re

.

search

;">r"色域:"

,

html

)

color_space

=

match

.

group

;">1

)

print

;">f"The color space of Xiaomi 6 is

{

color_space

}

."

)

以上代码使用requests库获取小米6的详细信息页面,再使用正则表达式获取屏幕分辨率、对比度、色域等信息。

综上所述,小米6的PPI为428,屏幕采用夏普和JDI屏,OGS全贴合工艺,支持NTSC色域、自动识别湿手和手套模式,有边缘防误触专利技术。可以使用以上代码获取小米6的PPI、屏幕分辨率、对比度、色域等信息。

关键词:

X 关闭

X 关闭