Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71792

Re: Problem in writing demands to the xml file

Newsgroups comp.lang.python
Date 2014-05-20 01:06 -0700
References <94945828-0caf-4534-bdaa-5371bdda6dbe@googlegroups.com>
Message-ID <98ea99c4-fcd7-421b-88ba-b90f947afede@googlegroups.com> (permalink)
Subject Re: Problem in writing demands to the xml file
From varun7rs@gmail.com

Show all headers | View raw


There is no traceback error. But I want to actually fill the demands with certain attributes which I'm not able to do. When I run the program, the xml is written but the demands doesn't have any attributes whatsoever. I could give you a clear idea of what I expect in the demands. For every node, I have an attribute called totaldemands which takes a value between 1 and 5. Now, I need the same no. of demands being written onto the xml file below every node which is now empty

        totaldemands = random.randint(1, 5)
        demnum = 0
        for demand in range(totaldemands):
            demnum = demnum + 1
            PoPbdw = random.uniform(2, 2.5)
            PoPstor = random.uniform(2, 2.5)
            PoPpro = random.uniform(0.5, 1)
            MMEbdw = random.uniform(2, 2.5)
            MMEstor = random.uniform(2, 3)
            MMEpro = random.uniform(0.5, 1)
            IMSbdw = random.uniform(2.5, 3)
            IMSstor = random.uniform(2.5, 3.5)
            IMSpro = random.uniform(0.5, 1)
            SGWbdw = random.uniform(3, 3.5)
            SGWstor = random.uniform(2.5, 3.5)
            SGWpro = random.uniform(0.5, 1)
            PGWbdw = random.uniform(2.5, 3.5)
            PGWstor = random.uniform(2, 2.5)
            PGWpro = random.uniform(0.5, 1)

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Problem in writing demands to the xml file varun7rs@gmail.com - 2014-05-19 06:42 -0700
  Re: Problem in writing demands to the xml file "Rhodri James" <rhodri@wildebst.org.uk> - 2014-05-19 22:30 +0100
  Re: Problem in writing demands to the xml file varun7rs@gmail.com - 2014-05-20 01:06 -0700

csiph-web