摘要: 今晚搞了一晚上,终于搞定了所有的问题,现在把他贴出来,作为一个教程 我是在virtualbox 下面安装的luubntu 13.04,因为我的笔记本性能不强,二代i3和2g内存,所以我的虚拟机配置比较低,给了lubuntu 512m的内存,8g硬盘,顺便说一下在virtualbox里面切换虚拟机的linux 的tty 的方法是按下键盘右边的 ctrl + F1 (f2 之类的也可以) 首先 ,用到的命令如下 1.mount 挂载分区 2.cfdisk 新建分区 3.blkid 查看分区的uuid,因为编辑 /etc/fstab/ 会用到 4.mkfs 把新建的分区格式化... 阅读全文
posted @ 2013-10-12 00:59 花瓣奶牛 阅读(4974) 评论(0) 推荐(0)
摘要: 我以后啊,再也不敢把文本界面的程序模仿成图形界面的了,因为需要处理的东西太多了 ,所以我以后写的程序,尽量把菜单写得简单一点,至于图形界面,就留给别人了现在这个程序的菜单还是有bug 大家凑合着用吧 ,但是程序对于文件的读取和写入 是没有问题的以下是两个程序,名为 address_book.py 1 #!/usr/bin/python3 2 import os,sys 3 os.chdir("./") #把读取文件的目录设置在当前目录 4 sys.path.append('./') #把读取模块的目录设置为当前目录 5 import tcstory #导入我 阅读全文
posted @ 2013-10-06 17:18 花瓣奶牛 阅读(1255) 评论(0) 推荐(0)
摘要: 今天研究了一下 python3中打包,现在主要看的书是 head first pyhon 感觉还是不错的的以我自己的实验为例我在tcstory这个文件夹中创建了 tcstory.py 和setup.py 两个文件,用来打包内容如下tcstory.py1 #!/usr/bin/python32 def _welcome():3 print('你好,我是花瓣奶牛')4 if __name__=='__main__':_welcome()setup.pyfrom distutils.core import setupsetup( name='花瓣奶牛' 阅读全文
posted @ 2013-09-28 12:24 花瓣奶牛 阅读(500) 评论(0) 推荐(0)
摘要: 这个是一个什么插件呢? 这是一个显示对其线的插件 ,感觉蛮好用的,习惯让代码整齐的vimer必不可缺哦但是这个插件有一个问题,这个是文档里面作者原本的话INTRODUCTION *indentLine-introduction*This plugin is used for displaying thin vertical lines at each indentationlevel for code indented with spaces. For code indented with tabs, I thinkthere is no need to support it, using : 阅读全文
posted @ 2013-09-14 10:47 花瓣奶牛 阅读(4663) 评论(0) 推荐(0)
摘要: Python 2.7.4 (default, Apr 19 2013, 18:32:33) [GCC 4.7.3] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> class Person: #我自定义的类... def setname(self,name):... self.name=name... >>> list=[ ] #建立一个空列表>>&g 阅读全文
posted @ 2013-09-14 00:33 花瓣奶牛 阅读(1274) 评论(0) 推荐(0)
摘要: 奇怪了,我的《python基础教程第二版》里面写的是sys.path.expanduser('~/python')使用后会有如下报错Traceback (most recent call last): File "./info.py", line 6, in sys.path.expanduser('~/desktop/')AttributeError: 'list' object has no attribute 'expanduser'后来查了一下,发现原来这不是正确的,应该使用下面这个os.path.ex 阅读全文
posted @ 2013-09-13 19:32 花瓣奶牛 阅读(7659) 评论(0) 推荐(0)
摘要: # ~/.bashrc: executed by bash(1) for non-login shells.# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)# for examples# Source global definitionsif [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrcfi# If not running interactively, don't do anything[ -z "$PS1" ] & 阅读全文
posted @ 2013-09-12 21:34 花瓣奶牛 阅读(564) 评论(0) 推荐(0)
摘要: "******************************************************************""基础设置set number "显示行号syntax on "自动语法高亮,我自己测试了一下,好像打开和关闭的效果都是一样的set hlsearch "搜索时高亮被找到的文本set nocompatible "关闭vi兼容模式filetype on "检测文件类型set mouse=a "使用鼠标定位set autoindent "设置自动缩进:即每行的缩进值 阅读全文
posted @ 2013-09-12 21:33 花瓣奶牛 阅读(331) 评论(0) 推荐(0)
摘要: 今晚测试了一下,发现globals()[ ]函数只能引用同一个文件中的全局变量,对于不同文件中的变量就无能为力,而且,有点奇怪的是对于在函数中引用变量的问题,如果引用的是列表和字典,那么可以在函数中修改它的值,但是对于普通的变量,在函数中无法修改他的值,因为传递给函数的只是一个复制的值 1 #!/bin/usr/python 2 import sys 3 sys.path.append('/home/tcstory/desktop') 4 import b 5 test={'a':1} 6 b.testing(test) 7 x=4 8 b.test1(x) 9 阅读全文
posted @ 2013-09-12 19:32 花瓣奶牛 阅读(1490) 评论(0) 推荐(0)
摘要: 这个方法其实实在ubuntu中文论坛找到的,但是后来我找不到原来的地址了,所以凭着印象把他写了出来,供大家参考在~/.config/fcitx 目录下,找到config 文件,打开它,在大约53行那里修改SwitchPreedit的内容,按照我所给出的截图修改就行了,然后注销或者重启就可以了 阅读全文
posted @ 2013-09-12 19:04 花瓣奶牛 阅读(192) 评论(0) 推荐(0)