源代码 py位扩展名 不需编译linux下通常需要制定python的解释器#!/usr/bin/python二进制代码编译之后的python程序 pycimport py_compilepy_compile.compile(filename)优化代码 经过优化的原文件 pyopython -O -m py_compile filename
python历史python’蟒蛇的意思,解释型的 面向对象的,带有动态语意的变成语言abc语言,让数学和物理的科学家能够简单的进行科学计算1989年圣诞节诞生作者gudiopython的发展cnri 1.5之前的所有版本beopen 2.0dc zope系统python3.0 但最常用的是2.6和2.7里程碑获得tiobe编程大奖(2010 2007)python的特性编程语言中的定位高级动态编
1.首先安装 eclipse2.安装pydev插件3.设置插件4.其中会遇到一个问题(stdlib not found)5.安装xcode,并安装command line tools解决这个问题
1.VI敲两行代码#!/usr/bin/env python print('hello world')2.设置权限chmod a+x aaa.py3.搞定./aaa.py
[root@localhost 201212]# ./10get the host:www.sina.com addrname:cernetnews.sina.com.cntype:AF_INETlength:4IP:164.33.189.9alias 0:www.sina.comalias 1:us.sina.com.cnalias 2:news.sina.com.cnalias 3:jupit
一个完整的socket程序首先是服务器端#include mio_lt;stdio.hmio_gt; #include mio_lt;stdlib.hmio_gt; #include mio_lt;string.hmio_gt; #include mio_lt;sys/types.hmio_gt; #include mio_lt;sys/socket.hmio_gt; #include mio_lt;unistd.hmio_gt; #include mio_lt
慢慢迈到socket了#include mio_lt;stdio.hmio_gt; #include mio_lt;stdlib.hmio_gt; #include mio_lt;netinet/in.hmio_gt; #include mio_lt;sys/socket.hmio_gt; #include mio_lt;arpa/inet.hmio_gt; #include mio_l
SIGIO信号会在套接字或任何文件描述符完成数据传送时通知进程SIGURG信号是当外部数据到达时linux通知进程的信号想了一下,这两个东西可以用在判断服务器上的一个进程是否活着或者正确的活着也是很有用的一个玩意#include mio_lt;unistd.hmio_gt; #include mio_lt;fcntl.hmio_gt; #include mio_lt;stdio.hmio_gt; int main( v
把文件映射到内存并且能够操作,保存,呵呵 一件很FUN的事#include mio_lt;sys/types.hmio_gt; #include mio_lt;sys/stat.hmio_gt; #include mio_lt;fcntl.hmio_gt; #include mio_lt;sys/mman.hmio_gt; #include mio_lt;string.hmio_gt; #include mio_lt;stdio.hmio_gt; #def
在使用memcpy的时候 系统报[root@localhost 201212]# ./7Bus error很奇怪,总线错误?经过检查发现是memcpy( ptr, buf, strlen(buf) );中的指针ptr指向的地址为空,导致使用memcpy映射到系统的内存空间后,进行任何写操作都会造成内存溢出为什么后这样呢?继续检查,发现我利用lseek移动fd人工做一个I/O空洞没有成功,文件依然是