Re: Pickling a database cursor?

2010-11-20 Thread Chris Rebert
On Sat, Nov 20, 2010 at 10:08 PM, Navkirat Singh wrote: > Hi Guys, > > Is there any way to pickle a database cursor? I would like a persistent > cursor over multiple HTTP requests. Any help would be awesome ! You can't. It's like a file handle in that respect. Cheers, Chris -- http://blog.reber

Pickling a database cursor?

2010-11-20 Thread Navkirat Singh
Hi Guys, Is there any way to pickle a database cursor? I would like a persistent cursor over multiple HTTP requests. Any help would be awesome ! Nav -- http://mail.python.org/mailman/listinfo/python-list

Re: building a web interface

2010-11-20 Thread Ian Kelly
On 11/20/2010 3:40 PM, Shel wrote: So right now I have a mySQL db structure and some Python code. My end goal is to create a browser-based interactive fiction/game thing. My code is currently just using dummy data rather than pulling in data from the db, but I think/hope it won't be too big of a

Re: Printing from Web Page

2010-11-20 Thread Hidura
Explain better what you try to do. 2010/11/20, Victor Subervi : > Hi; > I need to be able to print something from a Web page: not the entire page > but what I specify. I am writing the page and the client is surfing to it. > How do I do this? > TIA, > beno > -- Enviado desde mi dispositivo móvil

Re: building a web interface

2010-11-20 Thread Shel
This looks very promising. Thanks so much! Shel On Nov 20, 4:36 pm, Stef Mientki wrote: > On 20-11-2010 23:40, Shel wrote: > > > Hello, > > > I am pretty new to all this. I have some coding experience, and am > > currently most comfortable with Python.  I also have database design > > experience

Re: building a web interface

2010-11-20 Thread Shel
Thanks for your help. I know that they have Python and mySQL. They have mySQL set up so that they just have to create the db, which they've already done and I've defined the tables and modified the data and whatnot, so that seems good. Not sure about mod-python v. mod-wsgi. Ah, the Django thing

Re: building a web interface

2010-11-20 Thread Shel
Thanks for your help. I know that they have Python and mySQL. They have mySQL set up so that they just have to create the db, which they've already done and I've defined the tables and modified the data and whatnot, so that seems good. Not sure about mod-python v. mod-wsgi. Ah, the Django thing

Re: Inserting class namespace into method scope

2010-11-20 Thread Ben Finney
Steven D'Aprano writes: > I have a bunch of related functions and objects which are private to a > module, with a single public function that acts as the API to those > functions. I'd like to have these private functions in a namespace, > separate from the rest of the module. Ignore the fact that

Re: building a web interface

2010-11-20 Thread Shel
X-No-Archive:Thanks for your advice. Will take a look at rickadamsadventure.org. Although I am not actually creating an adventure game, I'm sure it will be helpful. Sorry I wasn't clear about the db part. Most of the data has already been written and/or generated and tested with the code. I do

CGI FieldStorage instances?

2010-11-20 Thread Gnarlodious
I'm having a hard time understanding this, can someone explain? Running a CGI with query string: ?action=Find&page=Data Script includes these lines: form=cgi.FieldStorage(keep_blank_values=1) print("Content-type:text/html\n\n") print(cgi.print_form(form)) Output: Form Contents: action: Mini

Re: Inserting class namespace into method scope

2010-11-20 Thread Steven D'Aprano
On Sun, 21 Nov 2010 08:59:30 +1100, Ben Finney wrote: > C'mon, Steven, you know the drill. If you want us to help you solve a > problem, don't start with “I want to use this behaviour that seems > loony, and I won't say why”. Instead, help us by telling us what problem > you're trying to solve. W

Re: building a web interface

2010-11-20 Thread Stef Mientki
On 20-11-2010 23:40, Shel wrote: > Hello, > > I am pretty new to all this. I have some coding experience, and am > currently most comfortable with Python. I also have database design > experience with MS Access, and have just created my first mySQL db. > > So right now I have a mySQL db structure

Re: building a web interface

2010-11-20 Thread Martin Gregorie
On Sat, 20 Nov 2010 14:40:16 -0800, Shel wrote: > Hello, > > I am pretty new to all this. I have some coding experience, and am > currently most comfortable with Python. I also have database design > experience with MS Access, and have just created my first mySQL db. > > So right now I have a m

Installed modules from Synaptic in Ubuntu problem

2010-11-20 Thread goldtech
Hi, Using Ubuntu linux 9.04 and have python 2.6. I'm trying to add a module from the synaptic installer. It's µTidylib a wrapper for HTML Tidy. It installed with out a problem, when I do a $ help ('modules') I see a module called "tidy". But when I do an import tidy in a script I get an error...

Persistent Database Cursors

2010-11-20 Thread Navkirat Singh
Hi Guys, I am having trouble with database cursors. I am using py-postgresql cursors to fetch data over HTTP. I want to be able to refer to the cursor over multiple HTTP requests. Any light on this matter would be of great help. Regards, Nav -- http://mail.python.org/mailman/listinfo/python-li

Re: dict diff

2010-11-20 Thread geremy condra
On Sat, Nov 20, 2010 at 4:00 AM, Steven D'Aprano wrote: > On Sat, 20 Nov 2010 01:11:53 -0500, Steve Holden wrote: > >> On 11/19/2010 8:58 PM, Jin Yi wrote: >>> so i came up with a diff method to compare 2 dicts. > [...] >> A PEP *and* some explanation of why you would want such an obscure piece >>

Re: Installing pysqlite on Win64

2010-11-20 Thread Philip Semanchuk
On Nov 20, 2010, at 12:37 PM, Navid Parvini wrote: > Dear All, > > I want to install pysqlite on my Windows 64 bit machine. I have python 2.4.3 > on it. > Would you please let me know how can I do it? > > That is, I need to use the source file (i.e pysqlite-2.5.6.tar.gz) or there > is an exec

building a web interface

2010-11-20 Thread Shel
Hello, I am pretty new to all this. I have some coding experience, and am currently most comfortable with Python. I also have database design experience with MS Access, and have just created my first mySQL db. So right now I have a mySQL db structure and some Python code. My end goal is to creat

Where's the bug? (cPickle/thread edition) (was Re: How to optimize and monitor garbage collection?)

2010-11-20 Thread Aahz
In article , Steve Holden wrote: > >[aside: in general, if you think your program is not working because of >a bug in Python, look harder at your program]. Good advice, I certainly agree with you. But sometimes it's not so simple. Right now, my company is running up against a problem with Cher

Re: Inserting class namespace into method scope

2010-11-20 Thread Ben Finney
Steven D'Aprano writes: > I also understand that the usual way of getting this would be to > return self.x or self.__class__.x from method, instead of x. Again, > normally I would do this. > > But in this specific case I have reasons for wanting to avoid both of > the normal behaviours. Do not ju

Re: Does Pygoogle allows for advanced search options?

2010-11-20 Thread Chris Rebert
On Thu, Nov 18, 2010 at 3:26 AM, neocortex wrote: >> The library doesn't seem to have built-in support for filtering by >> language (and Google lacks a search query-string-based operator for >> that), but it looks like you could implement that feature by adding an >> "lr" parameter with an appropr

Re: dict diff

2010-11-20 Thread Jin Yi
right. i moved to a 2-value tuple return value basically to illustrate exactly where each dict is providing a different value. it turns out to be much easier to grok than the 3-value one since it's all there and lines up correctly with the inputs... On Sat, Nov 20, 2010 at 12:00:16PM +, S

Re: Is Unladen Swallow dead?

2010-11-20 Thread Stefan Behnel
Mark Wooding, 19.11.2010 02:35: John Nagle writes: This has been pointed out many times by many people. There's even a PhD thesis on the topic. Without a few restrictions, so that a compiler can at least tell when support for the hard cases is needed, Python cannot be compiled well. Th

Re: Python-list Digest, Vol 86, Issue 176

2010-11-20 Thread Petar Milin
Thanks so much! However, 'options lang:de' does not exactly the same as would 'lr=lang_de'? Am I right? Since I need number of hits, I would like to have the best, most correct values! :-) Sincerely, PM On Sat, Nov 20, 2010 at 12:00 PM, wrote: > Send Python-list mailing list submissions to >  

Printing from Web Page

2010-11-20 Thread Victor Subervi
Hi; I need to be able to print something from a Web page: not the entire page but what I specify. I am writing the page and the client is surfing to it. How do I do this? TIA, beno -- http://mail.python.org/mailman/listinfo/python-list

Installing pysqlite on Win64

2010-11-20 Thread Navid Parvini
Dear All, I want to install pysqlite on my Windows 64 bit machine. I have python 2.4.3 on it. Would you please let me know how can I do it? That is, I need to use the source file (i.e pysqlite-2.5.6.tar.gz) or there is an executable file to install. Thank you in advance. Regards, Navid

Re: another newbie question

2010-11-20 Thread Slie
I really enjoyed it when I put the MacOsx font on my Ubuntu or any other. Anssi Saari wrote: >Roy Smith writes: > >> I'm still searching for as nice a font to use on Linux. > >Envy Code R is a lookalike, so maybe worth considering. I haven't >tried actual Monaco on Linux, but apparently it's

Re: Inserting class namespace into method scope

2010-11-20 Thread Emile van Sebille
On 11/20/2010 6:59 AM Steven D'Aprano said... I find myself having need of a class where the class scope is included in the scope of methods in the class. A simple example from Python 3.1: x = "outside" class Magic: x = "inside" def method(self): return x I would like Magic

Re: Weibull distr. random number generation

2010-11-20 Thread Mark Dickinson
On Nov 19, 3:21 pm, Dimos wrote: > I would like to use the random module, and if I understand well the Random > class, to create  1300 decimal numbers in python, by providing the 2 Weibull > parameters (b,c). How this can be done??? > > import random > print random > random.weibullvariate(b,c) >

Re: Inserting class namespace into method scope

2010-11-20 Thread Günther Dietrich
Steven D'Aprano wrote: >I find myself having need of a class where the class scope is included in >the scope of methods in the class. A simple example from Python 3.1: > >x = "outside" > >class Magic: >x = "inside" >def method(self): >return x > > >I would like Magic().method() t

Re: Inserting class namespace into method scope

2010-11-20 Thread Duncan Booth
Steven D'Aprano wrote: > But in this specific case I have reasons for wanting to avoid both of > the normal behaviours. Do not judge me, please accept that I have a > good reason for wanting this, or at least allow me to shoot myself in > the foot this way *wink*. In Python 3, is there some way t

Weibull distr. random number generation

2010-11-20 Thread Dimos
Dear Python list subscribers, Sorry of this has been covered already...This is a newbie question about actual scripting/syntax. I would like to use the random module, and if I understand well the Random class, to create 1300 decimal numbers in python, by providing the 2 Weibull parameters (b,

RE: try to use unicode

2010-11-20 Thread Mikael B
From: mba...@live.se To: python-list@python.org Subject: RE: try to use unicode Date: Sat, 20 Nov 2010 08:49:59 +0100 Date: Sat, 20 Nov 2010 08:47:18 +0100 From: stefan.sonnenb...@pythonmeister.com To: mba...@live.se CC: python-list@python.org Subject: Re: try to use unicode

Inserting class namespace into method scope

2010-11-20 Thread Steven D'Aprano
I find myself having need of a class where the class scope is included in the scope of methods in the class. A simple example from Python 3.1: x = "outside" class Magic: x = "inside" def method(self): return x I would like Magic().method() to return "inside" rather than "outsid

R U READY TO DATE WITH HOT COMMITED COUPLES....

2010-11-20 Thread d...@couples
R U READY TO DATE WITH HOT COMMITED COUPLES JUST FOLLOW THE LINK... WE R WAITING http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc http://adultfriendfinder.com/go/g1271112-ppc -- http://mail.python.

Re: constructin trees in python

2010-11-20 Thread Maxim Mercury
On Nov 20, 2:03 pm, Peter Otten <__pete...@web.de> wrote: > Maxim Mercury wrote: > > here is the definintion of htmlelement > > > class HTMLElement: > >     tag=None > >     attrs={} > >     data='' > >     childs=[] > > > the issue is the though new elements are pushed in the stack (1), > > whenev

Re: what's the precision of fractions.Fraction?

2010-11-20 Thread Peter Otten
Hrvoje Niksic wrote: > Mark Dickinson writes: > >> On Nov 19, 3:29 pm, RJB wrote: >>> Does Fractions remove common factors the way it should? >>> >>> If it does and you want to find the closest fraction with a smaller >>> denominator i think tou'll need some number theory and continued >>> frac

Re: Module locale throws exception: unsupported locale setting

2010-11-20 Thread Sibylle Koczian
Am 19.11.2010 21:27, schrieb Ned Deily: There have been a lot of changes going into Python 3.2, currently in alpha testing, in the areas of encodings and how they affect the interfaces to/from the various platform operating systems Python 3 runs on. It would be very useful if you could try the

Re: dict diff

2010-11-20 Thread Steven D'Aprano
On Sat, 20 Nov 2010 01:11:53 -0500, Steve Holden wrote: > On 11/19/2010 8:58 PM, Jin Yi wrote: >> so i came up with a diff method to compare 2 dicts. [...] > A PEP *and* some explanation of why you would want such an obscure piece > of code built in to the dict object, yes. You've never wanted t

Re: what's the precision of fractions.Fraction?

2010-11-20 Thread Hrvoje Niksic
Mark Dickinson writes: > On Nov 19, 3:29 pm, RJB wrote: >> Does Fractions remove common factors the way it should? >> >> If it does and you want to find the closest fraction with a smaller >> denominator i think tou'll need some number theory and continued >> fractions. > > Or perhaps just use t

Re: another newbie question

2010-11-20 Thread Anssi Saari
Roy Smith writes: > I'm still searching for as nice a font to use on Linux. Envy Code R is a lookalike, so maybe worth considering. I haven't tried actual Monaco on Linux, but apparently it's possible. Personally, I use -lfp-gamow-medium-r-*-*-7-*-*-*-*-*-*-* in Linux (Emacs). -- http://mail.py

Re: Is it possible to use Google's advanced search options?

2010-11-20 Thread Stefan Sonnenberg-Carstens
Am 20.11.2010 10:37, schrieb Petar Milin: Hello! Can anyone help me with getting number of hits from Google, but with restricton on domain (e.g., .edu) and language (e.g., lang_de)? I have tried with the Pygoogle (from: http://code.google.com/p/pygoogle/

Re: what's the precision of fractions.Fraction?

2010-11-20 Thread Mark Dickinson
On Nov 19, 3:29 pm, RJB wrote: > Does Fractions remove common factors the way it should? > > If it does and you want to find the closest fraction with a smaller > denominator i think tou'll need some number theory and continued > fractions. Or perhaps just use the existing Fraction.limit_denomina

Is it possible to use Google's advanced search options?

2010-11-20 Thread Petar Milin
Hello! Can anyone help me with getting number of hits from Google, but with restricton on domain (e.g., .edu) and language (e.g., lang_de)? I have tried with the Pygoogle (from: http://code.google.com/p/pygoogle/

Re: what's the precision of fractions.Fraction?

2010-11-20 Thread Arnaud Delobelle
Peter Pearson writes: > On Fri, 19 Nov 2010 07:29:59 -0800 (PST), RJB wrote: >> Does Fractions remove common factors the way it should? >> >> If it does and you want to find the closest fraction with a smaller >> denominator i think tou'll need some number theory and continued >> fractions. > >

Re: constructin trees in python

2010-11-20 Thread Peter Otten
Maxim Mercury wrote: > here is the definintion of htmlelement > > class HTMLElement: > tag=None > attrs={} > data='' > childs=[] > > the issue is the though new elements are pushed in the stack (1), > whenever i append the child to the stack top all other elements in the > stack

constructin trees in python

2010-11-20 Thread Maxim Mercury
Hi , Iam very much new to python. Iam trying to construct a xml dom tree using the builtin HTMLParser class (on data event callbacks). Iam maintaining the childs as a list of elements and whenver the sax parser encounters a tag i push it to a local stack, my basic logic is below. ** de