Python脚本正在打开Python 2.7解释器

Python脚本正在打开Python 2.7解释器,python,ubuntu,Python,Ubuntu,我最近在Kubuntu 12.04 iPython、matplotlib、numpy、iPython笔记本、iPython qtconsole和Python scipy上安装了几个Python包。现在,当我尝试从命令行./script.py运行python脚本时,我会被扔进python解释器 例如: user@machine:~/$ ./script.py Welcome to Python 2.7! This is the online help utility. If this is

我最近在Kubuntu 12.04 iPython、matplotlib、numpy、iPython笔记本、iPython qtconsole和Python scipy上安装了几个Python包。现在,当我尝试从命令行./script.py运行python脚本时,我会被扔进python解释器

例如:

user@machine:~/$ ./script.py 

Welcome to Python 2.7!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help> 
为什么会这样

我该怎么做才能停下来

除了移除iPython,还有其他选择吗

编辑: 我应该提到脚本是一个python模块。我不知道这是否与此有关。我能够运行一个简单的hello world脚本

@亚当·米哈尔辛: !/usr/bin/python

编辑2: 看起来这和iPython没有关系。我删除了iPython,但我仍然遇到这个问题。以下是文件的内容。我的大多数Python文件都会出现这种情况

#!/usr/bin/python

# Import libraries
import sys
import subprocess

def createCommand(project):
    # Create the basic command
    command = "git clone " + project

    subprocess.call(command, shell = True)

    return 0

def helpMenu():

    return 0;

def validateInput(user_input):
    # validity key
    valid = 0

    if (len(user_input) < 3):
        help()
        return 1

    if (user_input[1] == '-cl'):
        if (len(user_input) == 3):
            valid = 1
            return 0

    if (valid == 0):
        help()
        return 1

def main(user_input):
    # Validate inputs
    failure = validateInput(user_input)

    # Return if there was a failure    
    if (failure == 1):
        return 1;

    # Create the git commands        
    failure = createCommand(user_input[2])

    # Return if there was a failure    
    if (failure == 1):
        return 1;

    return 0;

if (__name__ == '__main__'):
    main(sys.argv)
编辑3: 虚惊一场

这很尴尬。事实证明,我知道我的帮助函数会遇到名称空间问题。我把它改成了帮助菜单,但忘了改变它的名字


我很抱歉浪费了这篇文章

这太尴尬了。事实证明,我知道我的帮助函数会遇到名称空间问题。我把它改成了帮助菜单,但忘了改变它的名字


我很抱歉浪费了这篇文章

你能发布script.py的第一行吗?你不使用普通Python解释器有什么原因吗?/usr/bin/Python不是普通的解释器吗?或者你在谈论Python 2.7!这是联机帮助实用程序。部分如果你说的是后者…我不打算用这个。来跟进/usr/bin/python带我去看标准的python2.7.3解释器/usr/bin/env python解决了这个问题