473,804 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1148
ma*********@ema il.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
5005
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 problem of giving python programs to users who don't have python but doesn't solve the problem of the source "secrecy" (copyright). And the programs also run much slower and become extremely big compared to a normal C++ program for example. I...
2
2898
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 called ANSYS** Now, I have generated a python module using a *fortran-python interface
28
2611
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 almost any operating system? Or is there many other reasons why? I understand there is ansi/iso C and C++ and that ANSI/ISO Code will work on any system If this is the reason why, than why don't developers create specific Python Distrubutions...
68
5905
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
118
6759
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 hated it, having learned C++ a few years prior. They didn't teach Lisp at all and instead expected us to learn on our own. I wasn't aware I had to uproot my thought process to "get" it and wound up feeling like a moron. In learning Python I've...
10
3263
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 conf.py file to use this variable. it works well import conf print conf.SomeVariable but if I need to change some configuration parameteres, it would need
0
9712
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7634
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.