下午项目组决定用Python和c/c++作为开发使用的语言。以前就听说Python的大名,这次终于有好机会好好学习啦!
一、从Python的官方网站下了WIndows的版本,安装很顺利。但选择“just for me" or "for all users"时,如果你选择”just for me“,在集成到vs2003中可能会有问题,提示找不到python24.dll(把这个文件从Python24移到System32就可以了)。
二、装好后,先测试一下是不是装好了。
运行 Python.exe输入:
代码:
如果输出"Hello World",那就表明安装成功了。
三、用vs2003作为IDE。
工具->选项->项目->vc++目录,把Python24里面的inclue和libs添加到相应部分就可以了.
四、第一个Python程序:
#include <Python.h>
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime/n"
"print 'Today is',ctime(time())/n");
Py_Finalize();
return 0;
}
输出当前时间。
OK,下面再推荐我找到的一些好的资源:
Python Cookbook
Python库参考手册(Python Library Reference)
《深入Python》
一、从Python的官方网站下了WIndows的版本,安装很顺利。但选择“just for me" or "for all users"时,如果你选择”just for me“,在集成到vs2003中可能会有问题,提示找不到python24.dll(把这个文件从Python24移到System32就可以了)。
二、装好后,先测试一下是不是装好了。
运行 Python.exe输入:
代码:
print "Hello World"
三、用vs2003作为IDE。
工具->选项->项目->vc++目录,把Python24里面的inclue和libs添加到相应部分就可以了.
四、第一个Python程序:
#include <Python.h>
int main(int argc, char *argv[])
{
Py_Initialize();
PyRun_SimpleString("from time import time,ctime/n"
"print 'Today is',ctime(time())/n");
Py_Finalize();
return 0;
}
输出当前时间。
OK,下面再推荐我找到的一些好的资源:
Python Cookbook
Python库参考手册(Python Library Reference)
《深入Python》