上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页

2012年12月28日

图案

摘要: python -c "print ''.join(__import__('random').choice(u'\u2571\u2572') for i in range(28*10))"╱╱╱╱╱╲╲╲╲╲╱╲╲╲╱╲╲╱╲╲╱╱╲╱╱╱╲╲╲╲╱╲╱╲╱╱╲╲╱╱╱╱╲╲╲╲╲╲╲╱╲╱╲╲╱╱╲╱╱╱╲╱╱╱╱╲╱╲╱╱╱╱╲╱╲╲╱╲╱╲╲╱╲╱╱╲╲╲╱╱╱╲╲╲╲╲╱╲╱╱╲╲╱╲╲╲╱╲╲╱╲╲╱╲╱╲╲╲╱╱╱╱╱╱╱╱╲╱╱╱╲╲╱╲╱╱╲╲╱╲╱╱╱╲╲╲╱╱╲╱╱╲╲╲╲╱╲╱╲╲╲╱╲╱╱╲╱╱╲╲╲╲╲ 阅读全文

posted @ 2012-12-28 13:16 wangbokun 阅读(123) 评论(0) 推荐(0) 编辑

python随机获得一个密码

摘要: #-*-coding:utf-8-*-'''简短地生成随机密码,包括大小写字母、数字,可以指定密码长度'''#生成随机密码fromrandomimportchoiceimportstring#python3中为string.ascii_letters,而python2下则可以使用string.letters和string.ascii_lettersdefGenPassword(length=8,chars=string.ascii_letters+string.digits):return''.join([choice(chars 阅读全文

posted @ 2012-12-28 13:02 wangbokun 阅读(138) 评论(0) 推荐(0) 编辑

2012年12月20日

python urlopen

摘要: 一、打开一个网页获取所有的内容fromurllibimporturlopendoc=urlopen("http://www.baidu.com").read()printdoc二、获取Http头fromurllibimporturlopendoc=urlopen("http://www.baidu.com")printdoc.info()printdoc.info().getheader('Content-Type') 阅读全文

posted @ 2012-12-20 15:08 wangbokun 阅读(124) 评论(0) 推荐(0) 编辑

2012年12月17日

ubuntu 12.04下gedit查看txt中文乱码解决办法

摘要: 由于我不能要求别人保存txt文件时必须用utf-8,那我只能自己找解决办法:打开终端输入:gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"gsettings set org.gnome.gedit.preferences.encodings sho 阅读全文

posted @ 2012-12-17 12:03 wangbokun 阅读(133) 评论(0) 推荐(0) 编辑

2012年12月13日

函数和变量

摘要: def cheese_and_crackers(cheese_count, boxes_of_crackers): print "You have %d cheeses!" % cheese_count print "You have %d boxes of crackers!" % boxes_of_crackers print "Man that's enough for a party!" print "Get a blanket.\n"print "We can just give the 阅读全文

posted @ 2012-12-13 11:16 wangbokun 阅读(149) 评论(0) 推荐(0) 编辑

vbox设置剪切板共享

摘要: 阅读全文

posted @ 2012-12-13 10:31 wangbokun 阅读(224) 评论(0) 推荐(0) 编辑

vboxsvr

摘要: 1. 在主机中执行 VBoxManage sharedfolder add "VM name" -name "sharename" -hostpath "test" 该命令中的 VM name 指定要使用共享文件夹的虚拟机名称,如 WinXP;sharename 为共享的文件夹名称,可任意设置。test 为主机上需要共享的文件夹。 例子:VBoxManage sharedfolder add "xp" -name "公共的" -hostpath "/home/zgf/公共的" 阅读全文

posted @ 2012-12-13 10:21 wangbokun 阅读(1116) 评论(0) 推荐(0) 编辑

2012年12月12日

work-status-

摘要: 阅读全文

posted @ 2012-12-12 15:57 wangbokun 阅读(148) 评论(0) 推荐(0) 编辑

VNC服务全攻略

摘要: VNC服务全攻略一、VNC简单介绍:1、简介 VNC (Virtual Network Computing)是虚拟网络计算机的缩写。VNC是一款优秀的远程控制工具软件,由著名的AT&T的欧洲研究实验室开发的。VNC是在基于UNIX和Linux操作系统的免费的开放源码软件,远程控制能力强大,高效实用。 其性能可以和Windows和MAC中的任何远程控制软件媲美。——百度百科ps:Symantec的pcAnywhere也是优秀的远程软件,windows环境下的。2、vnc工作流程:(1)VNC客户端通过浏览器或VNC Viewer连接至VNC Server。 (2)VNC Server传送 阅读全文

posted @ 2012-12-12 15:47 wangbokun 阅读(1054) 评论(0) 推荐(0) 编辑

2012年12月11日

读写文件

摘要: 如果你做了上一个练习的加分习题,你应该已经了解了各种文件相关的命令(方法/函数)。你应该记住的命令如下:close – 关闭文件。跟你编辑器的文件->保存..一个意思。read – 读取文件内容。你可以把结果赋给一个变量。readline – 读取文本文件中的一行。truncate – 清空文件,请小心使用该命令。write(stuff) – 将stuff写入文件。这是你现在该知道的重要命令。有些命令需要接受参数,这对我们并不重要。你只要记住write的用法就可以了。write需要接收一个字符串作为参数,从而将该字符串写入文件。让我们来使用这些命令做一个简单的文本编辑器吧: 1 2 3 阅读全文

posted @ 2012-12-11 11:26 wangbokun 阅读(728) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 22 下一页

导航