Hi,
I am having design problems with date storage/retrieval using Python and
SQLite.
I understand that a SQLite date column stores dates as text in ISO
format (ie. '2010-05-25'). So when I display a British date (eg. on a
web-page) I convert the date using
datetime.datetime.strptime(mydat
On 11/24/2010 5:58 PM, Brendon wrote:
Hi all,
I am trying to convert a dictionary to a unicode string and it fails
with an exception. I am awfully surprised but searching the web has
not turned up anything useful. I understand why the exception ocurrs,
but am not sure why this is the default beh
On 2010-11-24 12:08:04 -0800, Raymond Hettinger said:
I'm writing-up more guidance on how to use super() and would like to
point at some real-world Python examples of cooperative multiple
inheritance.
The SocketServer module
(http://docs.python.org/library/socketserver.html) uses cooperative
HypoNt:
I need to turn a human-readable list into a list():
print re.search(r'(?:(\w+), |and (\w+))+', 'whatever a, bbb, and
c').groups()
That currently returns ('c',). I'm trying to match "any word \w+
followed by a comma, or a final word preceded by and."
The match returns 'a, bbb, and c',
On Nov 25, 11:57 am, shearichard wrote:
> Hi - Anyone know how the score offered by Pypi is derived ?
>
> For instance in ...
>
> http://pypi.python.org/pypi?%3Aaction=search&term=spam&submit=search
>
> ... 'bud.nospam 1.0.1' has a score of 9 but 'pydspam 1.1.9' has a
> score of 7.
If you hover
On Nov 25, 3:54 pm, Ben Finney wrote:
> shearichard writes:
> > Hi - Anyone know how the score offered by Pypi is derived ?
>
> Specifically, the score offered in response to a search query.
>
> > For instance in ...
>
> >http://pypi.python.org/pypi?%3Aaction=search&term=spam&submit=search
>
> >
shearichard writes:
> Hi - Anyone know how the score offered by Pypi is derived ?
Specifically, the score offered in response to a search query.
> For instance in ...
>
> http://pypi.python.org/pypi?%3Aaction=search&term=spam&submit=search
>
> ... 'bud.nospam 1.0.1' has a score of 9 but 'pydspa
Hi - Anyone know how the score offered by Pypi is derived ?
For instance in ...
http://pypi.python.org/pypi?%3Aaction=search&term=spam&submit=search
... 'bud.nospam 1.0.1' has a score of 9 but 'pydspam 1.1.9' has a
score of 7.
Where are those numbers from and what do they mean ?
Thanks
R.
On Nov 25, 7:43 am, Paul Rubin wrote:
> Gerald Britton writes:
> > if v:
> > f()
>
> > I might, however, think more in a functional-programming direction.
> > Then I might write:
>
> > v and f()
>
> Python has conditional expressions. The above would be:
>
> f() if v else Non
On Wed, 24 Nov 2010 12:08:04 -0800 (PST)
Raymond Hettinger wrote:
> I'm writing-up more guidance on how to use super() and would like to
> point at some real-world Python examples of cooperative multiple
> inheritance.
>
> Google searches take me to old papers for C++ and Eiffel, but that
> don't
Can anyone please suggest me what will be the good way to use matlab
equivalent of "profile clear, profile on, profile off, profile resume
and profile viewer" in Python?
Thanks in advance.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I am trying to convert a dictionary to a unicode string and it fails
with an exception. I am awfully surprised but searching the web has
not turned up anything useful. I understand why the exception ocurrs,
but am not sure why this is the default behaviour of python and if
there is anythin
On 11/24/10 12:30 PM, Robert Kern wrote:
On 11/24/10 12:07 PM, Daniel Fetchinson wrote:
The whole story is that I have a matrix A and matrix B both of which
have rational entries and they both have pretty crazy entries too.
Their magnitude spans many orders of magnitude, but inverse(A)*B is an
Burton Samograd writes:
> Terry Reedy writes:
>
>> On 11/23/2010 3:02 PM, Chris Rebert wrote:
>> If you are using print or print(), you can redirect output to the
>> StringIO object with >>sfile or file=sfile. I use the latter in a
>> custom test function where I normally want output to the scre
>> So after all I might just code the inversion via Gauss elimination
>> myself in a way that can deal with fractions, shouldn't be that hard.
>
> I wouldn't do it that way. Let M be your matrix. Work out the LCM l of
> the denominators, and multiply the matrix by that to make it an integer
> mat
Hi,
I've been trying to install PyQt on Windows XP Pro so that I can try
out eric ide. I used the binary windows installer for PyQt. I can
run eric as administrator, but not with my ordinary user account. By
running eric.bat with the --debug flag, I found that he crux of the
problem is that if
tinn...@isbd.co.uk wrote:
> tinn...@isbd.co.uk wrote:
> [snip]
>
> > Using 'help' reveals basic information for evolution but reports "no
> > documentation " for evolution.ebook. On the old system (exactly
> > the same version of python, same OS, same everything just about)
> > "help(evolutio
On Nov 24, 8:43 pm, Peter Otten <__pete...@web.de> wrote:
> John Yeung wrote:
> > I'm generally pleased with difflib.SequenceMatcher: It's probably not
> > the best available string matcher out there, but it's in the standard
> > library and I've seen worse in the wild. One thing that kind of
> >
tinn...@isbd.co.uk wrote:
[snip]
> Using 'help' reveals basic information for evolution but reports "no
> documentation " for evolution.ebook. On the old system (exactly
> the same version of python, same OS, same everything just about)
> "help(evolution.ebook)" shows the expected documentati
I'm trying to compile Python from source and get the same error on
RedHat and Mac OS X. I did not pass any options to configure. The
error occurs immediately.
Redhat:~/Downloads/Python-2.7$ make
gcc -pthread -c -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -
Wall -Wstrict-prototypes -I. -II
On Nov 24, 1:10 pm, Raffael Cavallaro
wrote:
> On 2010-11-23 11:34:14 -0500, Keith H Duggar said:
>
> > You don't understand the implications of your own words:
>
> > "having a financial interest in the outcome of a debate makes
> > anything that person says an advertisement for his financia
All,
When I configure python to enable shared libraries, none of the extensions
are getting built during the make step due to this error.
building 'cStringIO' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -I. -I/u01/home/apli/wm/GDD/Python-2.
Gerald Britton writes:
> if v:
> f()
>
> I might, however, think more in a functional-programming direction.
> Then I might write:
>
> v and f()
Python has conditional expressions. The above would be:
f() if v else None
using "and" is bug-prone.
--
http://mail.python.org/m
Gerald Britton writes:
> Writing in Python gives me the luxury of choosing different paradigms
> for similar operations. Lately I've been thinking about a minor
> detail that peaked my interest and am curious what others think:
>
> Say that I have some function "f" that I will execute if some va
Daniel Fetchinson writes:
> So after all I might just code the inversion via Gauss elimination
> myself in a way that can deal with fractions, shouldn't be that hard.
I wouldn't do it that way. Let M be your matrix. Work out the LCM l of
the denominators, and multiply the matrix by that to mak
I'm writing-up more guidance on how to use super() and would like to
point at some real-world Python examples of cooperative multiple
inheritance.
Google searches take me to old papers for C++ and Eiffel, but that
don't seem to be relevant to most Python programmers (i.e. a
WalkingMenu example whe
Both paradigms are in the bash shell. Using a test switch (like -x for
executiable) mixed with an && or ||.
Example:
[-x /usr/bin/firefox ] || exit
I think it's very clear, to old hands, but not so much for a new or
intermediate users.
It certainly is the 'cleaner' form. Like the C styl
On Nov 24, 2010, at 1:46 PM, Gerald Britton wrote:
> Say that I have some function "f" that I will execute if some variable
> "v" evaluates true. Using a classical procedural approach, I might
> write:
>
>if v:
>f()
>
> I might, however, think more in a functional-programming direct
On Nov 24, 11:46 am, Gerald Britton wrote:
> Say that I have some function "f" that I will execute if some variable
> "v" evaluates true. Using a classical procedural approach, I might
> write:
>
> if v:
> f()
>
> I might, however, think more in a functional-programming direction.
> T
Writing in Python gives me the luxury of choosing different paradigms
for similar operations. Lately I've been thinking about a minor
detail that peaked my interest and am curious what others think:
Say that I have some function "f" that I will execute if some variable
"v" evaluates true. Using
On 11/24/10 12:07 PM, Daniel Fetchinson wrote:
The whole story is that I have a matrix A and matrix B both of which
have rational entries and they both have pretty crazy entries too.
Their magnitude spans many orders of magnitude, but inverse(A)*B is an
okay matrix and I can deal with it using f
Terry Reedy writes:
> On 11/23/2010 3:02 PM, Chris Rebert wrote:
> If you are using print or print(), you can redirect output to the
> StringIO object with >>sfile or file=sfile. I use the latter in a
> custom test function where I normally want output to the screen but
> occasionally want to cap
I have just moved my desktop system (running xubuntu 10.04) to new
hardware. I have an almost trivial python program that uses the
evolution module which no longer works and I'm having trouble working
out why.
The program is:-
#!/usr/bin/python
#
#
#
#
import evolution
Apologies if this is a bit off the wall but I've only just started getting
into unit testing (in Python) this morning. Would generators help you in any
way? You might be able to have a generator which would yield an attribute
set combination each time it is called.
I'm not sure if it would still st
On 2010-11-23 11:34:14 -0500, Keith H Duggar said:
You don't understand the implications of your own words:
"having a financial interest in the outcome of a debate makes
anything that person says an advertisement for his financial
interests, not a fair assessment."
is substantially di
>> It's a mathematical problem so no uncertainty is present in the
>> initial values. And even if there was, if there are many orders of
>> magnitude differences between the entries in the matrix floating point
>> does not suffice for various things like eigenvalue calculation and
>> stuff like tha
>> I'm using fractions.Fraction as entries in a matrix because I need to
>> have very high precision and fractions.Fraction provides infinite
>> precision . . .
>>
>> Probably it doesn't matter but the matrix has all components non-zero
>> and is about a thousand by thousand in size.
>
> I wonder h
I guess this is a question to folks with some numpy background (but
not necessarily).
I'm using fractions.Fraction as entries in a matrix because I need to
have very high precision and fractions.Fraction provides infinite
precision (as I've learned from advice from thi
On 11/24/10 9:10 AM, Daniel Fetchinson wrote:
It's a mathematical problem so no uncertainty is present in the
initial values. And even if there was, if there are many orders of
magnitude differences between the entries in the matrix floating point
does not suffice for various things like eigenva
On Wed, 24 Nov 2010 14:02:21 +0100, Daniel Fetchinson wrote:
[snip]
> I'm using fractions.Fraction as entries in a matrix because I need to
> have very high precision and fractions.Fraction provides infinite
> precision . . .
[snip]
>
> Probably it doesn't matter but the matrix has all components n
Thanks for the reply Ian,
I've looked in to the bin-packing problem in a general sense now, and I
think my ugly algorithm is actually not too bad (although not too
efficient either!) :)
It was only for a quick job any how.
Thanks again. Tom.
On 24/11/10 16:16, Ian Kelly wrote:
On Wed, No
Daniel Fetchinson wrote:
>>> I guess this is a question to folks with some numpy background (but
>>> not necessarily).
>>>
>>> I'm using fractions.Fraction as entries in a matrix because I need to
>>> have very high precision and fractions.Fraction provides infinite
>>> precision (as I've learned
On Wed, Nov 24, 2010 at 8:34 AM, Tom Boland wrote:
> I'm trying to find a _nice_ way of taking a list of integers, and splitting
> them in to lists where the sum of the values does not exceed a threshold.
>
> for instance:
>
> l = [1, 2, 3, 4, 5, 6]
> n = 6
>
> nl = [1,2,3], [4], [5], [6]
>
>
> I
On 11/24/10 9:12 AM, Johannes Korn wrote:
Hi,
I would like to produce a scatter plot with roughly 200 mio points.
Because the points are so numerous I rather need a point density plot.
I use numpy. Right now I loop over the individual data points and make a
where query on a meshgrid.
ind = whe
I'm trying to find a _nice_ way of taking a list of integers, and
splitting them in to lists where the sum of the values does not exceed a
threshold.
for instance:
l = [1, 2, 3, 4, 5, 6]
n = 6
nl = [1,2,3], [4], [5], [6]
I don't mind if it's done like playing blackjack/pontoon (the card gam
Hi,
I would like to produce a scatter plot with roughly 200 mio points.
Because the points are so numerous I rather need a point density plot.
I use numpy. Right now I loop over the individual data points and make a
where query on a meshgrid.
ind = where((x_grid == x_points[i]) & (y_grid == y_po
>> I guess this is a question to folks with some numpy background (but
>> not necessarily).
>>
>> I'm using fractions.Fraction as entries in a matrix because I need to
>> have very high precision and fractions.Fraction provides infinite
>> precision (as I've learned from advice from this list).
>
>
On Nov 24, 2:45 pm, Peter Otten <__pete...@web.de> wrote:
> huisky wrote:
> > I see the problem of year. But the question is the source file does
> > NOT provide the year information.
> > for instance if i have one record as ['Dec','6','21:01:17'], and the
> > other as ['Jan','6','21:01:17']
> > th
On 11/24/2010 3:59 AM, xlizzard wrote:
HI,
I am a newer to python(my version is 3.1.2),recently I got a IDE named
Eric(http://eric-ide.python-projects.org/index.html) to study
and on this main page I downloaded a tutorial named "**minibrowser".
http://eric-ide.python-projects.org/tutorials/MiniBr
2010/11/24 xlizzard :
> HI,
> I am a newer to python(my version is 3.1.2),recently I got a IDE named
> Eric(http://eric-ide.python-projects.org/index.html) to study
> and on this main page I downloaded a tutorial named "minibrowser".
> http://eric-ide.python-projects.org/tutorials/MiniBrowser/index
Adrian Casey writes:
> I have a PyQt4 multi-threaded application which accesses many hosts
> concurrently via ssh. I would like each thread to have access to a
> database so that it can look up details about the particular system it
> is connected to.
>
> The easy way is to have each thread crea
On Nov 23, 7:22 pm, Ian Kelly wrote:
> Try Django[1] or TurboGears[2].
>
> [1]http://www.djangoproject.com/
> [2]http://www.turbogears.org/
Thanks, never understood what those programs were for.
-- Gnarlie
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Fetchinson wrote:
> I guess this is a question to folks with some numpy background (but
> not necessarily).
>
> I'm using fractions.Fraction as entries in a matrix because I need to
> have very high precision and fractions.Fraction provides infinite
> precision (as I've learned from advice
Short update on what I've settled for generating test functions for various
input data:
# test case with common test function
class MyTest(unittest.TestCase):
def _test_invert_flags(self, input, flags, expected):
res = do_invert(input, flags)
self.assertEqual(res, expected)
#
huisky wrote:
> I see the problem of year. But the question is the source file does
> NOT provide the year information.
> for instance if i have one record as ['Dec','6','21:01:17'], and the
> other as ['Jan','6','21:01:17']
> these two records may be in different year. Will it be a problem to
> u
On Nov 24, 2:09 pm, Peter Otten <__pete...@web.de> wrote:
> huisky wrote:
> > As a newbie, I posted my question here again.
> > say i have two dics read from a text file by 'split'.
>
> Please don't start a new thread when you are still asking about the same
> topic.
>
> cstart
>
> > defaultdi
huisky wrote:
> As a newbie, I posted my question here again.
> say i have two dics read from a text file by 'split'.
Please don't start a new thread when you are still asking about the same
topic.
cstart
>
> defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
> ['Dec', '7', '09:31:00'],
On Nov 24, 7:45 am, huisky wrote:
> Hi,
>
> As a newbie, I posted my question here again.
> say i have two dics read from a text file by 'split'.
>
> >>> cstart
>
> defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
> ['Dec', '7', '09:31:00'], 15500: ['Dec', '6', '20:17:02'], 18863:
> ['Dec', '7
I guess this is a question to folks with some numpy background (but
not necessarily).
I'm using fractions.Fraction as entries in a matrix because I need to
have very high precision and fractions.Fraction provides infinite
precision (as I've learned from advice from this list). Now I need to
calcul
Hi,
As a newbie, I posted my question here again.
say i have two dics read from a text file by 'split'.
>>> cstart
defaultdict(, {15424: ['Dec', '6', '18:57:40'], 552:
['Dec', '7', '09:31:00'], 15500: ['Dec', '6', '20:17:02'], 18863:
['Dec', '7', '13:14:47'], 18291: ['Dec', '6', '21:01:17'], 189
Garland Fulton, 24.11.2010 06:55:
Is there a way I can define an Array of and unknown size so I can add and
remove to or from it?
Are arrays immutable?
Python has lists and tuples as basic data structures. Tuples are completely
immutable, lists are completely mutable. If you want a container
John Yeung wrote:
> I'm generally pleased with difflib.SequenceMatcher: It's probably not
> the best available string matcher out there, but it's in the standard
> library and I've seen worse in the wild. One thing that kind of
> bothers me is that it's sensitive to which argument you pick as "s
On Tue, Nov 2, 2010 at 12:57 PM, Terry Reedy wrote:
> On 11/2/2010 6:11 AM, Hrvoje Niksic wrote:
>
> 1.1 .hex()
>
'0x1.1999ap+0'
>>
>> Here it is immediately obvious that the final digit of the infinite
>> sequence "1.1999..." is rounded from 9 to a. Printing the number with
>>
On Mittwoch 24 November 2010, John Yeung wrote:
> Are there any
> simple adjustments that can be made without sacrificing (too
> much) performance?
>>> difflib.SequenceMatcher(None,*sorted(('BYRD','BRADY'))).ratio()
0.3
--
Wolfgang
--
http://mail.python.org/mailman/listinfo/pyt
I have a PyQt4 multi-threaded application which accesses many hosts
concurrently via ssh. I would like each thread to have access to a
database so that it can look up details about the particular system it
is connected to.
The easy way is to have each thread create a connection to the database.
65 matches
Mail list logo