2007年07月12日 星期四 14:25
例如test.py中有 x=1 y=2 在控制台中,我想: 执行test.py print x+y 结果应该打印出3 请问执行test.py这一步怎么做? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/9f514028/attachment.html
2007年07月12日 星期四 14:29
On 7/12/07, 周旋 <elvis827在gmail.com> wrote: > 例如test.py中有 > x=1 > y=2 > > 在控制台中,我想: > > 执行test.py > print x+y > > 结果应该打印出3 > > 请问执行test.py这一步怎么做? > from test import * -- Best Regards, Leo Jay
2007年07月12日 星期四 14:45
我试过了,这样好像不行的 2007/7/12, Leo Jay <python.leojay at gmail.com>: > > On 7/12/07, 周旋 <elvis827 at gmail.com> wrote: > > 例如test.py中有 > > x=1 > > y=2 > > > > 在控制台中,我想: > > > > 执行test.py > > print x+y > > > > 结果应该打印出3 > > > > 请问执行test.py这一步怎么做? > > > > from test import * > > -- > Best Regards, > Leo Jay > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/dddc17e3/attachment-0001.htm
2007年07月12日 星期四 15:13
execfile可以,谢谢~~~ 在07-7-13,zhangbaocai_cug <zhangbaocai_cug at tom.com> 写道: > > execfile() > > ------------------------------ > zhangbaocai_cug > 2007-07-12 > ------------------------------ > *发件人:* 周旋 > *发送时间:* 2007-07-11 23:45:22 > *收件人:* python-chinese at lists.python.cn > *抄送:* > *主题:* Re: [python-chinese][CPyUG:28968] 怎么样在控制台中将一个脚本中的内容直接导进来执行? > > 我试过了,这样好像不行的 > > 2007/7/12, Leo Jay <python.leojay at gmail.com>: > > > > On 7/12/07, 周旋 <elvis827 at gmail.com> wrote: > > > 例如test.py中有 > > > x=1 > > > y=2 > > > > > > 在控制台中,我想: > > > > > > 执行test.py > > > print x+y > > > > > > 结果应该打印出3 > > > > > > 请问执行test.py这一步怎么做? > > > > > > > from test import * > > > > -- > > Best Regards, > > Leo Jay > > _______________________________________________ > > python-chinese > > Post: send python-chinese at lists.python.cn > > Subscribe: send subscribe to python-chinese-request at lists.python.cn > > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/4b51ba60/attachment.html
2007年07月12日 星期四 16:18
zhangbaocai_cug£¬ÄúºÃ£¡ ¡¡¡¡°Ñ dll À©Õ¹Ãû»»³É pyd ÊÔÊÔÄØ£¿ ======== 2007-07-13 06:05:46 ÄúÔÚÀ´ÐÅÖÐдµÀ£º ======== ¿ÉÊÇÓÃboost::pythonÉú³ÉµÄ*.dllÎļþÈ´ÓÖ²»ÄÜimportÁË(IDLEºÍc++ÀïÃæimport¶¼Ê§°Ü). PS:ÎÒ¶¼ÊÇÓÃrelease°æ±¾µÄ. ÏÂÃæÊÇDLLµÄ´úÂ룺 #include#include python.hpp> using namespace boost::python; std::string strtmp; char const* Recognise(const char* url) { strtmp ="´ÓdllÖзµ»ØµÄÊý¾Ý... : "; strtmp+=url; return strtmp.c_str(); } BOOST_PYTHON_MODULE(TestBoost) { def("Recognise", Recognise); } zhangbaocai_cug 2007-07-12 = = = = = = = = = = = = = = = = = = = = = = ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Ö Àñ£¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÕÔÍþ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡zhaoweikid在163.com ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2007-07-12 -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/59e35e33/attachment.html
2007年07月12日 星期四 16:41
python -i test.py ÏȼÓÔØÎļþÔÙÆô¶¯½»»»»·¾³¡£ On 7/12/07, ÖÜÐý <elvis827在gmail.com> wrote: > > execfile¿ÉÒÔ£¬Ð»Ð»¡«¡«¡« > > ÔÚ07-7-13£¬zhangbaocai_cug <zhangbaocai_cug在tom.com> дµÀ£º > > > > execfile() > > > > ------------------------------ > > zhangbaocai_cug > > 2007-07-12 > > ------------------------------ > > *·¢¼þÈË£º* ÖÜÐý > > *·¢ËÍʱ¼ä£º* 2007-07-11 23:45:22 > > *ÊÕ¼þÈË£º* python-chinese在lists.python.cn > > *³ËÍ£º* > > *Ö÷Ì⣺* Re: [python-chinese][CPyUG:28968] ÔõôÑùÔÚ¿ØÖÆ̨Öн«Ò»¸ö½Å±¾ÖеÄÄÚÈÝÖ±½Óµ¼½øÀ´Ö´ÐУ¿ > > > > ÎÒÊÔ¹ýÁË£¬ÕâÑùºÃÏñ²»ÐÐµÄ > > > > 2007/7/12, Leo Jay <python.leojay在gmail.com>: > > > > > > On 7/12/07, ÖÜÐý <elvis827在gmail.com> wrote: > > > > ÀýÈçtest.pyÖÐÓÐ > > > > x=1 > > > > y=2 > > > > > > > > ÔÚ¿ØÖÆ̨ÖУ¬ÎÒÏ룺 > > > > > > > > Ö´ÐÐtest.py > > > > print x+y > > > > > > > > ½á¹ûÓ¦¸Ã´òÓ¡³ö3 > > > > > > > > ÇëÎÊÖ´ÐÐtest.pyÕâÒ»²½Ôõô×ö£¿ > > > > > > > > > > from test import * > > > > > > -- > > > Best Regards, > > > Leo Jay > > > _______________________________________________ > > > python-chinese > > > Post: send python-chinese在lists.python.cn > > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > > > > _______________________________________________ > > python-chinese > > Post: send python-chinese在lists.python.cn > > Subscribe: send subscribe to python-chinese-request在lists.python.cn > > Unsubscribe: send unsubscribe to > > python-chinese-request在lists.python.cn > > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > > > > _______________________________________________ > python-chinese > Post: send python-chinese在lists.python.cn > Subscribe: send subscribe to python-chinese-request在lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > -- Nicholas @ Nirvana Studio http://www.nirvanastudio.org -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/b35a095c/attachment.htm
2007年07月13日 星期五 06:02
execfile() zhangbaocai_cug 2007-07-12 ·¢¼þÈË£º ÖÜÐý ·¢ËÍʱ¼ä£º 2007-07-11 23:45:22 ÊÕ¼þÈË£º python-chinese在lists.python.cn ³ËÍ£º Ö÷Ì⣺ Re: [python-chinese][CPyUG:28968] ÔõôÑùÔÚ¿ØÖÆ̨Öн«Ò»¸ö½Å±¾ÖеÄÄÚÈÝÖ±½Óµ¼½øÀ´Ö´ÐУ¿ ÎÒÊÔ¹ýÁË£¬ÕâÑùºÃÏñ²»ÐÐµÄ 2007/7/12, Leo Jay <python.leojay在gmail.com>: On 7/12/07, ÖÜÐý <elvis827在gmail.com> wrote: > ÀýÈçtest.pyÖÐÓÐ > x=1 > y=2 > > ÔÚ¿ØÖÆ̨ÖУ¬ÎÒÏ룺 > > Ö´ÐÐtest.py > print x+y > > ½á¹ûÓ¦¸Ã´òÓ¡³ö3 > > ÇëÎÊÖ´ÐÐtest.pyÕâÒ»²½Ôõô×ö£¿ > from test import * -- Best Regards, Leo Jay _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070712/28e9b968/attachment.html
Zeuux © 2025
京ICP备05028076号