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


Groups > comp.lang.python > #27901

Re: Computing win/loss records in Python

From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Computing win/loss records in Python
References <mailman.3821.1345947609.4697.python-list@python.org>
Date 2012-08-26 14:33 +1000
Message-ID <87fw7ae0hf.fsf@benfinney.id.au> (permalink)
Organization Unlimited download news at news.astraweb.com

Show all headers | View raw


Christopher McComas <mccomas.chris@gmail.com> writes:

> I have code that I run via Django that grabs the results from various
> sports from formatted text files. The script iterates over every line
> in the formatted text files, finds the team in the Postgres database
> updates their w/l record depending on the outcome on that line, saves
> the team's row in the db, and then moves on to the next line in the
> file.

It seems that you already have a PostgreSQL database storing this data.

> I'm trying to get away from Django for this project

That existing database can be accessed without Django. You could talk
directly using the ‘psycopg2’ library, but you don't have to go that
far.

I would recommend you use SQLAlchemy as a good and flexible way to
access existing databases (or make new ones) in a Pythonic manner
<URL:http://www.sqlalchemy.org/>. If you are using a free-software
operating system, you will likely already have packages available to
install SQLAlchemy from your operating system's package repositories.

-- 
 \         “True greatness is measured by how much freedom you give to |
  `\      others, not by how much you can coerce others to do what you |
_o__)                                               want.” —Larry Wall |
Ben Finney

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


Thread

Computing win/loss records in Python Christopher McComas <mccomas.chris@gmail.com> - 2012-08-25 22:20 -0400
  Re: Computing win/loss records in Python Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-08-26 03:38 +0000
  Re: Computing win/loss records in Python Ben Finney <ben+python@benfinney.id.au> - 2012-08-26 14:33 +1000

csiph-web