Dun Peal, 17.10.2010 21:59:
`all_ascii(L)` is a function that accepts a list of strings L, and
returns True if all of those strings contain only ASCII chars, False
otherwise.
What's the fastest way to implement `all_ascii(L)`?
My ideas so far are:
1. Match against a regexp with a character ran
On Sun, 2010-10-17 at 14:59 -0500, Dun Peal wrote:
> `all_ascii(L)` is a function that accepts a list of strings L, and
> returns True if all of those strings contain only ASCII chars, False
> otherwise.
>
> What's the fastest way to implement `all_ascii(L)`?
>
> My ideas so far are:
>
> 1. Matc
dulce is a syntactic "sweet" wrapper for managing collections of
Python objects like relational tables. No schema definition is used;
instead table columns are introspected from the attributes of objects
inserted into the table, and inferred from index and query
parameters. dulce's Tables can be:
On Mon, 18 Oct 2010 01:04:09 +0100, Rhodri James wrote:
> On Sun, 17 Oct 2010 20:59:22 +0100, Dun Peal
> wrote:
>
>> `all_ascii(L)` is a function that accepts a list of strings L, and
>> returns True if all of those strings contain only ASCII chars, False
>> otherwise.
>>
>> What's the fastest w
On 10/17/10 19:04, Rhodri James wrote:
import string
return set("".join(L))<= set(string.printable)
I've no idea whether this is faster or slower than any of your
suggestions.
For set("".join(L)) to return, it has to scan the entire input
list/string. Imagine
s = UNPRINTABLE_CHAR
On Oct 17, 12:59 pm, Dun Peal wrote:
> `all_ascii(L)` is a function that accepts a list of strings L, and
> returns True if all of those strings contain only ASCII chars, False
> otherwise.
>
> What's the fastest way to implement `all_ascii(L)`?
>
> My ideas so far are:
>
> 1. Match against a rege
On Sun, 17 Oct 2010 20:59:22 +0100, Dun Peal wrote:
`all_ascii(L)` is a function that accepts a list of strings L, and
returns True if all of those strings contain only ASCII chars, False
otherwise.
What's the fastest way to implement `all_ascii(L)`?
My ideas so far are:
1. Match against a r
On 2010-10-17, Dun Peal wrote:
> What's the fastest way to implement `all_ascii(L)`?
Start by defining it.
> 1. Match against a regexp with a character range: `[ -~]`
What about tabs and newlines? For that matter, what about DEL and
BEL? Seems to me that the entire 0-127 range are "ASCII char
On 16 Okt, 16:49, Peter Otten <__pete...@web.de> wrote:
> Lucasm wrote:
> > I have a decorator problem and hope someone is able to help me out/
> > assist me. Thanks in advance.
>
> > Suppose:
> > ### Begin some_library_module ###
>
> > def some_decorator(some_method):
> > def inner(an_arg, *ar
Yingjie Lan wrote:
So, I assume that when the 'def' is executed, any
name occurred will be categorized as either local
or global (maybe nonlocal?).
Actually it happens earlier than that -- the bytecode
compiler does the categorization, and generates different
bytecodes for accessing these thr
On 2:59 PM, tinn...@isbd.co.uk wrote:
I'm writing some code that writes to a mbox file and want to retry
locking the mbox file a few times before giving up. I can't see a
really tidy way to implement this.
Currently I have something like:-
dest = mailbox.mbox(mbName, factory=None)
Am 17.10.2010 19:51, schrieb TomF:
On 2010-10-17 10:21:36 -0700, Paul Kölle said:
Am 17.10.2010 13:48, schrieb Steven D'Aprano:
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote:
Hi,
I played with an example related to namespaces/scoping. The result is a
little confusing:
[snip example
`all_ascii(L)` is a function that accepts a list of strings L, and
returns True if all of those strings contain only ASCII chars, False
otherwise.
What's the fastest way to implement `all_ascii(L)`?
My ideas so far are:
1. Match against a regexp with a character range: `[ -~]`
2. Use s.decode('a
On Sun, Oct 17, 2010 at 3:04 PM, Nikola Skoric wrote:
> When I execute
> n...@rilmir:~/code/simplepyged/docs/examples$ python latex.py
> I get expected output (bunch of latex markup).
>
> But, when I add a redirection, I get:
> n...@rilmir:~/code/simplepyged/docs/examples$ python latex.py > foo.te
On Oct 17, 11:37 am, John Henry wrote:
> On Oct 17, 4:45 am, Tim Golden wrote:
>
>
>
> > On 17/10/2010 6:39 AM, John Henry wrote:
>
> > > On Oct 12, 10:31 am, Tim Golden wrote:
> > >> On 12/10/2010 4:59 PM, John Henry wrote:
>
> > >>> According to:
>
> > >>>http://support.microsoft.com/kb/813745
When I execute
n...@rilmir:~/code/simplepyged/docs/examples$ python latex.py
I get expected output (bunch of latex markup).
But, when I add a redirection, I get:
n...@rilmir:~/code/simplepyged/docs/examples$ python latex.py > foo.tex
File "latex.py", line 87, in
print mytemplate.render_uni
Matteo Landi wrote:
> On Sun, Oct 17, 2010 at 6:58 PM, wrote:
> > I'm writing some code that writes to a mbox file and want to retry
> > locking the mbox file a few times before giving up. I can't see a
> > really tidy way to implement this.
> >
> > Currently I have something like:-
> >
> >
On Oct 17, 4:45 am, Tim Golden wrote:
> On 17/10/2010 6:39 AM, John Henry wrote:
>
>
>
> > On Oct 12, 10:31 am, Tim Golden wrote:
> >> On 12/10/2010 4:59 PM, John Henry wrote:
>
> >>> According to:
>
> >>>http://support.microsoft.com/kb/813745
>
> >>> I need to reset my Outlook registry keys. Un
TZMud is a Python MUD server.
http://tzmud.googlecode.com/
A MUD is a text-based virtual environment
accessed via telnet, or with a specialised
MUD client.
TZMud development is still in early stages,
focusing on API and server stability.
TZMud uses several high-quality Python
libraries to facil
In article <4imro7-ds6@chris.zbmc.eu>, wrote:
>I'm writing some code that writes to a mbox file and want to retry
>locking the mbox file a few times before giving up. ...
>dest = mailbox.mbox(mbName, factory=None)
>for tries in xrange(3):
>try:
>dest.lock()
>
On 2010-10-17 10:21:36 -0700, Paul Kölle said:
Am 17.10.2010 13:48, schrieb Steven D'Aprano:
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote:
Hi,
I played with an example related to namespaces/scoping. The result is a
little confusing:
[snip example of UnboundLocalError]
Python's sco
Am 17.10.2010 13:48, schrieb Steven D'Aprano:
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote:
Hi,
I played with an example related to namespaces/scoping. The result is a
little confusing:
[snip example of UnboundLocalError]
Python's scoping rules are such that if you assign to a vari
You can use the 'else' keyword outside the for loop:
for :
if :
break
else
The execution will step inside the else branch if the for loop ends
normally, i.e. without encountering a break keyword.
Hope it helps.
Regards,
Matteo
On Sun, Oct 17, 2010 at 6:58 PM, wrote:
> I'm writing som
I am pleased to announce the first public release of stats for Python.
http://pypi.python.org/pypi/stats
stats is a pure-Python module providing basic statistics functions
similar to those found on scientific calculators. It currently includes:
Univariate statistics including:
* arithmetic, har
I'm writing some code that writes to a mbox file and want to retry
locking the mbox file a few times before giving up. I can't see a
really tidy way to implement this.
Currently I have something like:-
dest = mailbox.mbox(mbName, factory=None)
for tries in xrange(3):
try:
Hi,
I do have an ActivePython 2.7 installation (Win. XP) and some programm
that has to read and write to a Berkeley DB.
I read that starting from python version 2.6(?) pybsddb was deprecated. I
dont understand the reason and I am looking to make this run.
I found some pybsddb 4.8.4, but could n
PyGUI 2.3 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This version works on Snow Leopard with PyObjC 2.3.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.
--
Gregory Ewing
greg.ew...@can
On 10 Oct, 10:44, Lie Ryan wrote:
> On 10/02/10 20:04, NickKeighleywrote:
> >>> > > In a statically typed language, the of-the-wrong-type is something
> >>> > > which
> >>> > > can, by definition, be caught at compile time.
>
> >> > Any time something is true "by definition" that is an indicati
--- On Sun, 10/17/10, Steven D'Aprano
wrote:
> (1) If you assign to a variable *anywhere* in the function,
> it is a local
> *everywhere* in the function.
>
> There is no way to have a variable refer to a local in some
> places of a
> function and a global in other places of the same functi
> From: Nobody
> The determination of local or global is made when the "def"
> statement is
> executed, not when the function is called.
Thanks a lot for your reply, which is of great help!
So, I assume that when the 'def' is executed, any
name occurred will be categorized as either local
or
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote:
> Hi,
>
> I played with an example related to namespaces/scoping. The result is a
> little confusing:
[snip example of UnboundLocalError]
Python's scoping rules are such that if you assign to a variable inside a
function, it is treated as
On 17/10/2010 6:39 AM, John Henry wrote:
On Oct 12, 10:31 am, Tim Golden wrote:
On 12/10/2010 4:59 PM, John Henry wrote:
According to:
http://support.microsoft.com/kb/813745
I need to reset my Outlook registry keys. Unfortunately, I don't have
my Office Install CD with me. This would
On Sun, 17 Oct 2010 03:58:21 -0700, Yingjie Lan wrote:
> I played with an example related to namespaces/scoping. The result is a
> little confusing:
a=1
def f():
> a = a + 1
> return a
>
f()
> UnboundLocalError: local variable 'a' referenced before assignment
If you
* Chris Torek:
> In article <87y69xbz6h@mid.deneb.enyo.de>
> Florian Weimer wrote:
>>Are there libraries which implement some form of spreadsheet-style
>>dependency tracking? The idea is to enable incremental updates to
>>some fairly convoluted computation. I hope that a general dependency
Hi,
I played with an example related to namespaces/scoping.
The result is a little confusing:
>>> a=1
>>> def f():
a = a + 1
return a
>>> f()
I suppose I will get 2 ( 'a' is redefined as a local variable, whose value is
obtained by the value of the global variable 'a' plus 1)
On 10/16/2010 11:27 PM, Grant Andrew wrote:
I hear that...God knows if I had a more complete question, I'd type it -
basically, when I click the IDLE GUI icon from the Start Menu, there is a
flash of a command prompt loading, then nothing happens.
I've tried a number of things at the command pr
On 10/16/2010 06:04 PM, Kruptein wrote:
Hey, I've written a small "IDE". It is written in python using the
python toolkit and
offers an advanced text-editor, file-manager, ftp-client, sql-
client(in development) and more towards the future.
You definitely want to have a look at PEP8.
--
http:/
I've got a script that is an executable and it reads template files that
should be packaged with the script. How do I tell the script where to
find the templates?
In distutils, there's a package_data option, but that installs the
templates under the /usr/lib/pythonX.XX/... directory, which se
The urlparse module is load only when this module run as main entry.
Its for test purpose of modules.
2010/10/17, chad :
> On Oct 16, 11:02 am, Felipe Bastos Nunes
> wrote:
>> You edited the source of asyncore.py puttin the print statments and
>> nothing happend? It should work as the method is
39 matches
Mail list logo