PHP script to get name of file which houses the script?
I have a number of files which contain PHP scripts like:
The included PHP script uses $file_name to get the last uploaded time stamp of the named file and process it into a displayable line. All that works as intended.
What I don't like is the need for $file_name='mtg10.php'; It would be much handier if I could write something like $file_name=getNameOfThisFile(); instead.
I've looked, can't find any such function, but maybe I haven't looked in the right references. Is the...Executing a python script with arguments from a python script
I need to call a python script, with command line arguments (it is an
autonomous script with a __main__), from within another python script.
Can I use exec() or execfile() for this? How to pass the arguments?
> I need to call a python script, with command line arguments (it is an
> autonomous script with a __main__), from within another python script.
> Can I use exec() or execfile() for this? How to pass the arguments?
Are you sure you want to do...Script Script
Ever want to try a little script to see if it will work
but don't want to go through the hassle of creating a file
with #!/bin/bash at the top and making it executable and
running it as ./script-name and then deleting it or moving
You can use the fc command in bash, but it runs in the
current shell, which can cause real problems, and once
you've done it, if it is more than one line, or you do
anything else in between at the prompt, it's gone. fc
also echos the script, which is really ugly and confusing.
So I wrote this little script which has been tremendously
u...PHP CGI script to PHP CLI script
This is my problem:
I'm using PEAR package Spreadsheet_Excel_Writer to generate Excel
files. Everything works fine on my test server and several production
servers. But on one production server, generated Excel won't open (and
data is actually in it).
I can't figure out what's causing the problem (only difference is PHP
version 5.1.6 vs 5.2, other required PEAR packages are identical), but
I did notice during my investigation that Excel file generates and
opens without problem if I execute script from command line (I use
dummy PHP script with basic things needed to m...executing a python script from another python script.
Content-Type: text/plain; charset=us-ascii
Hi Python Guru,
I ve created a GUI using Boa constructor and am now trying to execute a python script when pressing a button on the GUI. So, there will then be two main threads running (the GUI thread and the python script thread). The purpose of doing this is to enable selecting python script to be run from the GUI.
any helps please...
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger
Content-Type: text/html; ch...Getting return code for a Python script invoked from a Linux shell script
I have a Python script that is invoked by a shell script. I uses
sys.exit() with a parameter within python.
The calling script is using this line to get the return code:
exit_code = !$
but it fails to get it. What's wrong here? (I am no Linux guru)
Thanks in advance
On Wed, 23 Sep 2009 09:51:29 -0700, volcano wrote:
> The calling script is using this line to get the return code: exit_code
> = !$
> but it fails to get it. What's wrong here? (I am no Linux guru)
Exit code is obtained with $?, not with !$
Igor Pozgaj | ipozgaj at gmail.com (G...How to get a text input value into a php script
here is the code:
<td>ohne Anmeldung: </td>
<td><input name="vanm" id="vanm" type="checkbox"
<td>Max. Teilnehmerzahl: </td>
<td><input name="vteilz" id="vteilz" type="text" size="1"
-------...run php on a script, from a script
I would like to know if the following is possible and how to do it:
I have a "template" .php file on my server, say template.php.
It contains some PHP instructions and some HTML
I also have a script, script.php
When script.php runs, I want it to run php on template.php, and write
the resulting html output to a file.
I need to say something like:
runphp ( 'template.php', 'htmloutput.html' );
and obtain a file, htmloutput.html, with the result of php having run
template.php (hope I'm being clear).
The problem is, of course, tha...Postional Parameter getting wrong value from inside scripts
I have a small problem. I use a script to pass a parameter and i assign
it to a variable .
Later on , from inside the program if i call another script and pass a
paramater,my first $1 is lost .
Content of abc.sh
Content of def.sh
Calling- ./abc.sh FIRST
My output is SECOND. I Need to make use of the "FIRST" later on in the
same script ( abc.sh ) /
Anyone has any idea.
On 7 Aug 2006 03:10:51 -0700, "aarcee" <email@example.com> wrote:
>I have a small problem. I use a script to pa...Python as active script <script language=python>
I'm using Activestate python,
For older version of python, I know that we can register python as
active script by registering it through win32comext.axscript.client
And to do that I need to change something in this pyscript.py before
but I can't find similar thing with python 2.6.2
I can't find the line that need to be changed.
Can someone kindly show me how to enable python26 as an active script
...How to Machine A python script execute Machine B python script?
Anyone know how I can make Machine A python script execute a python
script on Machine B ?
If you're running on a UNIX platform, one option would be to use SSH to execute the command remotely. Otherwise, you could also use a client/server setup to have the two scripts communicate across the network and trigger actions etc. It may also be possible to remotely execute an application on Windows using the win32api extensions, but I haven't any idea how you'd go about that. Perhaps others can chime in with detailed information if you let us know what kind of platform you're on and ...why does it not get the value in perl run shell script to call include php file?
two file in the same folder
$i = 0;
$decryptCC = `echo '<?php include( "/home/webserve.ca/eselect/
eselect_test/fun.php" ); echo "CC" . dcc( "$i", "" ) . "CC"; ?>' | php
run ./1.sh get test.
2. run ....Getting Python to run Python Scripts in cygwin
This may be a cygwin issue but I was hoping to get some answers here
as well if someone has fixed this problem before.
Basically, I am able to run "python <scriptname>.py" python files in
command prompt. Unfortunately, I can't seem to get it to work in
cygwin. I always get an error that says:
python: can't open file '<scriptname>.py': [Errno 2] No such file or directory
I have looked at my environment variables and it seems to be correct.
Would be grateful if someone who has gotten python to work correctly
on cygwin could point me in the rig...how do i run another script from my python script
hey there all,
i have been looking for a way to run a php command line script from my
here is what i want to do:
if x = 4:
execute php4 testin.php
execute php4 testout.php
and i also need the script to wait untill the php4 script is done
(which i think is the default ) before continuing to run.
i know this is possible, but how?
> hey there all,
> i have been looking for a way to run a php command line script from my
> python script.
> here is what i want to do:
> if x = 4:
> execute php4 testin.p...