“脚本”如何?不同于“程序”。或“子程序”? [英] How does a "script" differ from a "program" or "subroutine"?

查看:88
本文介绍了“脚本”如何?不同于“程序”。或“子程序”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,当天的愚蠢问题。我正在阅读史蒂夫的采访

Moret他说:一旦很多剧本开始进入我们就知道

我们无法退出使用Python。


我刚刚进入Python并且想知道我是否遗漏了某些东西

或者这只是一个语义问题。


谢谢。

-Ted

解决方案

子程序是procedure,function或method的另一个名称。

它们是这样的:


def fu():

...

一个程序可以包含任意数量的子程序,以及类,

变量,


一个脚本只是一个程序,但暗示它是一个简单的任务简单的

程序。


2004年8月23日星期一下午05:18:40 -0700,tdi写道:

好的,愚蠢的问题 天。我正在阅读Steve的采访
Moret他说:一旦很多脚本开始进入,我们就知道
我们无法退出使用Python。

我刚刚进入Python并且想知道我是否遗漏了某些东西
或者这只是一个语义问题。

谢谢。
-Ted



Phil Frost< in **** @ bitglue.com>在消息新闻中写道:< ma ************************************** @ pyt hon。 org> ...

脚本只是一个程序,但暗示它是一个简单的任务的简单程序。




我认为主要的含义并不是它很简单,而是用一些''解释''(而不是编译)语言写的

。所以我们说

Python或Perl或Bash脚本,但不是''C script''。看看这个工作

开头:你经常会看到这样的东西:''知道

脚本语言(比如Perl和/或Python)''。


Porky Pig Jr写道:

Phil Frost< in **** @ bitglue.com>在消息新闻中写道:< ma ************************************** @ pyt hon。 org> ...

脚本只是一个程序,但暗示它是一个简单的任务的简单程序。


我认为主要的含义并不是说它很简单,而是用一些''解释''(而不是编译)语言编写。所以我们说的是Python或Perl或Bash脚本,但不是''C script''。看看工作开头:你会经常看到这样的东西:''知道脚本语言(比如Perl和/或Python)''。




如果您对此新闻组感兴趣,请查看此新闻组的

档案。已经详细讨论过了,Phil和'和
Porky Pig'的回复之前已经发布了,还有其他的b
(我有一种感觉)我们即将再次看到

来自其他人,尽管有这篇文章...... ;-)。


-Peter


Ok, stupid question for the day. I''m reading the interview with Steve
Moret and he says: "Once a lot of scripts started going in we knew
there was no way we could back out of using Python."

I''m just getting into Python and am wondering if I''m missing something
or this is just a semantic issue.

Thanks.
-Ted

解决方案

A subroutine is another name for "procedure", "function", or "method".
They are made like this:

def fu():
...

A program can contain any number of subroutines, along with classes,
variables, etc.

A script is just a program, but has the implication that it''s a simple
program for a simple task.

On Mon, Aug 23, 2004 at 05:18:40PM -0700, tdi wrote:

Ok, stupid question for the day. I''m reading the interview with Steve
Moret and he says: "Once a lot of scripts started going in we knew
there was no way we could back out of using Python."

I''m just getting into Python and am wondering if I''m missing something
or this is just a semantic issue.

Thanks.
-Ted



Phil Frost <in****@bitglue.com> wrote in message news:<ma**************************************@pyt hon.org>...

A script is just a program, but has the implication that it''s a simple
program for a simple task.



I think the major implication is not that it''s simple but it''s written
in some ''interpreted'' (rather than compiled) language. so we say
Python or Perl or Bash script, but not ''C script''. Look at the job
openings: you''ll often see something like this: ''knowledge of
scripting languages (such as Perl and/or Python)''.


Porky Pig Jr wrote:

Phil Frost <in****@bitglue.com> wrote in message news:<ma**************************************@pyt hon.org>...

A script is just a program, but has the implication that it''s a simple
program for a simple task.


I think the major implication is not that it''s simple but it''s written
in some ''interpreted'' (rather than compiled) language. so we say
Python or Perl or Bash script, but not ''C script''. Look at the job
openings: you''ll often see something like this: ''knowledge of
scripting languages (such as Perl and/or Python)''.



Before this explodes into another long thread, please check the
archives for this newsgroup if you have any interest in this
topic. It has been discussed at length, and both Phil''s and
Porky Pig''s responses have been posted before, along with
others (which I have a feeling we''re about to see yet again
from other people in spite of this post... ;-).

-Peter


这篇关于“脚本”如何?不同于“程序”。或“子程序”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆