Re: Unusual i/o problems

2007-05-18 Thread saif . shakeel
On May 18, 1:01 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I am running the exe from command prompt,but i am not able to see > > the error as it goes off very quickly. > > http://effbot.org/pyfaq/how-do-i-run-a-python-program-under-windows.htm > > > How do i capture t

Re: i/o prob revisited

2007-05-18 Thread saif . shakeel
On May 18, 1:50 pm, [EMAIL PROTECTED] wrote: > On May 18, 12:06 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > I am parsing an xml file ,before that i have replaced a string in > > the original xml file with another and made a new xml file which will > > now be parsed.I am also opening some

i/o prob revisited

2007-05-18 Thread saif . shakeel
Hi, I am parsing an xml file ,before that i have replaced a string in the original xml file with another and made a new xml file which will now be parsed.I am also opening some more files for output.The following code shows some i/o commands. file_input = raw_input("Enter The ODX File Path:") i

Re: Unusual i/o problems

2007-05-18 Thread saif . shakeel
On May 16, 7:55 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > output_file = open(test_file,"w") > ... > > input_xml_sec = open(output_file,'r') > > Can you spot the problem now? To prevent it, use a naming convention that > allows you to distinguish between file /names

Unusual i/o problems

2007-05-16 Thread saif . shakeel
Hi, I am parsing an xml file ,before that i have replaced a string in the original xml file with another and made a new xml file which will now be parsed.I am also opening some more files for output.The following code shows some i/o commands. file_input = raw_input("Enter The ODX File Path:") i

removing common elemets in a list

2007-05-15 Thread saif . shakeel
Hi, Suppose i have a list v which collects some numbers,how do i remove the common elements from it ,without using the set() opeartor. Thanks -- http://mail.python.org/mailman/listinfo/python-list

removing spaces between 2 names

2007-05-14 Thread saif . shakeel
Hi, Suppose i have a string stored in variable,how do i remove the space between them,like if i have the name: "USDT request" in a variable.i need "USDTrequest",without any space . Thanks -- http://mail.python.org/mailman/listinfo/python-list

Element tree errors

2007-05-14 Thread saif . shakeel
HI, The following code is for replacing the strings localid with "datapackageid" in an xml document.: from xml.etree.ElementTree import ElementTree as et file_input = raw_input("Enter The ODX File Path:") (shortname,ext)=os.path.splitext(file_input) test_file=shortname+"testxml.xml" input

Re: Removing part of string

2007-05-14 Thread saif . shakeel
On May 14, 1:04 pm, [EMAIL PROTECTED] wrote: > On May 13, 10:56 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > I am parsing an xml file ,and one part of structure looks > > something like this: > > > - > PhysicalLink="Infotainment_Control_Bus_CAN"> > > Infotainment_Control_Bus_CAN_TIMEOU

Removing part of string

2007-05-13 Thread saif . shakeel
Hi, I am parsing an xml file ,and one part of structure looks something like this: - Infotainment_Control_Bus_CAN_TIMEOUT_AX Timeout N_As/N_Ar Time from transmit request until a CAN frame transmit confirmation is received. In my code i am extracting the data within

Re: module error for elementtree

2007-05-11 Thread saif . shakeel
On May 11, 12:22 pm, [EMAIL PROTECTED] wrote: > On May 11, 12:05 am, [EMAIL PROTECTED] wrote: > > > > > > > #!/usr/bin/env python > > > from elementtree import ElementTree as Element > > tree = et.parse("testxml.xml") > > > for t in tree.getiterator("SERVICEPARAMETER"): > > if t.get("Semant

module error for elementtree

2007-05-11 Thread saif . shakeel
#!/usr/bin/env python from elementtree import ElementTree as Element tree = et.parse("testxml.xml") for t in tree.getiterator("SERVICEPARAMETER"): if t.get("Semantics") == "localId": t.set("Semantics", "dataPackageID") tree.write("output.xml") Hi,

Re: replacing string in xml file--revisited

2007-05-10 Thread saif . shakeel
On May 10, 1:55 pm, [EMAIL PROTECTED] wrote: > On May 10, 12:56 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > I need to replace a string in xml file with something else.Ex > > > - > > rate > > rate > > > > > > > > - > > > Here i have ope

Re: replacing string in xml file--revisited

2007-05-10 Thread saif . shakeel
On May 10, 1:42 pm, [EMAIL PROTECTED] wrote: > On May 10, 12:56 am, [EMAIL PROTECTED] wrote: > > > > > > > Hi, > > I need to replace a string in xml file with something else.Ex > > > - > > rate > > rate > > > > > > > > - > > > Here i have ope

replacing string in xml file--revisited

2007-05-10 Thread saif . shakeel
Hi, I need to replace a string in xml file with something else.Ex - rate rate - Here i have opened an xml file(small part is pasted here).I want to replace the word 'localId' with 'dataPackageID' wherever it comes in xml file.I have asked

Re: replacing string in xml file

2007-05-09 Thread saif . shakeel
On May 9, 4:39 pm, [EMAIL PROTECTED] wrote: > On May 8, 4:46 pm, [EMAIL PROTECTED] wrote: > > > > > > > On May 8, 4:30 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] schrieb: > > > > > Hi, > > > > I need to replace a string in xml file with something else.Ex > > > > > -

Problems in string replacement

2007-05-09 Thread saif . shakeel
HI, Thanks for the reply.that seems to work,but i was doing this so as to attach it to a bigger code where it will be utilised before a parsing. #Input file and Output file path from user file_input = raw_input("Enter The ODX File Path:") (shortname,ext)=os.path.splitext(file_input) f

Re: replacing string in xml file

2007-05-09 Thread saif . shakeel
On May 8, 4:46 pm, [EMAIL PROTECTED] wrote: > On May 8, 4:30 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] schrieb: > > > > Hi, > > > I need to replace a string in xml file with something else.Ex > > > > - > > > rate > > > rate > > > > > > > > > > >

Re: replacing string in xml file

2007-05-08 Thread saif . shakeel
On May 8, 4:30 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > > > Hi, > > I need to replace a string in xml file with something else.Ex > > > - > > rate > > rate > > > > > > > > - > > > Here i have opened

replacing string in xml file

2007-05-08 Thread saif . shakeel
Hi, I need to replace a string in xml file with something else.Ex - rate rate - Here i have opened an xml file(small part is pasted here).I want to replace the word 'localId' with 'dataPackageID' wherever it comes in xml file.I tried this b

assisging multiple values to a element in dictionary

2007-05-07 Thread saif . shakeel
Hi, I have a dictionary which is something like this: id_lookup={ 16:'subfunction', 26:'dataId', 34:'parameterId', 39:'subfunction', 44:'dataPackageId', 45:'parameterId', 54:'subfunction', 59:'dataId', 165:'subfunction', 169:'subfunction', 170:'dataPackageId', 174:'controlParameterId' }

Re: file Error

2007-05-03 Thread saif . shakeel
On May 3, 6:09 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 03 May 2007 09:39:37 -0300, <[EMAIL PROTECTED]> escribió: > > > Hi, > > I am parsing an xml file,and using raw_input command to ask the > > user to enter the file name.Ex > > > Enter The ODX File Path: > > > Suppose my

file Error

2007-05-03 Thread saif . shakeel
Hi, I am parsing an xml file,and using raw_input command to ask the user to enter the file name.Ex >>> Enter The ODX File Path: Suppose my code does not work properly,then in the python idle window it shows something like this: >>> C:\Projects\ODX Import\Sample Files\MiscFiles \CIM_A3300_diag

Searching for a piece of string

2007-05-03 Thread saif . shakeel
Hi, How can i match a part of string and branch to some part of code. Ex If there is a string like "Timeout" and i want to search only whether the word "Time" is present in it(which is valid in this case).so if i have "CastinTime",still this should hold. I need to use this in a "if" statemen

Re: I/O Operations .....

2007-04-30 Thread saif . shakeel
On Apr 30, 2:13 pm, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > > I am parsing an XML file and sending the output to two files.The > > code asks the user to enter the input file,something like: > > > file_input = raw_input("Enter The ODX File Path:") > > input_xml = open(file_input,'r') > > > N

I/O Operations .....

2007-04-30 Thread saif . shakeel
Hi, I am parsing an XML file and sending the output to two files.The code asks the user to enter the input file,something like: file_input = raw_input("Enter The ODX File Path:") input_xml = open(file_input,'r') Now suppose the user enters the path as : C:\Projects\ODX Import\Sample Files\

adjust

2007-04-24 Thread saif . shakeel
Hi, How do i right adjust my output using python.I need a output something like this: DID= 0x01,0x02,0x03,0x05,0x06,0x07,0x2B,0x30,0x31,0x4D,0x4E, 0x51,0x52,0x53,0x55, minlength= 3, 3, 4, 2, 10, 10, 40, 2, 150, 4, 1, 2, 2, 1, 2, 1, 6, 3, 17, 1, maxlength=

I/O Error

2007-04-24 Thread saif . shakeel
Hi, I am using File I/O to input an xml file form user and parse it.I have used something like this: file_input = raw_input("Enter The ODX File Path:") odx_file_output = raw_input("Enter the output file path : ") log_file_output = raw_input("Enter the path for LogFile : ") saveout = sys.std

redirect ouput

2007-04-23 Thread saif . shakeel
Hi, I am working on parsing an xml file using python.How can i redirect the output to 2 files,say,for some portion of code the output has to go to one file and for some part the o/p be directed to another file. -- http://mail.python.org/mailman/listinfo/python-list

Parsing Problems

2007-04-03 Thread saif . shakeel
Hi, I have just started learning python.I need to parse an XML file and present the contents in a particular format.The format is called as "ini" file.I have written some code.A section of the format needs the data to be present in format as given below: [Services] supported=0x10,0x1A,0x3B,0