473,378 Members | 1,539 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,378 software developers and data experts.

shebang in cross platform scripts

rbt

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python

Many thanks,

rbt

Jul 18 '05 #1
5 2354
On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.

--
Cheers,
Simon B,
si***@brunningonline.net,
http://www.brunningonline.net/simon/blog/
Jul 18 '05 #2
rbt wrote:

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Thanks to the # being the comment sign in python, it will be silently
discarded by windows.

--
Regards,

Diez B. Roggisch
Jul 18 '05 #3
On Apr 6, 2005 9:37 AM, rbt <rb*@athop1.ath.vt.edu> wrote:

Haven't tested this on Windows yet... thought I'd ask here:

Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


What the others have said already is true, that it will be ignored on
windows, with one caveat. The shebang is interpreted by Apache if your
script is a CGI script. So, if your script is a CGI, you will need to
have a windows version and a nix version.

Peace
Bill Mill
bill.mill at gmail.com
Jul 18 '05 #4
Hi All--

Simon Brunning wrote:

On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.


It works fine using cygwin, uwin, mks and pdksh, all available for
Windows. Google is your friend.

Symbolic links also work under uwin (don't know for sure about the
others). That means you can install a link in /usr/bin to whereever
python lives, and expect #!/usr/bin/python to work just fine.

Metta,
Ivan
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/worksh...oceedings.html
Army Signal Corps: Cu Chi, Class of '70
Author: Teach Yourself Python in 24 Hours
Jul 18 '05 #5
On Apr 6, 2005 11:06 AM, Ivan Van Laningham <iv*****@pauahtun.org> wrote:
Hi All--

Simon Brunning wrote:

On Apr 6, 2005 2:37 PM, rbt <rb*@athop1.ath.vt.edu> wrote:
Does the line below have any negative impact on Windows machines? I
develop and test mostly on Unix, but my scripts are often used on Win
systems too.

#!/usr/bin/env python


Nope. On Windows it's just a comment.


It works fine using cygwin, uwin, mks and pdksh, all available for
Windows. Google is your friend.

Symbolic links also work under uwin (don't know for sure about the
others). That means you can install a link in /usr/bin to whereever
python lives, and expect #!/usr/bin/python to work just fine.


This works in cygwin as well; I didn't mention cygwin since the OP
seemed to be asking about windows distribution, but it's a good point.

Peace
Bill Mill
Jul 18 '05 #6

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

Similar topics

5
by: deko | last post by:
In regard to running php scripts with cron - Here is a sample script: <?php //debug.php echo "<br> This is a test"; ?> I can call debug.php from a web page on my site like this:
0
by: Grace | last post by:
Try our free demo www.nrgglobal.com DbVisualizer is a cross-platform database tool for all major relational databases. DbVisualizer enables simultaneous connections to many different databases...
0
by: demibee | last post by:
Thought this might be of interest to some out there... For those who've never encountered it, it's a free, open-source, cross-platform GUI library (Windows/Mac/Linux). Forte's Agent 2.0 will be...
7
by: Charles | last post by:
I'd like to develop a simple cross-platform application in C++. I'd like it to run in Windows, OS X, PC-BSD and Linux. From my research, it seems I should use Qt or Gtk as a graphical library. Do...
29
by: töff 93722 | last post by:
Long story short, I built a website based primarily on JavaScript: http://www.sjcga.com The site renders *great* in WinIE6/7 and in Mac/Win Opera9. It has problems in Mac/Win Firefox2, and...
13
by: Chris Lasher | last post by:
Should a Python module not intended to be executed have shebang/ hashbang (e.g., "#!/usr/bin/env python") or not? I'm used to having a shebang in every .py file but I recently heard someone argue...
11
by: Brad | last post by:
Hi, C++ newbie here... just rewrote a few old C programs and Pyhton scripts in C++ this evening. I had heard a lot of bad things about C++, but I found it to be a remarkable pleasant language!...
1
by: Vinod Sadanandan | last post by:
Cross Platform Migration An Unproblematic Approach (Windows-UNIX ) Oracle 10\11g The principal restriction on cross-platform transportable database is that the source and destination platform...
5
by: Hartmut Goebel | last post by:
Hi, has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I have a Windows partition with Python installed there, so this would "only" required working on a different...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.