Hi,
I'm quite new to regular expressions, and I wonder if anyone here
could help me out.
I'm looking to split strings that ideally look like this: Update: New
item (Household) into a group.
This expression works ok: '^(Update:)?(.*)(\(.*\))$' - it returns
(Update, New item, (Household))
Some
Thanks all!
--
http://mail.python.org/mailman/listinfo/python-list
I did some testing, and calculating the hash value of a 1Gb file does
take some time using this method.
Would it be wise to calculate the hash value based on say for instance
the first Mb? Is there a much larger chance of collusion this way (I
suppose not). If it's helpful, the files would
On Aug 7, 2:22 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
LaundroMat [EMAIL PROTECTED] writes:
Would it be wise to calculate the hash value based on say for instance
the first Mb? Is there a much larger chance of collusion this way (I
suppose not). If it's helpful, the files would
Hi -
I'm trying to calculate unique hash values for binary files,
independent of their location and filename, and I was wondering
whether I'm going in the right direction.
Basically, the hash values are calculated thusly:
f = open('binaryfile.bin')
import hashlib
h = hashlib.sha1()
Hi -
I'm working on a Django powered site where one of the required
functionalities is the possibility of displaying the content of
external pages, with an extra banner at the top where specific
information is displayed. In other words, I'm looking for a way to
reproduce an existing web page and
On Apr 8, 2:04 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
LaundroMat wrote:
Hi -
I'm working on a Django powered site where one of the required
functionalities is the possibility of displaying the content of
external pages, with an extra banner at the top where specific
information
On Apr 8, 4:11 pm, Steve Holden [EMAIL PROTECTED] wrote:
LaundroMat wrote:
On Apr 8, 2:04 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
LaundroMat wrote:
Hi -
I'm working on a Django powered site where one of the required
functionalities is the possibility of displaying the content
On Nov 24, 5:42 pm, jeff [EMAIL PROTECTED] wrote:
[snip]
and what do you mean by 'id3reader' cant do directories?
my for loop just does each file in the dirextory
It's just a friendly warning that you shouldn't suppose that all that
is scanned are indeed files, and not directories.
--
Heh, a description of the error would be nice indeed.
Just a preliminary warning: with this code you will also be parsing
directories. id3reader can't handle those ofcourse.
Better add a check such as eg:
if os.path.isfile(os.path.join(directory, file)):
# do your thing
laundro
--
Hi,
Has anyone succeeded in compiling the vlc-python bindings on Windows?
(as discussed in the vlc development wiki).
I have found several compiled bindings, but none were updated for
Python 2.4 (or 2.5 for that matter). As I am a complete layman for
everything that is C compilation on any
Hi,
I've found this script over at effbot
(http://effbot.org/librarybook/os-path.htm), and I can't get my head
around its inner workings. Here's the script:
import os
class DirectoryWalker:
# a forward iterator that traverses a directory tree
def __init__(self, directory):
Ack, I get it now. It's not the variable's name (index) that is
hard-coded, it's just that the for...in... loop sends an argument by
default. That's a lot more comforting.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks all, those were some great explanations. It seems I have still
still a long way for me to go before I grasp the intricacies of this
language.
That 'magic index' variable bugs me a little however. It gives me the
same feeling as when I see hard-coded variables. I suppose the
generator class
On Oct 31, 3:53 pm, Fredrik Lundh [EMAIL PROTECTED] wrote:
LaundroMat wrote:
That 'magic index' variable bugs me a little however. It gives me the
same feeling as when I see hard-coded variables.what magic index? the
variable named index is an argument to the
method it's used in.
Yes, I
Rob De Almeida wrote:
LaundroMat wrote:
Suppose I have this function:
def f(var=1):
return var*2
What value do I have to pass to f() if I want it to evaluate var to 1?
I know that f() will return 2, but what if I absolutely want to pass a
value to f()? None doesn't seem to work
Antoon Pardon wrote:
The problem is like the following.
def f(var=1):
return var*2
def g():
arg = None
try:
arg = Try_Processing() / 3 + 1
except Nothing_To_Process:
pass
if arg is None:
return f()
else:
return f(arg)
Now in this case you could start
Suppose I have this function:
def f(var=1):
return var*2
What value do I have to pass to f() if I want it to evaluate var to 1?
I know that f() will return 2, but what if I absolutely want to pass a
value to f()? None doesn't seem to work..
Thanks in advance.
--
18 matches
Mail list logo