2006年09月27日 星期三 16:50
Çë½Ì£º
ÎÒÓжà¸ö .py ,£¬ÊµÏÖ²»Í¬¹¦ÄÜ£¬ »¹ÄÜÉèÖòÎÊý£¬ ÈçºÎ°ÑËüÃÇдÈëÒ»¸ö½Å±¾Ö´ÐУ¿
ÎÒÉèÏëµÄ¿ÉÄܸñʽ£º
file : my_script(.py)
#! /usr/bin/python
hello.py -n pythoner
work.py -j program
¾ßÌåÈçºÎʵÏÖ£¿
лл£¡
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20060927/ab88da24/attachment.html
2006年09月27日 星期三 16:58
Hi 王明:
不知道这样满足条件么。
import os
pid = os.fork()
if pid:
hello.py ...
else:
work.py ...
王明 写道:
> 请教:
>
> 我有多个 .py ,,实现不同功能, 还能设置参数, 如何把它们写入一
> 个脚本执行?
>
>
>
> 我设想的可能格式:
>
> file : my_script(.py)
>
>
>
> #! /usr/bin/python
>
>
>
> hello.py -n pythoner
>
> work.py -j program
>
>
>
> 具体如何实现?
>
> 谢谢!
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
--
Best regards!
Kasicass/sYcini - Coder
http://www.sycini.com
2006年09月27日 星期三 16:59
exec(...)¾Í¿ÉÒÔÁË ³ÂÏþ¾ü 2006-09-27 ·¢¼þÈË£º ÍõÃ÷ ·¢ËÍʱ¼ä£º 2006-09-27 16:45:33 ÊÕ¼þÈË£º python-chinese在lists.python.cn ³ËÍ£º Ö÷Ì⣺ [python-chinese] ÔÙÎÊ£º linux϶à¸ö.py ÈçºÎÅú´¦Àí Çë½Ì£º ÎÒÓжà¸ö .py ,£¬ÊµÏÖ²»Í¬¹¦ÄÜ£¬ »¹ÄÜÉèÖòÎÊý£¬ ÈçºÎ°ÑËüÃÇдÈëÒ»¸ö½Å±¾Ö´ÐУ¿ ÎÒÉèÏëµÄ¿ÉÄܸñʽ£º file : my_script(.py) #! /usr/bin/python hello.py -n pythoner work.py -j program ¾ßÌåÈçºÎʵÏÖ£¿ лл£¡ -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20060927/2229f4f0/attachment.htm
2006年09月27日 星期三 17:14
写个shell脚本不就行了? #!/bin/bash hello.py -n pythoner work.py -j program 王明 写道: > > 请教: > > 我有多个 .py ,,实现不同功能, 还能设置参数, 如何把它们写入一个脚本执行? > > 我设想的可能格式: > > file : my_script(.py) > > #! /usr/bin/python > > hello.py -n pythoner > > work.py -j program > > 具体如何实现? > > 谢谢! > > ------------------------------------------------------------------------ > > _______________________________________________ > 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
Zeuux © 2025
京ICP备05028076号