小编sj7*_*sj7的帖子

使用跨平台支持的python调整显示分辨率

使用python函数调整显示分辨率.它应该是跨平台的,即支持windows,linux和mac(根据操作系统可以有多个案例)

我有代码,我认为在Linux上工作(Ubuntu)我正在寻找一个Windows和Mac的解决方案(应该支持32和64位机器)

def SetResolution(width, height):
    os.popen("xrandr -s "+str(width)+'x'+str(height))
Run Code Online (Sandbox Code Playgroud)

如果有人能告诉我如何获得windows和mac可能的显示分辨率,我也会感激不尽

我在linux上的功能是这样的:

def GetResolutions():
    screen = os.popen("xrandr").readlines()
    possibleResolutions = []
    for a in screen:
        data = a.split()
        if len(data)<4:
            width, height = data[0].split('x')
            fps = re.sub("[^0-9.]", "", data[1])
            possibleResolutions.append({'width':int(width),'height':int(height),'fps':float(fps)})
            if '*' in data[1]:
                currentResolution = {'width':int(width),'height':int(height),'fps':float(fps)}
    return possibleResolutions, currentResolution
Run Code Online (Sandbox Code Playgroud)

python windows cross-platform desktop-application screen-resolution

13
推荐指数
2
解决办法
1万
查看次数

AngularJS typeahead +多选标签

我正在寻找的是类似于电子邮件地址的Gmails typeahead的输入

在此输入图像描述

挑战:

1)它应该显示名称EmailAddress和Image(基本上是一个可自定义的模板)

2)它应显示添加到列表中的联系人的姓名

3)它应该使用退格键来删除前一个条目

4)它应该与select一起工作,并添加新的etnry

multi-select typeahead angularjs angularjs-directive

7
推荐指数
1
解决办法
6790
查看次数