Vote tallying...

Discussion in 'Python' started by Andrew Robinson, Jan 17, 2013.

  1. Hi,

    I have a problem which may fit in a mysql database, but which I only
    have python as an alternate tool to solve... so I'd like to hear some

    I'm building a experimental content management program on a standard
    Linux Web server.
    And I'm needing to keep track of archived votes and their voters -- for

    Periodically, a python program could be given a batch of new votes
    removed from the database, and some associated comments, which are no
    longer real-time necessary; and then a python script needs to take that
    batch of votes, and apply them to an appropriate archive file. It's
    important to note that it won't just be appending new votes, it will be
    sorting through a list of 10's of thousands of votes, and changing a
    *few* of them, and appending the rest.

    XML may not be the ideal solution, but I am easily able to see how it
    might work. I imagine a file like the following might be inefficient,
    but capable of solving the problem:

    <?xml version="1.0"?>

    <chapter>The woodstock games</chapter>

    <comment id="FF53524" date="2013.01.12">I think you're on
    drugs, man.!</comment>
    <comment id="unregistered" date="2013.01.12">It would have been
    better if they didn't wake up in the morning.</comment>

    <v id="FF3424">10</v>
    <v id="F713A4">1</v>
    <v id="12312234">3</v>

    The questions I have are, is using XML for vote recording going to be
    slow compared to other stock solutions that Python may have to offer?
    The voter ID's are unique, 32 bits long, and the votes are only from 1
    to 10. (4 bits.). I'm free to use any import that comes with python
    2.5. so if there's something better than XML, I'm interested.

    And secondly, how likely is this to still work once the vote count
    reaches 10 million?
    Is an XML file with millions of entries something someone has already
    tried succesfully?
    Andrew Robinson, Jan 17, 2013
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lie Ryan

    Re: Vote tallying...

    Lie Ryan, Jan 18, 2013, in forum: Python
    Lie Ryan
    Jan 18, 2013
  2. Stefan Behnel

    Re: Vote tallying...

    Stefan Behnel, Jan 18, 2013, in forum: Python
    Stefan Behnel
    Jan 18, 2013
  3. Nick Cash

    RE: Vote tallying...

    Nick Cash, Jan 18, 2013, in forum: Python
    Nick Cash
    Jan 18, 2013
  4. Tim Chase

    Re: Vote tallying...

    Tim Chase, Jan 18, 2013, in forum: Python
    Tim Chase
    Jan 18, 2013
  5. Andrew Robinson

    Re: Vote tallying...

    Andrew Robinson, Jan 18, 2013, in forum: Python
    Andrew Robinson
    Jan 18, 2013

Share This Page