python
Bennett_Doris
这个作者很懒,什么都没留下…
展开
-
2021-08-23
189. 旋转数组给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。进阶:尽可能想出更多的解决方案,至少有三种不同的方法可以解决这个问题。你可以使用空间复杂度为 O(1) 的 原地 算法解决这个问题吗?示例 1输入: nums = [1,2,3,4,5,6,7], k = 3输出: [5,6,7,1,2,3,4]解释:向右旋转 1 步: [7,1,2,3,4,5,6]向右旋转 2 步: [6,7,1,2,3,4,5]向右旋转 3 步: [5,6,7,1,2,3,原创 2022-05-11 16:28:22 · 203 阅读 · 0 评论 -
编译 intel-ros realsense 出错 Invoking “make -j4 -l4“ failed module ‘em‘ has no attribute ‘Interpreter
错误如下Traceback (most recent call last): File "/opt/ros/melodic/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 43, in <module> import genmsg.template_tools File "/opt/ros/melodic/lib/python2.7/dist-packages/genmsg/template_tools.py",原创 2021-05-19 16:45:38 · 2919 阅读 · 1 评论 -
python实现远程唤醒windows
class RemoteWake(object): def __init__(self): pass def format_mac0(self,mac): if len(mac) == 12: pass elif len(mac) == 17: if mac.count(':') == 5 or mac.count('-') == 5: sep = mac[2]原创 2021-05-13 09:49:43 · 726 阅读 · 0 评论 -
python 控制和监控键盘输入 pynput模块
控制键盘输入用 pynput.keyboard.Controller 来实现from pynput.keyboard import Key, Controllerkeyboard = Controller()# 按下和释放空格键keyboard.press(Key.space)keyboard.release(Key.space)# 键入小写字母“a”keyboard.press('a')keyboard.release('a')# 键入两个大写字母,两种方式keyboard.原创 2021-04-02 17:57:08 · 4385 阅读 · 0 评论 -
python 控制和监控鼠标输入 pynput模块
控制鼠标输入使用 pynput.mouse.Controller 来实现from pynput.mouse import Button, Controllermouse = Controller()# 读取鼠标的位置print('The current pointer position is {0}'.format( mouse.position))# 设置鼠标的位置mouse.position = (10, 20)print('Now we have moved it to原创 2021-04-02 17:00:20 · 619 阅读 · 0 评论