473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Python execution problem

Using OSX 10.4.5

This is more of a unix/tcsh question than a python question.
Somehow I got to the point where I have two files 'a.py' and 'b.py'
which have identical contents and permissions, but one refuses to
execute:

[blah:/Library/WebServer/CGI-Executables] me% a.py
tcsh: a.py: Command not found.
[blah:/Library/WebServer/CGI-Executables] me% b.py
okay
[blah:/Library/WebServer/CGI-Executables] me%

Could someone enlighten me about how the shell knows to execute a
script? I always assumed it was just the extension, but this seems to
prove me wrong.

tnx>mp

Mar 18 '06 #1
1 1128
ma*********@email.com wrote:
Using OSX 10.4.5

This is more of a unix/tcsh question than a python question.
Somehow I got to the point where I have two files 'a.py' and 'b.py'
which have identical contents and permissions, but one refuses to
execute:

[blah:/Library/WebServer/CGI-Executables] me% a.py
tcsh: a.py: Command not found.
[blah:/Library/WebServer/CGI-Executables] me% b.py
okay
[blah:/Library/WebServer/CGI-Executables] me%

Could someone enlighten me about how the shell knows to execute a
script? I always assumed it was just the extension, but this seems to
prove me wrong.


It checks each directory in your path for an executable file with the
name you specified. Each file has a set of associated bits to tell
whether it is executable (or readable or writable), and by whom. To add
execute permission to a.py, try this:

chmod +x a.py

FYI, it's not a great idea to rely on the current directory (.) being in
your path. You might want to type it explicitly, e.g ./a.py instead of
a.py.
Mar 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Catalin | last post by:
How can I make executables with python? I found some utilities that claim they can do something like that like Installer and py2exe but they actualy pack the code in a huge arhive! This solves the...
2
by: satish | last post by:
Hello all, I have a shared object executable viz. *cable* which I execute as follows : $ ansyscust71 -custom cable -p ANSYSRF **ansyscust71 is a shell script and is a part of a software...
28
by: Maboroshi | last post by:
Hi I am fairly new to programming but not as such that I am a total beginner From what I understand C and C++ are faster languages than Python. Is this because of Pythons ability to operate on...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
118
by: 63q2o4i02 | last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning Python the past few months and like it very much. A few years ago I had an AI class where we had to use Lisp, and I absolutely...
10
by: sandipm | last post by:
Hi, In my application, I have some configurable information which is used by different processes. currently I have stored configration in a conf.py file as name=value pairs, and I am importing...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.