Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 9th, 2008, 7:43 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 856
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Python on unix

Is there a way to get a Python script to run from the command line in Unix without the "python" prefix? For example, instead of typing python myscript.py, typing myscript.py (with or without the ./)?

I know that Perl scripts can be run by simply typing the script name (assuming you are in the enclosing directory).

I tried adding a shebang line to my Python script no avail.

EDIT: I figured it out. I had to chmod the script to 777.
titaniumdecoy is offline   Reply With Quote
Old Feb 10th, 2008, 1:15 AM   #2
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
Re: Python on unix

You should watch security there: 744 is probably a better permission set. That means only you can read,write and run it while everyone else can just read it. You don't want other users to overwrite your script.
__________________
Robotics @ Maryland AUV Team - Software Lead
Game_Ender is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lions' Commentary on UNIX 6th Edition, with source code Mad_guy Book Reviews 0 Sep 24th, 2006 7:06 PM
[tutorial] Python for programming beginners coldDeath Python 30 Dec 14th, 2005 11:35 AM
Convert Python script to C++ code clanotheduck Python 17 Sep 25th, 2005 8:55 AM
Advanced Python Tricks Arevos Python 19 Sep 24th, 2005 7:39 AM
Python - A Programmers Introduction coldDeath Python 17 Aug 19th, 2005 12:41 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:33 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC