I have a file command.txt. It's content are as follows:-
Quote:
scriptname -arg1 aa -test -arg2 bb
The content of file is actually a command with script name and respective arguments.
arg1 and arg2 are dummy arguments , format : -arg arg_value
test is a argument specifying run mode , format : -arg
In my python code, i read it and store it in a variable named "data"
Now i need your help on how should I process "data" to get the scriptname, arg1, run_mode,arg2.
I was trying to convert the "data" into a list and then read values from it using if-else(case) statements.
However- since i am new in python- i am not able to convert data into list, probably the content are not suitable for such conversion.
Hi experts -
I'm relatively new to python, but I have an requirement to automate getting a file from a WebLib server using an API.
The file I'm requesting from this sever is an excel spreadsheet (.xlsx).
I get a valid response back via an xml doc from the server.
In this xml file I get... (8 Replies)
Hello!
#!/usr/bin/env python
hn = "simsa-svr"
for container in containerslist:
Name = container
I want to print Name along with hn i,e simsa-svr. I tried like Name = container'-'.join(hn) did not work.
Needed result: lilly2232321-simsa-svr (2 Replies)
Hi. I have timestamps that I am trying to convert to epoch time. An example:
I am trying to convert this to an epoch timestamp but have one little glitch. I have this:
import time
date_time = ''
pattern = ''
epoch = int(time.mktime(time.strptime(date_time, pattern)))
print epoch... (1 Reply)
i have this below string which i need to convert it to HEX. i have already tried it but it showing extra few things on it.. let me show what i have done and what is the output i am getting and what is the desired output
the input string is
"!\"\"\"\"\"\"\"!\"\"\"\"\"\"\""
which is... (4 Replies)
How to convert below bash code in perl and python.
for BLOCK in /sys/block/emcpow*
do
echo "100000" > "$BLOCK"/queue/nr_requests
echo "noop" > "$BLOCK"/queue/scheduler
done (2 Replies)
Hello all. I need help...
How can I cenvert this 42ec93df826c804ea531c56594db453d54daad4b to normal text? What convertor I have to use?
Thanks. (12 Replies)
Guys
I need to convert a code from JSP (Java Tags are also there inside JSP) to PYTHON.
I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP.
Any idea how to approach?
Thanks in advance to all
C Saha (1 Reply)
Hi,
I need to be able to take an unsigned long value and convert it to a string that is separted by commas.
So for example, if i have the unsigned long value 1372516, I'm supposed to somehow get "1,372,516".
Can someone please give me the right direction to go about doing this? Thanks. (3 Replies)
I am porting a awk script from Windows to unix
I_SALE_MEDIA=$67
if ((I_VOID_FLAG == "Y") && (I_SALE_MEDIA == 0))
NOW consider the case where I_SALE_MEDIA i.e $67 is "000"
The above comparison works fine in Windows , but to make it work in
Unix , I had to change the above as follows :
... (3 Replies)