Archive for June, 2010

google拼音在系统目录下所存放的文件

在命令行中输入

cls

cd /d %SystemDrive%

cd /

dir /a /s *pinyin* > %temp%google.txt

notepad %temp%google.txt

::del %temp%google.txt

驱动器 C 中的卷没有标签。
卷的序列号是 28EC-3A24

C:Program FilesGoogle 的目录

2010/05/30  13:01    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:Program FilesGoogleGoogle Pinyin 2 的目录

2010/05/30  13:01         1,201,648 GooglePinyinDaemon.exe
2010/05/30  13:01           242,160 GooglePinyinDashboard.exe
2010/05/30  13:01           866,800 GooglePinyinDictionary.exe
2010/05/30  13:01         1,048,048 GooglePinyinOptions.exe
2010/05/30  13:01           214,512 GooglePinyinReporter.exe
2010/05/30  13:01           761,840 GooglePinyinService.exe
2010/05/30  13:01           123,888 GooglePinyinSet.exe
2010/05/30  13:01         1,302,000 GooglePinyinSettingWizard.exe
2010/05/30  13:01           167,408 GooglePinyinUninstaller.exe
               9 个文件      5,928,304 字节

C:ProgramDataGoogle 的目录

2010/05/30  13:14    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UsersAdministratorAppDataRoamingGoogle 的目录

2010/05/30  13:14    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UsersAll UsersGoogle 的目录

2010/05/30  13:14    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UserslessAppDataLocalMicrosoftWindowsTemporary Internet FilesVirtualizedCUserslessAppDataRoamingGoogle 的目录

2010/06/05  21:46    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UserslessAppDataRoamingGoogle 的目录

2010/06/05  20:17    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UserszdbAppDataLocalMicrosoftWindowsTemporary Internet FilesVirtualizedCUserszdbAppDataRoamingGoogle 的目录

2010/06/25  22:43    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:UserszdbAppDataRoamingGoogle 的目录

2010/06/02  21:25    <DIR>          Google Pinyin 2
               0 个文件              0 字节

C:WindowsSystem32 的目录

2010/05/30  13:01         2,102,256 GooglePinyin2.ime
               1 个文件      2,102,256 字节

这些目录下的文件有100多m

用火狐扩展flashgot 下载音乐

image

首先你要有火狐浏览器(firefox),现在版本是3.6.3吧,安装后,可能还要装一下flash插件,这样才可以看土豆网之类的视频网。

然后点开工具(tools)菜单,点击扩展(add-ons),点击获取扩展,输入flashgot,点击加进火狐,弹出来一个警告,选是,安装完毕后重启firefox。

image

http://music.sina.com.cn/yueku,进入这个sina乐库网站,找一首歌,播放音乐时,注意播放音乐的网页的右下角,有一个像磁盘的图标,右键点它,选择要下载的文件,

然后选择保存目录保存。

image 

同样这个网站http://haoting.com/,好听音乐网的也可以用此法保存音乐,不过是wma格式的。

其他我测试的网站可用的是tudou,you河蟹tube。或许其他一些网站也可以。

在win7测试通过。或许其他系统也可以。

Textbox 中获得文字光标的屏幕坐标

Textbox 中获得文字光标的屏幕坐标(注意:非鼠标坐标,鼠标坐标我自己用API会找)

Graphics dc = this.CreateGraphics();

int wd = (int)dc.MeasureString("t", this.Font).Width;//一个字符的宽度

int ht = (int)dc.MeasureString("t", this.Font).Height;//一个字符的高度

Point p2 = this.GetPositionFromCharIndex(this.Text.Length -1 );//client坐标(相对于textbox)

Point p1 = this.PointToScreen(new Point(0, 0));//将textbox的原点坐标转换为屏幕坐标

p1.X += p2.X + wd;

p1.Y += p2.Y + ht;

这个p1便是我们所需的屏幕坐标

 

wps_clip_image-0

我就是通过这个坐标,把popup弹出来的

notepad++写python脚本的若干问题

notepad++编辑器可以在sf网站上找到,http://sourceforge.net/projects/notepad-plus/

image

最好以兼容性模式,管理员身份运行它,免得装一些插件时出现一些稀奇古怪的情况(比如安装插件时无法创建文件)

之后还是用一般模式运行notepad++吧,否则可能出现用右键“edit with notepad++”时会出现“CreateProcess (740) error in v5.6.6”这个错误

image

1,首先python是非常讲究缩进的,而notepad++的tab键缺省不为4个空格,所以在settings – preference – language menu/tab settings

中将replace by space 勾选,tab size设为4(找不到language menu/tab settings这个选项的话,请将通过settings – preference – general – localization把语言先设为英文)

2,将notepad++自动完成打开,settings – preference – Backup/Auto-completion,如下勾选

image

这样如下图所以,输入文字时,就可以自动完成了,不过这个自动完成功能不是特别爽,看一本书上介绍,

image

如果需要自己添加一些自动完成列表,请打开 F:Program FilesNotepad++pluginsAPIs

找到pythn.xml,往其中添加新规则

image

Note that you should create your api list in alphabetic order. ”

这是官方原话,也就是说你的规则排列要照一定顺序,大写在前,小写在后

不过好像现在这个自动完成的大小写配置也不好改

<Environment ignoreCase="no" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" additionalWordChars = "."/>

也尝试着将ignoreCase="no"该为yes,,所以对大小写支持很不爽,只能将它改为no

 

3)常用的快捷键

ctrl + f当前文档查找,

ctrl + shift + f在文件夹中查找,

f5 执行外部程序,

f6执行控制台命令(nppexec插件命令)

,ctrl + q注释

ctrl + g 到文档某行

ctrl + d 复制并写当前行

ctrl + l删除当前行

4)nppexec插件

执行命令

cd $(CURRENT_DIRECTORY)
F:Python26python $(FULL_CURRENT_PATH)

这两句话就是先进入当前目录,再执行当前python脚本

5)function list插件

http://sourceforge.net/projects/npp-plugins/files/Function%20List/

image

效果还行吧,只是不能区分类

install ironpython

First we should install 

1).net framework 2(may also .net framework sp1),maybe win7 users needn’t to install this

2).net framework 4

3)Direct 11 runtime http://www.microsoft.com/downloads/details.aspx?familyid=0CEF8180-E94A-4F56-B157-5AB8109CB4F5&displaylang=en

4)Ironpython-2.6.msi (this can be found at http://ironpython.codeplex.com/,you should download the version for .net framework 4

5)ironpython 2.6 example http://ironpython.codeplex.com/releases/view/12482

After install these components, go to the ironpython installation folder "F:Program FilesIronPython 2.6 for .NET 4.0",

In this folder,we add a new file named as "ipy.exe.config",and its content is

<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true">

    <supportedRuntime version="v4.0"/>

    <requiredRuntime version="v4.0.20506"/>

  </startup>

</configuration>

Save it.

This file can prevent a annoying error when running ipy script : "Mixed mode assembly is built against version ‘v1.1.4322’ of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

set path=%path%;F:Program FilesIronPython 2.6 for .NET 4.0

echo %path%

f:

cd F:ironpythoncodeIronPython-2.6-SamplesDirect3D

cmd

And in the console,input 

ipy tutorial.py

then you can see the demo,which is a tiger

wps_clip_image-1535