Using Python 2.7 on Ubuntu 16.04 (Xenial) - What is your system?
Does this help?
As you can see I am using the Python CLI - it's so much easier for testing snippets of code. Note the use of the help function - it shows the equivalent of a man page of Python classes and their methods. I don't know what you were trying to achieve with
but I hope the above helps you with achieving that.
A quick look at the statements I typed in: parser.sections() lists the section of the ini file. parser.items('test_ini') lists the section test_ini as a list of tuples; each tuple a name/value pair. ptfm_dgnst = dict(parser.items('ptfm_dgnst')) creates a dictionary (simplistically Python's hash table) so you can now access the values through their names. conn_str = ptfm_dgnst['conn'] does what I think you were trying to do with the conn_str = os.system() statement.
I hope this helps.
Andrew
Last edited by apmcd47; 06-28-2017 at 12:03 PM..
Reason: Typo! con.system instead of os.system
Hi
I need to run a shell script from a TCL script,the shell script in trun will run a python script
1.Tcl script
set filename "./GopiRun.sh"
2.GopiRun.sh
python ./psi.py $MYSB/test_scripts/delivery/gpy1.py
3.I have my gpy1.py script.
Here the problem i am facing is on running... (0 Replies)
Hello again,
You guys might remember me from the "Apache problems" thread. And because this forum is the only one that actually helped me out after months of problems I was hoping you could help me with something related.
Now if you remember the final code that we made for creating an account... (0 Replies)
I have a shell script main.sh which inturn call the python script ofdm.py, I want to pass two variables from shell script to python script for its execution. How do i achieve this ?????
Eg:
main.sh
a=3 b=3;
c= a+b
exec python ofdm.py
ofdm.py
d=c+a
Thanks in Anticipation (4 Replies)
experts, i wrote a python script to do a certain job, i tried it and it is working fine, i want this script to be executed automatically after a ksh script, the problem is when i execute the ksh script my python script runes perfectly after the ksh script as I have include it at the end of the ksh... (1 Reply)
Hi All,
i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way??
#!/bin/ksh
##script is sample.ksh
age=$1
gender=$2
class=$3
.
.
.... (3 Replies)
I have another basic Pythonic question that I cant seem to figure out. Here we go. So what I am trying to accomplish is simply using a second variable in my "scanjob" variable adding "api_tok". I am using a product that needs an api_token for every call so I just want to persistently add "api_tok"... (0 Replies)
I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Hi all,
I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine..
Below is the code I am trying:
#!/usr/bin/env python
import wmi
c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies
LEARN ABOUT PHP
xml_set_processing_instruction_handler
XML_SET_PROCESSING_INSTRUCTION_HANDLER(3) 1 XML_SET_PROCESSING_INSTRUCTION_HANDLER(3)xml_set_processing_instruction_handler - Set up processing instruction (PI) handlerSYNOPSIS
bool xml_set_processing_instruction_handler (resource $parser, callable $handler)
DESCRIPTION
Sets the processing instruction (PI) handler function for the XML parser $parser.
A processing instruction has the following format:
target data?>
?>) can not be quoted, so this character sequence should not appear in the PHP code you embed with PIs in XML documents.If it does, the
rest of the PHP code, as well as the "real" PI end tag, will be treated as character data.
PARAMETERS
o $parser
- A reference to the XML parser to set up processing instruction (PI) handler function.
o $handler
-$handler is a string containing the name of a function that must exist when xml_parse(3) is called for $parser. The function
named by $handler must accept three parameters:
handler (resource $parser, string $target, string $data)
o $parser
- The first parameter, parser, is a reference to the XML parser calling the handler.
o $target
- The second parameter, $target, contains the PI target.
o $data
- The third parameter, $data, contains the PI data.
If a handler function is set to an empty string, or FALSE, the handler in question is disabled.
Note
Instead of a function name, an array containing an object reference and a method name can also be supplied.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
PHP Documentation Group XML_SET_PROCESSING_INSTRUCTION_HANDLER(3)