desktop

文件路径转义问题

与世无争的帅哥 提交于 2020-01-22 18:26:07
1.字符串中\表示转义,比如\n表示换行,\t表示制表符Tab, \u表示后面是Unicode编码, 2.转义带来的问题:路径中如果有\u,被转义后就不是原来所写的路径了 3.3种解决的办法: 1)在路径前面加r或R: r'd:\a.txt' file = open(r"C:\Users\acer-pc\Desktop\test.txt") res = file.read() print(res) 2)路径使用/,这也是Linux中的路径写法: 'd:/a.txt' file = open("C:/Users/acer-pc/Desktop/test.txt") res = file.read() print(res) 3)路径使用\: 'd:\a.txt' file = open(r"C:\Users\acer-pc\Desktop\test.txt", "w") res = file.write("today is a good day, bad thing is i miss him ,althongh i know he doesn't like me") 来源: https://www.cnblogs.com/come202011/p/12229101.html

Implementing my own remote desktop in java

淺唱寂寞╮ 提交于 2020-01-22 11:02:49
问题 I am trying to implement my own remote desktop solution in java. Using sockets and TCP/UDP. I know I could use VNC or anything else, but its an assignmentwork from school that I want to do. So for moving the mouse and clicking I could use the Robot class. I have two questions about this: What about sending the video? I know the Robot class can capture the screen too, so should I just send images in a sequence and display in order at the other side of the connection? Is this the best way to

Implementing my own remote desktop in java

空扰寡人 提交于 2020-01-22 11:02:10
问题 I am trying to implement my own remote desktop solution in java. Using sockets and TCP/UDP. I know I could use VNC or anything else, but its an assignmentwork from school that I want to do. So for moving the mouse and clicking I could use the Robot class. I have two questions about this: What about sending the video? I know the Robot class can capture the screen too, so should I just send images in a sequence and display in order at the other side of the connection? Is this the best way to

windows10安装docker desktop(非VMBox)

↘锁芯ラ 提交于 2020-01-22 00:01:26
目录 Docker Desktop 环境 下载 运行命令 常见坑处理 坑1 坑2(由坑1引发) Docker Desktop 环境 确认操作系统是Win10 Pro 、 教育版本 确认系统是否能开启虚拟化 cmd命令 systeminfo 开启Hyper-v 自行查询 下载 下载地址 运行命令 docker --version 如下图表示安装成功了 常见坑处理 坑1 出现如下错误 unable to resolve docker endpoint: Open C:\User\xxx\.docker\machine\machines\default\ca.pem: The system cannot find the path specified. 解决办法 网上一堆删除环境重新安装的文章,我大部分都尝试过了,没有好用的。 我的解决办法 参考文档 执行命令 docker-machine create --driver hyperv default 如果成正确创建,那你已经跳过了这个坑,继续玩docker好了。 坑2(由坑1引发) 在坑1中执行docker-machine命令的时候出现错误 主要的意思是虚拟交换机网络设置失败了,还是参考坑1的资料 到此一切顺利了,如果你有遇到困难可以回复一起讨论或者补充 https://docs.docker.com/machine/reference

C#: Set Desktop Wallpaper to a Solid Color

安稳与你 提交于 2020-01-21 12:04:06
问题 I'm using this code to remove the current wallpaper and set a solid color: public static class WallpaperColorChanger { public static void SetColor(Color color) { // Remove the current wallpaper NativeMethods.SystemParametersInfo( NativeMethods.SPI_SETDESKWALLPAPER, 0, "", NativeMethods.SPIF_UPDATEINIFILE | NativeMethods.SPIF_SENDWININICHANGE); // Set the new desktop solid color for the current session int[] elements = { NativeMethods.COLOR_DESKTOP }; int[] colors = { System.Drawing

C#: Set Desktop Wallpaper to a Solid Color

混江龙づ霸主 提交于 2020-01-21 12:02:41
问题 I'm using this code to remove the current wallpaper and set a solid color: public static class WallpaperColorChanger { public static void SetColor(Color color) { // Remove the current wallpaper NativeMethods.SystemParametersInfo( NativeMethods.SPI_SETDESKWALLPAPER, 0, "", NativeMethods.SPIF_UPDATEINIFILE | NativeMethods.SPIF_SENDWININICHANGE); // Set the new desktop solid color for the current session int[] elements = { NativeMethods.COLOR_DESKTOP }; int[] colors = { System.Drawing

python:os模块常用方法整理

自古美人都是妖i 提交于 2020-01-20 22:30:12
  在日常python编程中,经常需要对大量文件和大量路径进行操作,这就依赖于os模块,下面是我对os模块常用方法的整理。 1、 获 取 当 前路 径 及路 径 下的文件 (1)os.getcwd():查看当前所在路径 >>> os.getcwd() 'C:\\Users\\f1237928\\Desktop' (2)os.listdir(path):列出制定路径下的所有文件及文件夹,不传参时path为当前路径,返回值为列表类型 >>> os.listdir() ['desktop.ini', 'HOME', 'Navicat 12 for MySQL.lnk', 'news', 'Qshop', 'test'] 2 、 绝对 路 径   os.path.abspath(path):返回path的绝对路径 >>> os.path.abspath('.') 'C:\\Users\\f1237928\\Desktop' 3 、 将 路 径 分割成路 径 和文件 / 文件 夹 名部分 (1)os.path.split(path):返回值为元组类型,若路径末尾字符为“//”,返回(路径, “”);有则返回(上级路径, 文件/文件夹名);若整个路径当中不存在”//”,则返回(“”,路径)。返回的路径末尾均不包含“//” >>> os.path.split('C:\\Users\

Programmatically changing desktop image

孤街浪徒 提交于 2020-01-20 03:49:05
问题 I am trying to change the desktop image; the procedure I've come up with is below. The first time this code is run, the resized image is displayed on screen as wallpaper, but the next time there is no reaction. What am I doing wrong? -(IBAction)click:(id)sender { NSData *sourceData; NSError *error; NSFileManager *filemgr; filemgr = [NSFileManager defaultManager]; screenArray = [NSScreen screens]; screenCount = [screenArray count]; unsigned index = 0; for (index; index < screenCount; index++)

Programmatically changing desktop image

扶醉桌前 提交于 2020-01-20 03:48:32
问题 I am trying to change the desktop image; the procedure I've come up with is below. The first time this code is run, the resized image is displayed on screen as wallpaper, but the next time there is no reaction. What am I doing wrong? -(IBAction)click:(id)sender { NSData *sourceData; NSError *error; NSFileManager *filemgr; filemgr = [NSFileManager defaultManager]; screenArray = [NSScreen screens]; screenCount = [screenArray count]; unsigned index = 0; for (index; index < screenCount; index++)

第8章利用python读写文件

眉间皱痕 提交于 2020-01-20 02:25:27
文件名与文件路径 (1)文件名:包括文件名与扩展名。如hello.py, hello是文件名,py为扩展名,指出的文件的类型。 (2)根路径,根文件夹,包含了所有其他文件夹,’如:C:\ os.path.join( ) 函数 (1) 将单个文件和路径上的文件夹传递给os.path.join( ) 函数,会返回一个文件路径的字符串,包含正确的路径分隔符。注意反斜杠“\”有两个,一个为路径分隔符,一个为转义字符。 >> > import os >> > os . path . join ( 'user' , 'bin' , 'spam' ) 'user\\bin\\spam' (2)利用os.path.join( ) 函数创建文件名称的字符串 >> > MyFiles = [ 'account.txt' , 'detail.csv' , 'invite.docx' ] >> > for filename in MyFiles : . . . print ( os . path . join ( 'C:\\users\\asweigart' , filename ) ) C : \users\asweigart\account . txt C : \users\asweigart\detail . csv C : \users\asweigart\invite . docx 当前工作目录