On May 30, 2014 8:26 AM, "Ganesh Pal" wrote:
>
>
> Hello Python world ,
>
>
> I wanted suggestion on how to modify the below code to help me accomodate
the below two cases
Your question was answered already, but I'd like to point out that optparse
is deprecated. If possible, you should use argpar
Am Sa Mai 31 2014, 13:08:12 schrieb Ganesh Pal:
>> I think you have to do it manually:
>>
>> options, args = parser.parse_args()
>>
>> if options.object == "super_block" and options.path is not None:
>> parser.error("Paths not allowed for 'super_block' object")
>>
>> elif options.object ==
Ganesh Pal wrote:
> Hello Python world ,
>
>
> I wanted suggestion on how to modify the below code to help me accomodate
> the below two cases
>
> # Here is the Sample code.
>
> def main():
> """ ---MAIN--- """
> parser = optparse.OptionParser(usage='%prog [options] .]',
> version='1.0
On Fri, May 30, 2014 at 7:48 PM, Ganesh Pal wrote:
>
> Hello Python world ,
>
>
> I wanted suggestion on how to modify the below code to help me accomodate
> the below two cases
>
> # Here is the Sample code.
>
> def main():
> """ ---MAIN--- """
> parser = optparse.OptionParser(usage='%pr
Hello Python world ,
I wanted suggestion on how to modify the below code to help me accomodate
the below two cases
# Here is the Sample code.
def main():
""" ---MAIN--- """
parser = optparse.OptionParser(usage='%prog [options] .]',
version='1.0')
object_choice = ('super_block','block