Re: [Tutor] Parse text with python

2013-10-17 Thread Danilo Chilene
Hi, The part that always change is the , it can be 1 digit or 4 digits. Example: 1. The part that never changes is the 1700. On Thu, Oct 17, 2013 at 5:37 PM, Danny Yoo wrote: > Do you have other domain-specific information about this text? > Concretely: if you have another similar report,

[Tutor] Parse text with python

2013-10-17 Thread Danilo Chilene
Hello, I have the text below: CSMP0097I 14.42.12 CPU-B SS-BSS SSU-AA IS-02 -LAL USER CONTROL FILE- MAXIMUM DEFINABLE USERS- 14999 MAXIMUM CONFIGURABLE USERS - 11790 CURRENT NUMBER USERS - 09692 USER FLUSH CRET TIME VALUE -5 -LAL USER FILE- NAME UORD T/O O OXIT RXIT

Re: [Tutor] Repeat Until Dead

2013-06-26 Thread Danilo Chilene
Hello, Try something like this: coin = raw_input('Insert coins:\n') while(coin > 0): coin = int(coin)-1 print 'You have {0} coin(s)'.format(coin) $ python teste.py Insert coins: 2 You have 1 coin(s) You have 0 coin(s) On Wed, Jun 26, 2013 at 3:30 PM, Chris “Kwpolska” Warrick < kwpol.

[Tutor] Playing with XML

2013-06-20 Thread Danilo Chilene
Hello, Below is my code: #!/bin/env python # -*- coding: utf-8 -*- import requests from lxml import etree url = 'http://192.168.0.1/webservice.svc?wsdl' headers = {'Content-Type': 'text/xml;charset=UTF-8', 'SOAPAction': ' http://tempuri.org/ITService/SignIn'} xml = '''http://schemas.xmlsoap.org/

Re: [Tutor] Argparse functions with N parameters

2013-06-06 Thread Danilo Chilene
assword,address,database version Any thoughts? Best Regards, Danilo On Wed, May 8, 2013 at 10:31 AM, Danilo Chilene wrote: > > > That solves my issue. > > Thanks Peter. > > To unsubscribe or change subscription options: > >>

Re: [Tutor] Argparse functions with N parameters

2013-05-08 Thread Danilo Chilene
That solves my issue. Thanks Peter. To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

[Tutor] Argparse functions with N parameters

2013-05-07 Thread Danilo Chilene
Hello, I have the code below: import argparse class Myclass(object): def foo(self): print 'foo' def bar(self): print 'bar' def test(self,name,place): print name, place class Main(Myclass): def __init__(self): foo_parser = argparse.ArgumentParser

Re: [Tutor] Fwd: Sys.argv read parameters

2013-04-18 Thread Danilo Chilene
On Thu, Apr 18, 2013 at 2:52 PM, Alan Gauld wrote: > On 18/04/13 18:14, Danilo Chilene wrote: > > for command in commands: >> if arg in commands: >> print commands[command] >> else: >> print 'Invalid command' >> &g

Re: [Tutor] Fwd: Sys.argv read parameters

2013-04-18 Thread Danilo Chilene
On Thu, Apr 18, 2013 at 10:31 AM, Dave Angel wrote: > On 04/18/2013 09:21 AM, Danilo Chilene wrote: > >> On Wed, Apr 17, 2013 at 8:21 PM, Dave Angel wrote: >> >> >>> -- Forwarded message ------ >>> >>>> From: Danilo Chilene &g

Re: [Tutor] Fwd: Sys.argv read parameters

2013-04-18 Thread Danilo Chilene
On Wed, Apr 17, 2013 at 8:21 PM, Dave Angel wrote: > > -- Forwarded message -- >> From: Danilo Chilene >> Date: Wed, Apr 17, 2013 at 2:17 PM >> Subject: Re: [Tutor] Sys.argv read parameters >> To: Danny Yoo >> >> >> Hello Da

Re: [Tutor] Sys.argv read parameters

2013-04-17 Thread Danilo Chilene
Hello Dave, 1) I'm using Python 2.7 2) The program wasn't suppose to really work, was just a example. 3) You assumed correct. That's was what I looking for, worked like charm. Thanks! On Wed, Apr 17, 2013 at 5:18 PM, Dave Angel wrote: > On 04/17/2013 03:27 PM, Da

[Tutor] Sys.argv read parameters

2013-04-17 Thread Danilo Chilene
Dear Python Tutor, I have the code below(file.py): import sys a = 'This is A' b = 'This is B' c = 'This is C' for i in sys.argv[1]: if sys.argv[1] == 'a': print a if sys.argv[1] == 'b': print b if sys.argv[1] == 'c': print c I run python file.py a and return