import re
splitter_re = re.compile(chr(174) + '|' + chr(175))
for line in file(FILENAME):
parts = splitter_re.split(line)
do_something(parts)
and then go find a large blunt object with which to bludgeon the
creator of the file... :)
p creator= CreatorOfTheFile()
p
I've got timestamps in a file that look like:
[19-Aug-2007 07:38:43+216ms NZST]
How can I parse them? I don't see any way to build a strftime()
format string that can handle the +216ms part. The best I can see is
tearing it all apart with a regex, but I'm trying to avoid that pain
if I can.
Hello,
[19-Aug-2007 07:38:43+216ms NZST]
How can I parse them? I don't see any way to build a strftime()
format string that can handle the +216ms part. The best I can see is
tearing it all apart with a regex, but I'm trying to avoid that pain
if I can.
(PS: I have no clue why google
gnu.gcc.help schrieb:
I've got timestamps in a file that look like:
[19-Aug-2007 07:38:43+216ms NZST]
How can I parse them? I don't see any way to build a strftime()
format string that can handle the +216ms part. The best I can see is
tearing it all apart with a regex, but I'm trying to
Hello Kevin,
Please post the code you're using--it will be easier to help if we can
see exactly what you are trying.
In a nutshell:
---
import Tkinter as tk, tkFont
from tkMessageBox import showinfo, showerror
from os import popen
def main():
root = tk.Tk()
Hello,
Let's say I write a simple extension in c only for the windows version
of my script. Can I just put this compiled dll in the root directory
of my application along with the other py files and distribute it like
that without the need of an installation script?
Yes (current directory is
Carl Banks [EMAIL PROTECTED] writes:
For example:http://www.python.org/dev/peps/pep-3100/
list.sort() and builtin.sorted() methods: eliminate cmp parameter
[27] [done]
Hmm, wasn't aware they were taking it that far. You should almost
always avoid using the cmp parameter because
On Mar 12, 3:38 pm, Reedick, Andrew [EMAIL PROTECTED] wrote:
[...]
Start here
http://www.mail-archive.com/[EMAIL PROTECTED]/msg178356.html
and go through the thread. There are several ways to solve the problem
and we evaluated the performance and 'pythonicity' of each.
I used a kind of
On Mar 12, 10:52 am, Gerhard Häring [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
Downloaded to Knoppix 5.1:
:
aggdraw-1.2a3-20060212.tar.gz
Followed README. Wouldn't compile. [...]
Try shegabittling the frotz first. If that doesn't help, please post the
output of the compile
Hi,
i would liek to define an error routine which print amongs other things
the name of the function from which it has been called.
Having tried
def foo():
print dir()
and all other ideas which came to my (rather python newbie) mind.
Googling too did not show me a possibility.
IOW what
Paul Rubin wrote:
The cmp option should not be removed. However, requiring
it to be specified as a keyword parameter instead of just
passed as an unlabelled arg is fine.
Sure; I would have no problem with that.
But that is not what is happening.
As for Carl's suggestion to use
On Sun, 09 Mar 2008 22:21:59 -0700, natambu wrote:
I have a linux box with multiple ip addresses. I want to make my python
client connect from one of the ip addresses. Here is my code, no matter
what valid information I put in the bind it always comes from the
default ip address on the
Dear python users!
I try to setted up compile-free parallelism using the exec command.
However I had some problems with namespaces which I find mysterious
although I managed to work around. But the workaround is not nice, so
I wonder if there are ways.
I do the following,
bash-3.2$ cat
On Wed, 12 Mar 2008 11:19:05 -0700, Alex wrote:
Hi all,
The subject says pretty much all
Only to people who know what the Perl BEGIN{} block means.
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 11, 11:50 pm, [EMAIL PROTECTED] wrote:
Hey there,
I've had to do the same things for a program that I'm writing. The
following command should do the trick:
os.startfile(yourfilehere)
from the os module. Hope this helps!
That's perfect, thanks a ton++!
--
What do you need it for anyway? I just read about it and I think it's
useless
in python.
On Mar 13, 2008, at 1:03 AM, Steven D'Aprano wrote:
On Wed, 12 Mar 2008 11:19:05 -0700, Alex wrote:
Hi all,
The subject says pretty much all
Only to people who know what the Perl BEGIN{} block
On Thu, 13 Mar 2008 00:16:13 +0100, Hellmut Weber wrote:
Hi,
i would liek to define an error routine which print amongs other things
the name of the function from which it has been called.
You mean like Python exceptions already do?
def broken():
... x = 100 + 'foo'
... return x
I am working in the class constructor defining elements of an application. The
problem is the file is getting unmanageble and I am wanting to extend the
contructor __init__ to another file.
Is it possible to import directly into the contructor the contents of another
module file?
If so how
Daniel Fetchinson wrote:
The photos are just coming straight from my digital camera. Same
format (JPEG), varying size (6-10 megapixel) and I would like to be
able to pick one and then query the database for similar ones. For
example: I pick a photo which is more or less a portrait of someone,
On Mar 12, 5:42 pm, Andrew Rekdal [EMAIL PROTECTED] wrote:
I am working in the class constructor defining elements of an application.
The problem is the file is getting unmanageble and I am wanting to extend the
contructor __init__ to another file.
Is it possible to import directly into the
The photos are just coming straight from my digital camera. Same
format (JPEG), varying size (6-10 megapixel) and I would like to be
able to pick one and then query the database for similar ones. For
example: I pick a photo which is more or less a portrait of someone,
the query should
| Hmm, wasn't aware they were taking it that far. You should almost
| always avoid using the cmp parameter because it's very inefficient;
|
| I don't see what's so inefficient about it necessarily.
The key function is called once per list item, for n calls total. The
comparision function is
Hi, I'd like to store chunks of text, some of them may be very large,
in a database, and have them searchable using 'LIKE %something%'
construct. These pieces of text may have single and double quotes in
them, I tried escaping them using re module and string module and
either I did something
On Wed, 2008-03-12 at 18:18 -0700, [EMAIL PROTECTED] wrote:
These pieces of text may have single and double quotes in
them, I tried escaping them using re module and string module and
either I did something wrong, or they escape either single quotes or
double quotes, not both of these. So that
On Wed, 12 Mar 2008 19:42:44 -0500, Andrew Rekdal wrote:
I am working in the class constructor defining elements of an
application. The problem is the file is getting unmanageble and I am
wanting to extend the contructor __init__ to another file.
Is it possible to import directly into the
On Mar 12, 8:11 pm, Justus Schwabedal [EMAIL PROTECTED]
wrote:
What do you need it for anyway? I just read about it and I think it's
useless
in python.
Perl, like Python, has a separate compilation and run times. One day,
someone who was trying to use Perl for something asked, You know,
On Mar 12, 9:42 pm, Andrew Rekdal [EMAIL PROTECTED] wrote:
I am working in the class constructor defining elements of an application.
The problem is the file is getting unmanageble and I am wanting to extend the
contructor __init__ to another file.
Is it possible to import directly into the
Well, I can see how this could get real messy but within defining a GUI
there are many elements and so the block of elements such as a wx.notebook
for instance I would hope I could place all the code for this in another
file and somehow include it into place. This way I can work on layered
On Mar 12, 6:52 pm, Alan Isaac [EMAIL PROTECTED] wrote:
Paul Rubin wrote:
The cmp option should not be removed. However, requiring
it to be specified as a keyword parameter instead of just
passed as an unlabelled arg is fine.
Sure; I would have no problem with that.
But that is not
Hi Harald and C.L.P.,
Precision.py is part of the Numeric package. AFAIKT, the problem is during
the module initialization. The first lines of Precision.py are:
from multiarray import zeros
import string
typecodes = {'Character':'c', 'Integer':'1sil', 'UnsignedInteger':'bwu',
'Float':'fd',
On Wed, 27 Feb 2008 16:24:02 +0530, bharath venkatesh wrote:
hi ..
how to create macro in python for set of instruction that is done
frequently but too less in number to ignore the overhead of function
call ...
hi ..brnbsp;nbsp;nbsp; how to create macro in python for set of
instruction
Sorry for breaking threading by replying to a reply, but I don't seem to
have the original post.
On Wed, 2008-03-12 at 15:29 -0500, Michael Wieher wrote:
Hey all,
I have these annoying textilfes that are delimited by the ASCII char
for (only its a single character) and (again a single
On Mar 12, 7:37 am, k.i.n.g. [EMAIL PROTECTED] wrote:
We use dd command in Linux to create a file with of required size.
If you just want to get your work done, you might consider the cygwin
dd command.
Learning to write python is a worthwhile endeavour in any case.
--
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
SWIG(http://www.swig.org/)?
Any comment is welcome!
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
hi, everyone there, I am doing a 3D modeling project. I like to do it
with Python( am a newbie), but have no idea with the wxSplitterWindow
to create the 4-view windows( top, front, side, perspective), like the
mfc CSplitterWnd guy),
anyone can give me some help with wxPython?
thanks in advance.
On Wed, Mar 12, 2008 at 9:23 AM, Carl Banks [EMAIL PROTECTED] wrote:
Even though it's typically used for graphical games, PyGame would be a
good way to make a cross-platform text-mode game. It should be
pretty straightforward to simulate a text mode terminal using a grid
of sprites.
Hi,
I have an error occurring at
self.build_root = os.path.abspath(os.path.split(__file__)[0])
The error states 'NameError: global name '__file__' is not defined'
In Python 2.5 I ran my script as a module in IDLE gui. How does _file_ get
defined?
Yours,
David
--
Alex wrote:
The subject says pretty much all, i would very appreciate an answer. I
tried to search the various forums and groups, but didn't find any
specific answer...
I'd like an answer to this, too. In Perl, I mostly used it for
one-liners, when a variable needed to be initialized to
Can anyone explain why socket performance (throughput) varies
depending on the amount of data send and recv are called with?
For example: try creating a local client/server (running on the same
computer) where the server sends the client a fixed amount of data.
Using method A, recv(8192) and
Thanks to all those who replied to this post. I'm gonna try your
suggestions. They are a great help.
--
http://mail.python.org/mailman/listinfo/python-list
This seems to work... split then split each side. then tandem the size.
import wx
class Layout(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
sizer = wx.BoxSizer(wx.HORIZONTAL)
panel = wx.Panel(self,-1)
splitter = wx.SplitterWindow(panel)
I am trying to bring functions to a class by inheritance... for instance in
layout_ext I have..
--- layout_ext.py-
class Layout()
def...some function that rely on css in Layout.py
def...
---EOF--
in the main application file I have...
Layout.py---
from layout_ext import
On Mar 13, 1:37 am, Carl Banks [EMAIL PROTECTED] wrote:
On Mar 12, 8:11 pm, Justus Schwabedal [EMAIL PROTECTED]
wrote:
What do you need it for anyway? I just read about it and I think it's
useless
in python.
Perl, like Python, has a separate compilation and run times. One day,
someone
On Mar 13, 3:15 am, Bo [EMAIL PROTECTED] wrote:
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
SWIG(http://www.swig.org/)?
Any comment is welcome!
Thanks!
There isn't a magic porting tool available.
Hi all,
I am trying to get the following generator to work to these goals:
1. When it recieves an exception (via a throw()) it yeilds the value
of handler.remaining. Otherwise it yeilds None.
2. Send adds data to the generator.
Goal 2 is working great. Goal 1 on the other hand, is not working.
On Mar 13, 12:33 am, Erich [EMAIL PROTECTED] wrote:
Hi all,
I am trying to get the following generator to work to these goals:
1. When it recieves an exception (via a throw()) it yeilds the value
of handler.remaining. Otherwise it yeilds None.
2. Send adds data to the generator.
Goal 2 is
On Mar 13, 8:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Mar 12, 7:37 am, k.i.n.g. [EMAIL PROTECTED] wrote: We use dd command
in Linux to create a file with of required size.
If you just want to get your work done, you might consider the cygwin
dd command.
Learning to write python
Bo wrote:
I want to port a Python project (about 10,000 line python code) to C+
+. Is there any automatically tool to do this kind of things? e.g.,
That's not trivial. Python is very heavily oriented toward run-time
processing, whereas C++ favors compile-time processing.
e.g.,
New submission from thekorn [EMAIL PROTECTED]:
In Firefox 3 the cookies are stored in a sqlite database instead of a
txt-file. It would be nice if cookielib.MozillaCookieJar().load() could
support this.
Markus
--
messages: 63470
nosy: thekorn
severity: normal
status: open
title:
New submission from Mark Summerfield [EMAIL PROTECTED]:
Here is how to reproduce the bug:
from xml.etree.ElementTree import parse
import io
xml1 = ?xml version=1.0 encoding=utf8?
testtext/test
xml2 = ?xml version=1.0 encoding=utf-8?
testtext/test
f1 = io.StringIO(xml1)
f2 = io.StringIO(xml2)
David Harel [EMAIL PROTECTED] added the comment:
Found a problem in my python installation where SSL was unintentionally
disabled.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2272
__
Facundo Batista [EMAIL PROTECTED] added the comment:
Should we close this?
--
nosy: +facundobatista
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2272
__
___
David Harel [EMAIL PROTECTED] added the comment:
Yep. Close it.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2272
__
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Facundo Batista [EMAIL PROTECTED]:
--
resolution: - invalid
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2272
__
___
New submission from David Ripton [EMAIL PROTECTED]:
distutils.sdist.add_defaults adds the Python modules and scripts and C
extensions found in setup.py to the MANIFEST. It does *not* add
data_files mentioned in setup.py to the MANIFEST.
This is non-orthogonal and confusing, because it means
HiroakiKawai [EMAIL PROTECTED] added the comment:
I looked into the problem, and found that current aifc impelementation
assumes that SSND chunk is aligned (in Audio-IFF). But it is not always
true. SSND chunk might not be aligned.
Here I'd like to submit a set of patches for this issue.
I'd
HiroakiKawai [EMAIL PROTECTED] added the comment:
Patch for chunk.py that skip() method may get an optional arguments,
that it will skip in aligned or not.
--
keywords: +patch
Added file: http://bugs.python.org/file9660/chunk.patch
__
Tracker [EMAIL
HiroakiKawai [EMAIL PROTECTED] added the comment:
Issue2259 patches will also fix this issue. :-)
--
nosy: +kawai
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2245
__
Oki Mikito [EMAIL PROTECTED] added the comment:
Hello Kawai,
I see you are attemping to kill two bugs in one stone (or ... whack!) by
eliminating the _skiplist ... Beautiful :-) As we discussed in the Mixi Python
thread, I was going to give those patches a set of runs, but I'm completely
HiroakiKawai [EMAIL PROTECTED] added the comment:
Can I ask someone to review the patch files, and to merge into the code
base if those patches are ok?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2259
__
HiroakiKawai [EMAIL PROTECTED] added the comment:
Patch for aifc.py that will use chunk.skip(True) in SSND chunk.
Added file: http://bugs.python.org/file9661/aifc.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2259
New submission from David Binger [EMAIL PROTECTED]:
This is with the current revision of py3k: 61353.
parser.suite('\u1234') fails with a TypeError.
Changing the argument format from s to s# works around this problem.
I added a unit test for this. After fixing the s#, another
bug is exposed
Changes by Tarek Ziadé [EMAIL PROTECTED]:
Added file: http://bugs.python.org/file9663/distutils.2008.03.12.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1858
__
___
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Do you guys see any merit in changing the argument order for ifilter so
that the predicate function can just be an optional argument:
ifilter(data[, pred])
Alex Martelli successfully lobbied for groupby() to have that same
argument
Guido van Rossum [EMAIL PROTECTED] added the comment:
It would break the symmetry with map().
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2186
__
___
Python-bugs-list mailing
Jean Brouwers [EMAIL PROTECTED] added the comment:
Attached is yet another, final update of the enhancements to the hotshot
profiler. It includes modifications of all 3 files, Modules/_hotshot.c,
Lib/hotshot/log.py and Lib/hotshot/stats.py.
Added file:
New submission from Jean Brouwers [EMAIL PROTECTED]:
Attached is a modified version of the cPython profiler file
Modules/_lsprof.c using a high-resolution timer where available.
The enhancement has been tested on 32- and 64-bit Linux (x86 and x86_64)
and on 32-bit MacOS X Tiger (Intel) and
Jean Brouwers [EMAIL PROTECTED] added the comment:
This enhancement applies to Python 2.5.2 only.
--
components: +None
versions: +Python 2.5
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2281
__
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Okay, thanks. Though, I should have also mentioned symmetries with
sorted(), min(), and max() which all take the iterable first and follow
with an optional key function.
Closing this one. The map(None, *args) feature was removed for 3.0.
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Guido, what do you think about this one?
It is easy to do and has been requested several times in various forums.
The seeming reasonable basis for the request is that sort and bisect
should fit together like a nut and bolt -- it is somewhat
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
It may be too late to express my opinion, but why symmetry with map is
so important? There are several reasons why sequence, predicate order
is natural for filter and function, sequence is a natural order for map.
1. In list
Guido van Rossum [EMAIL PROTECTED] added the comment:
Sorry, I will claim ignorance on this one. I don't recall the last time
I've used a bisection, but it was probably around the time bisect.py was
first added to the standard library. I do recall using heap sort as a
way to compute the top N
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Moved filter to builtins in r61536.
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2187
__
___
Python-bugs-list mailing
Raymond Hettinger [EMAIL PROTECTED] added the comment:
Moved map to builtins in r61357.
--
resolution: - fixed
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2187
__
New submission from zhen [EMAIL PROTECTED]:
The seekable() method of TextIOWrapper always returns False, for it
does't override the seekable method of IOBase class in which just
returns False. But, there is a method named _seekable(self) in
TextIOWrapper(in io.py line 1211):
def
101 - 175 of 175 matches
Mail list logo