For following example, how to write command-line option OR metavar
into file...
parser.add_option("-opt1", metavar="MY_OPTION1", default=123)
parser.add_option("-opt2", metavar="YOUR_OPTION2" ,default= "abc")
parser.add_option('-opt3", metavar="FLAG", default=True)
do we have any facility to writ
I am planning to use python module if available.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Like we 'named pipes', how we can achieve comminication between more
than two processes.
And how it can be scaled to remote machines?
Any idea?
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 15, 11:38 pm, "Mark Tolonen" wrote:
> "hiral" wrote in message
>
> news:90b62600-a0a4-47d5-bb6f-a3ae14cf6...@9g2000prn.googlegroups.com...
>
> > Hi,
> > I tried...
>
> >
> > # coding: latin-1
> > print "
On Oct 15, 11:06 pm, John Nagle wrote:
> On 10/15/2010 4:57 AM, hiral wrote:
>
> > Hi,
> > I tried...
>
> >
> > # coding: latin-1
> > print "**"
On Oct 15, 5:24 pm, "Michel Claveau -
MVP" wrote:
> Hi!
>
> 1) the good syntax is:
> # -*- coding: latin-1 -*-
> print "**"
> oo = "ö"
> print "char=<%s>" % oo
> print "**
Hi,
I tried...
# coding: latin-1
print "**"
oo = "ö"
print "char=<%s>" % oo
print "**"
but it is not printing "ö" char;
On Oct 13, 6:03 pm, Jean-Michel Pichavant
wrote:
> hiral wrote:
> > Hi,
>
> > I want to display help message of python script and then display help
> > message from the binary file (which also supports -h option):
>
> > Assumptions:
> > 1) 'mybinary
e",
help="Execute binary", metavar="FILE")
(options, args) = parser.parse_args()
if options.file:
subprocess.call(options.file)
Requirement:
$ python myscript.py -h
Thank you in advance.
-Hiral
--
http://mail.python.org/mailman/listinfo/python-list
s same API with java, everything is fine all time.
I am unable to understand why read() method is changing server behavior!!
Can anyone please guide me in same?
Thank you so much for your time. Waiting for your reply.
Thanks,
Hiral
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 14, 7:11 pm, Kushal Kumaran
wrote:
> On Mon, Jun 14, 2010 at 7:01 PM,hiral wrote:
> > Hi,
>
> > Do we have any facility to append file from Popen()/call(); see below
> > example...
>
> > 1 import subprocess
> > 2 f=open('log', 'w
Hi,
Do we have any facility to append file from Popen()/call(); see below
example...
1 import subprocess
2 f=open('log', 'w')
3 ...# writing some log-into into log file
4 p = subprocess.Popen(cmd, stdout=f, stderr=f) # (Q)
5 ...# do remaining stuff
Q: At line# 4, the output of the 'cmd' will wip
Hi,
Do we have any facility to append file from Popen()/call(); see below
example...
1 import subprocess
2 f=open('log', 'w')
3 ...# writing some log-into into log file
4 p = subprocess.Popen(cmd, stdout=f, stderr=f) # (Q)
5 ...# do remaining stuff
Q: At line# 4, the output of the 'cmd' will wip
On Jun 6, 7:27 am, Steve wrote:
> On 5 June, 08:53, Steve wrote:
>
> > I am new to Python and am wanting to replace characters in a very
> > large text file.6 GB
> > In plain language what I wish to do is:
>
> > Remove all comma's
> > Replace all @ with comma's
> > Save as a new file.
>
> >
I should specify them as seperate options like...
> parser.add_option("-o', dest=exe_file...)
> parser.add_option("-oexe', dest=exe_file...)
> parser.add_option("-otxt', dest=txt_file...)
> parser.add_option("-opdf', dest=pdf_file...)
> parser.add_option("-oppt', dest=ppt_file...)
Thank you in advance.
-Hiral
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 8, 3:03 pm, Jean-Michel Pichavant
wrote:
> hiralwrote:
> > Hi,
>
> > I am using optparser to do following...
>
> > Command syntax:
> > myscript -o[exension] other_arguments
> > where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
>
> > Now to parse this, I am doing following...
>
> >
Hi,
I am using optparser to do following...
Command syntax:
myscript -o[exension] other_arguments
where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
Now to parse this, I am doing following...
parser.add_option("-oexe', dest=exe_file...)
parser.add_option("-otxt', dest=txt_file...)
par
tandard
module name) with custom methods?
Thank you in advance.
-Hiral
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any module/utility like 'rsync' in python.
Thank you in advance.
-Hiral
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am trying following script...
On Mar 12, 8:02 pm, Jean-Michel Pichavant
wrote:
> Luis M. González wrote:
> > On Mar 12, 10:59 am,hiral wrote:
>
> >> Hi,
>
> >> Is there any way to create variables which name matches with dict key?
>
> >> For example:
> >> dict1 = {"ab
On Mar 15, 7:14 am, Tim Roberts wrote:
> hiral wrote:
> >...
> >Output:
> >real 0.0m0.010002421s
> >user 0.0m0.0s
> >sys 0.0m0.0s
>
> >Command:
> >$ time ls
>
> >Output:
> >real 0m0.007s
> >user 0m0.000s
&g
Hi,
Is there any way to create variables which name matches with dict key?
For example:
dict1 = {"abc":'1", "def":"2"}
Now I am looking to have variable name abc and it's value be '1' etc.
Pl. suggest.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any python module/utility available which would report the
time same as 'time' command in linux and/or report time same as
'ntimer' utility in Windows.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Python version: 2.6
Script:
def pt(start_time, end_time):
def ptime(time, time_str):
min, sec = divmod(time, 60)
hr, min = divmod(min, 60)
stmt = time_str + '\t'
if hr:
stmt += str(hr) + 'h'
stmt += str(min) + 'm' + str(sec) + 's'
25 matches
Mail list logo