Search 5,000,000+ questions and answers.

Frequently Asked Questions

How do I make a Python script executable on Unix?

Python Library and Extension FAQ
You need to do two things: the script file's mode must be executable and the first line must begin with #! followed by the path of the Python interpreter. The second can be done in a number of ways. The most straightforward way is to write #!/usr/local/bin/python as the very first line of your file, using the pathname for where the Python interpreter is installed on your platform.
Related Questions

Python Frequently Asked Questions
You need to do two things: the script file's mode must be executable (include the 'x' bit), and the first line must begin with #! followed by the pathname for the Python interpreter. The second can be done in a number of way. The most straightforward way is to write #!/usr/local/bin/python as the very first line of your file - or whatever the pathname is where the python interpreter is installed on your platform.
Related Questions

How do I make python scripts executable?

Python Windows FAQ
On Windows 2000, the standard Python installer already associates the .py extension with a file type (Python.File) and gives that file type an open command that runs the interpreter (D:\Program Files\Python\python.exe "%1" %*). This is enough to make scripts executable from the command prompt as 'foo.py'. If you'd rather be able to execute the script by simple typing 'foo' with no extension you need to add .py to the PATHEXT environment variable.
Related Questions

How do I make foo.scm into an executable script?

Guile Frequently Asked Questions - GNU Project - Free Softwa...
Next: Building guile-1.4 gives a previous declaration of inet_aton error?, Previous: How do I make foo.scm into an executable script?, Up: Top
Related Questions

How do I make a UNIX-based script work?

ActivePerl faq5 - Implementation Quirks
First, make extra-super sure that you are using the script or module in the way it was intended. Many of us are quick to blame the module, the operating system, or the interpreter when, in reality, it is our own code that isn't working right. If you're sure that it's not a problem in your code, the best way to make a UNIX-based script work is to desk-check it before running it. Look for some of the following things: Calls to functions unimplemented in ActivePerl.
Related Questions

How do I extract my script out of packed executable?

AnnoCPAN - PAR::FAQ
The answer is to just use unzip/winzip/winrar/whatever to decompress the executable, treating it like a normal Zip file. You may need to rename the executable into a .zip extension first.
Related Questions

Is the script's permission set to executable?

Answers and solutions to CGI related issues
Is the actual syntax in the script correct? One thing you can do is log in to your account's shell, and execute your script with the Perl interpreter like this: Perl will then list all errors found on the script. Also, if you execute the script in the following way: and the shell responds with a "file not found" message, it means the script's path to Perl is wrong, or the script was uploaded in binary mode and not ASCII mode. First, to call a CGI through SSI, your page must have either an .
Related Questions

How do I send mail from a Python script?

Python Library and Extension FAQ
Here's a very simple interactive mail sender that uses it. This method will work on any host that supports an SMTP listener. import sys, smtplib fromaddr = raw_input("From: ") toaddrs = raw_input("To: ").split(',') print "Enter message, end with ^D:" msg = '' while 1: line = sys.stdin.readline() if not line: break msg = msg + line # The actual mail send server = smtplib.SMTP('localhost') server.sendmail(fromaddr, toaddrs, msg) server.
Related Questions

How can I hide my script within a single executable program?

REBOL Language FAQ
We sell and license to a tool called REBOL/Encap that will compress, encrypt, and encapsulate your scripts (plus any data and images too) into a single executable file. This tool is fast and easy to use (runs without a GUI, like a compiler). For more information, contact us.
Related Questions

How do I run script files under UNIX?

Borland AppCenter Developer Support Page
If you are running script files rather than directly running executables under UNIX, you should ensure that your script files do the following: Each script should launch only a single executable. (It may launch multiple executables, but only the required one will be monitored by AppCenter.) If I create a Virtual Computer then it seems that the virtual computer is always talking to the first Agent in the list of agents of this computer (usually _SYSTEM).
Related Questions

How do I make stand-alone executable?

Luca's XPCE programming FAQ
I'd like to know the best way for implementing a graph editor which must be consistent with the Prolog internal representation How do I attach hidden information to a device object? I'd like to keep related information in a self-contained package.
Related Questions

How do I make my CGI executable?

Answers and solutions to CGI related issues
A CGI needs to be made executable before it can be used by a website/webserver. On your account's shell (by using telnet), apply the command "chmod 755 cgi_name", where cgi_name is the name of the CGI program file. You can also do this if you are using an FTP program like CuteFTP by just right-clicking on the filename.
Related Questions

How can I make a Webmin user always use the same password as Unix?

Webmin
In the Webmin Users module, click on the user that you want to symchronize with Unix and set his Password option to Unix Authentication. If PAM is not used on your operating system, the first two steps can be skipped. Webmin will instead read the /etc/passwd or /etc/shadow file directly to authenticate users who are using the Unix Authentication password mode.
Related Questions

Can I run the polaris executable directly, i.e. without using the script?

The ParaMount Group FAQ
You can use the polaris executable directly by using the executable found in: /home/yara/re/mv/Master/bin/sparc-sun-solaris2.6. Make sure that you then change your POLARIS_ROOT to /home/yara/re/mv/Master and update your PATH variable so that the correct executable is chosen.
Related Questions

How do I make an executable JAR file?

Class IAQ
Solution: If your program is an applet compressed in a JAR file, there is only one change you need to make. Normally when you run an applet, your html file would have the following: <applet code=TheApplet.class width=200 height=200> </applet> For a JAR file, you simply have to add an additional archive parameter: <applet code=TheApplet.class archive="applets/TheApplet.
Related Questions

How do I make an executable program?

The Scala Programming Language: Frequently Asked Questions
There are two general strategies: you can write a script file and use the interpreter, or you can compile an object that has a main method. To make a script file, simply put Scala code into a file and make the file executable. See the scala(1) reference page for details and examples. To use a main method, you must include in your Scala code an object with a main method.
Related Questions

How do I debug an executable built by running make?

The TOM Programming Language FAQ
The result of running make is normally not the executable proper, but a script that is created by libtool. That script does the shared-library magic needed to run the executable in-place. To actually debug the executable in-place, you need additional magic: libtool --mode=execute gdb ./yourapp
Related Questions

How can I make a suid executable dump core?

Unofficial comp.os.linux.development.* FAQ
If you have the source you can easily add a statement early in main to enable the dumpable flag. #include <sys/prctl.h> ... /* The last three arguments are just padding, because the * system call requires five arguments. */ prctl(PR_SET_DUMPABLE,1,42,42,42); If anybody know a clean and secure way to get core dumps from suid executables without a recompile please tell me about it.
Related Questions

How do I make a script?

mIRC: Frequently Asked Questions about mIRC - Section 6
First of all you have to make sure you really need a script. Scripting is not difficult but if you simply want to auto-op your friends on your IRC channel, or if you want to ban or ignore an annoying person, mIRC is perfectly equipped already with functions that do exactly what you want. In this case read the section about the auto-op, protect and ignore lists.
Related Questions

Can I serve Plan-B screencasts from script pages, such as PHP, Python or Perl?

Conficio - frequently asked questions about Plan-B
Certainly, Plan-B technology is based on Java and HTML. As long as you generate HTML pages that can embed the <OBJECT>-tag and the <EMBED>-tag, you can generate your pages with the scripting language you desire.
Related Questions

How can I create a stand-alone binary from a Python script?

Python Frequently Asked Questions
Even though there are Python compilers being developed, you probably don't need a real compiler, if all you want is a stand-alone program. There are three solutions to that. One is to use the freeze tool, which is included in the Python source tree as Tools/freeze. It converts Python byte code to C arrays. Using a C compiler, you can embed all your modules into a new program, which is then linked with the standard Python modules.
Related Questions

Queuing Systems Q. Why is my MPI executable not getting the environment I set in my LSF job script?

ARL MSRC: Frequently Asked Questions (FAQs)
The module cth_interim03 sets CTHPATH indeed, but mpirun.lsf does not carry the environment over to the compute nodes while spanning the multi-node job causing CTHPATH and other varibels set by setenv and modules in bsub script undefined. To force mpirun.lsf carry the whole environment over to the compute nodes use "--gm-copy-env" flag as below: mpirun.
Related Questions

How the heck do you make an array in Python?

Python Frequently Asked Questions
Lists are arrays in the C or Pascal sense of the word (see question 6.16). The array module also provides methods for creating arrays of fixed types with compact representations (but they are slower to index than lists). Also note that the Numerics extensions and others define array-like structures with various characteristics as well.
Related Questions

edit] Why is XtString undefined when using VTK+Python on Unix?

VTK FAQ - KitwarePublic
This is a side effect of dynamic linking on (some?) Unix systems. It appears often on Linux with the Mesa libraries at least. The solution is to make sure your Mesa libraries are linked with the Xt library. One way to do this is to add "-lXt" to MESA_LIB in your user.make file.
Related Questions

What is Python?

Ciranova FAQ
Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. Python combines remarkable power with very clear syntax. It features modules, classes, exceptions, very high level data types, and dynamic typing. Ciranova uses Python as an extension language for our layout APIs.
Related Questions

Got A Question? Ask Our Community!


More Questions >>

© Copyright 2007-2008 QueryCAT
About • Webmasters • Contact