2013-01-03 8 views
1

저는 OSX을 처음 사용하고이 환경에서 파일 구조에 익숙해졌습니다. 내 .bash_profile에 파일은 다음과 같습니다 : 파이썬 스크립트를 파일 경로를 입력하지 않고 실행할 수 있도록 어떻게 .bash_profile 파일을 수정할 수 있습니까?

# Setting PATH for EPD_free-7.3-2 
# The orginal version is saved in .bash_profile.pysave 
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" 
export PATH 

내 스크립트

예를 들어, 여러 디렉토리에 있습니다 내가하고 싶은 무엇

/Users/LMS/Documents/pydata-book 
/Users/LMS/Documents/python_scripts 

는 (내 터미널을 열고 스크립트의 이름을 입력입니다 예를 들어 myscript.py), Windows 환경에서 * .py 파일과 Python과의 연관을 지정하는 것처럼 실행될 수 있습니다.

아무도 저와 함께 Mac에서이 작업을 수행 할 수 있습니까? 대신 .bash_profile에이 퍼팅 시도

감사

+0

가능한 중복 기본적으로

# Setting PATH for EPD_free-7.3-2 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:/Users/LMS/Documents/pydata-book:/Users/LMS/Documents/python_scripts:${PATH}" export PATH 

, 당신은로 구분하여 원하는 실행 파일을 포함하는 디렉토리를 넣어 [.bashrc 파일에 경로 추가하기] (http://stackoverflow.com/questions/13631173/adding-a-path-to-the-bashrc-file) – tripleee

답변

3

는 ':'의

+0

감사합니다. 나는 당신이 말한대로했는데 터미널에서 myscript.py를 입력하여 스크립트를 실행하려고하면 다음과 같이 나타납니다 : /Users/LMS/Documents/pydata-book/myscript.py : 허가가 거부되었습니다 –

+1

스크립트를 실행 가능하게 만들고, 스크립트가있는 디렉토리로 가서'chmod + x * .py'를하십시오. – KaeruCT