Chris Stiles wrote:
> Is there a library available for python that will enable me to process .wav
> files ?
>
> Preferably extensible so I can write handlers for dealing with the non audio
> sections.
Kåre Sjölander's Snack library might be useful:
http://www.speech.kth.se/snack/
--
h
Christos TZOTZIOY Georgiou wrote:
> You're messing with the time machine again, right?
no, it was a subversion pilot error, this time. but now that you remind me,
I have to say that this
http://mail.python.org/pipermail/python-list/2005-February/030720.html
is a bit scary. I wonder from w
Evan Simpson wrote:
> In Python 2.4 the following works:
>
> >>> class G(dict):
> ... def __getitem__(self, k):
> ... return 'K' + k
> ...
> >>> g = G()
> >>> exec 'print x, y, z' in g
> Kx Ky Kz
> >>>
>
> ...while in Python 2.3 it fails with NameError: name 'x' is not defined. Is
> this an
[EMAIL PROTECTED] wrote:
> Hypothetical performance improvements are the root of all evil.
> -- Bill Tutt (paraphrased)
well, after this week, I'd say that
Hypothetical performance limitations are the root of all evil.
--
http://mail.python.org/mailman/listinfo/python-list
"flamesrock" <[EMAIL PROTECTED]> wrote:
> The statement (1 > None) is false (or any other value above 0). Why is
> this?
http://docs.python.org/ref/comparisons.html
"The operators <, >, ==, >=, <=, and != compare the values of
two objects. The objects need not have the same type. If both
Steven Bethard wrote:
> So None being smaller than anything (except itself) is hard-coded into
> Python's compare routine.
> My suspicion is that even if/when objects of different types are no longer
> comparable by default
> (as has been suggested for Python 3.0), None will still compare as s
Francis Girard wrote:
> Wow ! What is it that are compared ? I think it's the references (i.e. the
> adresses) that are compared. The "None" reference may map to the physical 0x0
> adress whereas 100 is internally interpreted as an object for which the
> reference (i.e. address) exists and therefo
Laszlo Zsolt Nagy wrote:
> Now I installed Python 2.3.4 and wxPython 2.5.3 (with unicode support). I'm
> getting this
> exception:
>
> exceptions.UnicodeDecodeError:'ascii' codec can't decode byte 0x91 in
> position 0: ordinal not in
> range(128)
>From where?
Can you include a "print repr()"
Antoon Pardon wrote:
> This behaviour would remain but additionally we would have the
> following.
>
"st1:st2:st3:st4:st5".split(':',-2)
> ["st1:st2:st3" , "st4" , "st5"]
>
> What do people think here?
>>> "st1:st2:st3:st4:st5".rsplit(':', 2)
['st1:st2:st3', 'st4', 'st5']
--
http://ma
Nick Coghlan wrote:
>> I'm sorry, but this isn't really good enough. If Open Source wants to
>> say that they are better than these proprietary companies, they need
>> to deal with these sorts of things more professionally and establish
>> decent channels of communications for dealing with it.
>
>
Duncan Booth wrote:
> I think part of the problem you are having is that Python doesn't make any
> representations about security, so it is pretty hard to come up with issues
> which really are security related. Products which are based on Python (e.g.
> Zope) and which do aim to provide some kind
Duncan Booth wrote:
> I think its a bit borderline whether this really was a security bug in
> Python rather than just a problem with the way some people used Python. It
> was a standard library which if used in the wrong way opens a security hole
> on your machine
for SmartCookie, that should be
Aggelos I. Orfanakos wrote:
> Under Gentoo Linux, I issue:
>
> $ python timeit.py
> python: can't open file 'timeit.py'
> $ ls -al /usr/lib/python2.3/timeit.py
> -rw-r--r-- 1 root root 9833 Oct 19 02:17 /usr/lib/python2.3/timeit.py
>
> But if I specify the full path, it works:
>
> $ python /usr/l
Franco Fiorese wrote:
> I am relatively new about Python benchmarks.
> After some experiments I found that Python on my PC Windows XP has a relevant
> higher performance
> than on Linux. The simple test using pystone.py shows this:
>
> * Windows XP Pro: 16566.7 pystones/second
> * Linux (kern
Raymond Hettinger wrote:
>> I'm trying to emulate the sorted() method introduced in python 2.4. The
>> only difference is that it takes a sequence as one of its arguments
>> rather than being a method of the sequence class. Does my method do the
>> same as the sorted()?
>
> Almost. This is closer
[EMAIL PROTECTED] wrote:
> The recent "Pystone Benchmark" message says that Python is only 75% as
> fast on Linux as on Windows.
no, it really only says that the Pystone benchmark is 75% as fast as Linux as on
Windows, on the poster's hardware, using his configuration, and using different
compile
<[EMAIL PROTECTED]> wrote:
> I'm pretty new to Python, to programming overall...so how would I make
> something where the user inputs multiple words in a string - like
> "connect 123.123.123.123 21 user password" or similar, and then I can
> split this string up to pass these arguments to a functi
Baoqiu Cui wrote:
> The error returned is this:
>
> $ python bug.py
> Exception exceptions.AttributeError: "'NoneType' object has no
> attribute 'population'" in <__main__.Person instance at 0xa0c9fec>> ignored
>
> However, if I rename variable name 'peter' to something like 'peter1'
> or 'david'
"Bryan" wrote
> the above is not the same. make the a = ... raise an exception and you'll see
> the difference.
>
> s = ... #
> a = 1/0
> s.close()
>
> as you can see, s.close() will never be called. also, in this example, i
> intentionally didn't put
> the extra try/except around the try/fina
Olivier Noblanc wrote:
> In the botom of this post you will see my source code.
>
> The problem is when i launch main.py that doesn't make anything why ?
the "if __name__" statement checks the name of the module. if you run
Python file as a script, by passing a filename to the python interpreter
Michael Tobis wrote:
> Also, the assertion that "Python has no declarations whatsoever" is no
> longer obviously true. In the 2.4 decorator syntax, a decorator line is
> not executable
that's a nice theory, but since the decorator line is executed by the inter-
preter, it's a little weak.
-
Olivier Noblanc wrote:
> how to move in function ?
how to put code in a function? the same way you put code in a method.
change
if __name__ == "__main__":
app = wx.PySimpleApp(0)
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, -1, "")
app.SetTopWindow(frame_1)
frame_1.Sho
Michael Tobis wrote:
>> that's a nice theory, but since the decorator line is executed by the
>> interpreter, it's a little weak.
>
> Well, uh, who else would process it?
the compiler.
from __future__ is a declaration. @expression is an executable statement.
--
http://mail.python.org/mai
[EMAIL PROTECTED] wrote:
> Is there a way to make a relocateable python binary... that is... a
> python installation that won't care where it is on the machine... and
> won't care if it gets put somewhere else besides / ?
the standard CPython interpreter is 100% "relocatable". If you think
it i
Steve Holden wrote:
>>>Is there a way to make a relocateable python binary... that is... a
>>>python installation that won't care where it is on the machine... and
>>>won't care if it gets put somewhere else besides / ?
>>
>>
>> the standard CPython interpreter is 100% "relocatable". If you thin
Skip Montanaro wrote:
>Matt> Spike Asset Manager (SAM) is an open-source cross-platform
>Matt> framework written in python for probing a system for components
>Matt> and reporting them.
>
> That's a pretty generic description. Pardon my ignorance, but what's the
> advantage over, for
Michael Tobis wrote:
> This is definitely a wart:
>
> ... z = 42.3
> ...
> ... def f():
> ...if False:
> ... global z
> ...z = -666
> ...
> ... f()
> ... print z
no, it's a declaration. from the documentation:
http://docs.python.org/ref/global.html
"The global statement i
Tim Daneliuk wrote:
>>>However, I intend to actually have two separate keys invoke this menu
>>>to have it behave differently in different circumstances.
>>
>> You can, of course, CHANGE the underlined character to match the
>> circumstances.
>
> Yeah, I understand that ... what I want is two char
Dave Opstad wrote:
> This would certainly be simpler, although I'm not sure I'm as clear as
> to what happens if, say, in the middle of this loop a PyInt_FromLong
> fails. I know that PyTuple_SetItem steals the reference; does that mean
> I could just Py_DECREF the tuple and all the pieces will be
"cedric paille" wrote:
> I'm making python's modules to extend my application's functions with a built
> in script editor.
> At now all works very well, but i'd like to know if i'm not forgetting some
> references inc/dec
>
> Here is a portion of my code:
>
> static PyObject *
> Scene_GetNod
F. Petitjean wrote:
> sre_compile and sre_parse should be coded with a __all__ attribute
they're implementation modules, and shouldn't be used by user code.
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
>> you should check the return value, though. PyList_SetItem may (in
>> theory) fail.
>
> :-)
> Only a bot could say that. We mere mortals have been known to do things
> like (a) pass a non-list as the first argument (b) pass an out-of-range
> value for the second argument.
ev
Dave Cole wrote:
> for (i = 0; i < num_values; i++) {
> PyObject *obj;
>
> obj = PyInt_FromLong(value[i]);
> if (obj == NULL
> || PyTuple_SetItem(tuple, i, obj) != 0) {
> Py_DECREF(tuple);
> return NULL;
> }
> }
in theory, if PyInt_FromLong succeeds, and PyTuple_SetIte
[EMAIL PROTECTED] wrote:
> tes tmsg
if you meant to send this to a test group, it didn't work. complain to
your provider.
--
http://mail.python.org/mailman/listinfo/python-list
Michael wrote:
> I'm trying to import text from email I've received, run some regular
> expressions on it, and save
> the text into a database. I'm trying to figure out how to handle the issue of
> character sets. I've
> had some problems with my regular expressions on email that has interesti
Erik Johnson wrote:
>As an aside, I notice a lot of other people's interpreters actually
> print 'True' or 'False' where my system prints 0 or 1. Is that a
> configuration that can easily set somewhere?
$ python2.1 -c "print 1 == 1"
1
$ python2.2 -c "print 1 == 1"
1
$ python2.3 -c "print 1
Frank Abel Cancio Bello wrote:
> If I make some improvement to xmlrpclib module, where I should send this
> improvement to form part of next standard library release?
http://sourceforge.net/tracker/?group_id=5470&atid=305470
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Bickett wrote:
> [2] I'm currently unaware if _winreg is a c extension module or pure
> python, but I'm assuming it's C, so I don't know how possible it is to
> add pure python to it...
from the documentation:
This module exposes a very low-level interface to the Windows registry;
Markus Wankus wrote:
> Google his name - he has been banned from Netbeans and Eclipse (and
> Hibernate, and others...) for
> good reason. Can you imagine how much of a Troll you need to be to
> *actually* get "banned" from
> the newsgroups of open source projects such as those?
have Pythonee
Steve Holden wrote:
>> in theory, if PyInt_FromLong succeeds, and PyTuple_SetItem fails, you'll leak
>> an object.
>
> And in practice this will only happen during a period when you are relying
> critically on it *not*
> to ...
yeah, but if PyTuple_SetItem fails in this case, you better move th
Tim Daneliuk wrote:
> THis is why, IMHO, things like SOAP a laughable - RPC is a poor
> foundation for reliable, durable, and high-performance TP. It might be
> fine for sending an order or invoice now and then, but sustained through-
> put of the sort I think of as "high" performance is likely n
<[EMAIL PROTECTED]> wrote:
> For example I have a string : "Halo by by by"
> Then I want to take and know the possition of every "by"
> how can I do it in python?
>
> I tried to use:
>
> p = re.compile(r"by")
> m = p.search("Helo by by by")
> print m.group() # result "by"
> print m.span() # r
"rbt" <[EMAIL PROTECTED]> wrote:
>> You are modifying the list as you iterate over it. Instead, iterate over a
>> copy by using:
>>
>> for ip in ips[:]:
>> ...
>>
>> regards
>> Steve
>
> Very neat. That's a trick that everyone should know about.
I suppose that's why it's included in the Pytho
Steven Bethard wrote:
>> return max(lst)
>
> Very clever! Thanks!
too clever. boolean > None isn't guaranteed by the language specification:
http://docs.python.org/ref/comparisons.html
"... objects of different types always compare unequal, and are ordered
consistently
but arbitr
Alex Martelli wrote:
> Can anybody suggest where to find (within the standard library) or how
> to easily make (e.g. in a C extension) a type without a __mro__, except
> for those (such as types.InstanceType) which are explicitly recorded in
> the dispatch table copy._deepcopy_dispatch...?
someth
Jan Dries wrote:
>> have Pythoneers ever "banned" anyone from a public forum? it's not like
>> we haven't seen trolls and crackpots before, you know.
>
> Well, we don't have to ban them because we have the PSU eliminate them
> alltogether. So much more
> efficient. Or do you think it's a coinci
Richard Lewis wrote:
> OK, I'm still not getting this unicode business.
obviously.
>
> aàáâã
> eèéêë
> iìíîï
> oòóôõ
> oùúûü
>
>
> (If testing, make sure you save this as utf-8 encoded.)
why? that XML snippet doesn't include any UTF-8-encoded characters.
:::
>file =
"Anna M." <[EMAIL PROTECTED]> wrote:
> I am trying to write a red-black tree implementation in python. I am very
> new to python and appologize if my question is terribly stubid. But I ran
> into some trouble. I have a class and in it there are functions but when I
> try to run the code I have
Richard Lewis wrote:
> On Mon, 20 Jun 2005 14:27:17 +0200, "Fredrik Lundh"
> <[EMAIL PROTECTED]> said:
> >
> > well, you're messing it up all by yourself. getting rid of all the
> > codecs and
> > unicode2charrefs nonsense will fix this:
"praba kar" wrote:
> In Php the following headers base we can clean
> the cache in the url "header('Cache-Control:
> no-store, no-cache, must-revalidate'); "
> I want to know Php equivalent headers in Python-cgi
> If anybody know regarding this kindly mail me.
did you try
print 'Cache
Remi Villatel wrote:
> There is always a "nice" way to do things in Python but this time I can't
> find one.
>
> What I'm trying to achieve is a conditionnal loop of which the condition
> test would be done at the end so the loop is executed at least once. It's
> some way the opposite of "while".
Remi Villatel wrote:
> >>while True:
> >> some(code)
> >> if final_condition is True:
> >> break
> >> #
> >>#
>
> > checking if a logical expression is true by comparing it to True is bad
> > style, and comparing values using "is" is also bad style.
>
> Erm... You totally missed the point. I wrote
Chinook wrote:
> When I create the code objects though, it seems a couple different ways
> work and I'm wondering which is better and why (or is there a more correct
> technique in this situation)?
from where are you getting the source code for those code objects?
from the example below, it sure
Fredrik Lundh wrote:
> character references refer to code points in the Unicode code
> space, so you just convert the bytes you get after converting
> to UTF-8.
"so you cannot just", of course.
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> There are no unitialized variables in python; if you try to access an
> undefined name, a NameError exception is raised:
>
> try:
> print "foo is", foo
> except NameError:
> print "foo is undefined"
note the order of evaluation:
>>> try:
... print "foo
Alan Gauld wrote:
> In Python Hungarian notation is meaningless since variables
> aren't typed anyway.
in real-life Python code, variables tend to be 'typed' in the hungarian
sense:
http://msdn.microsoft.com/library/en-us/dnvs600/html/hunganotat.asp
"/.../ the concept of 'type' in this cont
Brian van den Broek wrote:
> So, it would appear that compression requires a 3rd party module, not
> included in Python (and not present on my Windows box).
where did you get your Windows Python? afaik, the zlib module has been
included in all major Python binary distributions since 1.5.2 or so.
Jorge Louis de Castro wrote:
> I have indeed tried the msvcrt module but none of the examples given works
> as described on a XP+SP2 box.
what examples? how did you run the examples?
(the keyboard interface functions in msvcrt only work if the program's attached
to
a Windows console. if you r
Joxean Koret wrote:
> I'm having troubles to make my XMLRPC application working with non
> ASCII characters.
you cannot just pass in 8-bit strings in arbitrary encodings and expect the XML-
RPC layer to automagically figure out what you're doing.
you can either use the encoding option to the Ser
Harlin Seritt wrote:
> I am trying to find some matches and have them put into a list when
> processing is done. I'll use a simple example like email addresses.
>
> My input is the following:
> wordList = ['myname1', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]',
> '[EMAIL PROTECTED]', '[EMAIL PROTECTE
Paolino wrote:
> This confuses me also, looks like empty lists share same object.
nope. see Matt Hammonds reply for the full story.
--
http://mail.python.org/mailman/listinfo/python-list
Christopher Subich wrote:
> I don't think the python regular expression module correctly handles
> combining marks; it gives inconsistent results between equivalent forms
> of some regular expressions:
> Is this a limitation-by-design, or a bug?
limitation by design. if you want correct results
Ben Finney wrote:
> news:comp.lang.python> is a URL to a Usenet newsgroup, as
> evidenced by the 'news:' schema part. If your web browser is
> configured properly to invoke a newsreader (such as Thunderbird) for
> 'news:' URLs, your newsrreader will then attempt to get the
> comp.lang.newsgroup fr
"sinan ." <[EMAIL PROTECTED]> wrote:
> hi i`m developing a program that reads the serial device. i like the
> readline() function, but readline() depends on \n character, i want a
> similar function that waits for a specific character or string that i
> gave like [ETX] (hex03) how can i do this ?
"niko" <[EMAIL PROTECTED]> wrote:
> while using gadfly, got an error that i don't understand.
> Code is as follow :
> cursor = connection.cursor()
> cursor.execute('select id_m from mots where nom_m = "%s"' % nom_m)
> id_m = cursor.fetchall()
>
> Error message :
> File "C:\Python24\Lib\site-pack
Jon Bowlas wrote:
> attobject = context.get_attobject()
> navstring = context.get_uclattribute(attobject, 'ucl_navhide')
> hiddennavelements = navstring.split(' ')
> for hiddennavelement in hiddennavelements:
>return hiddennavelement
>
> So the script 'get_attobject' basically looks for an ins
Damir Hakimov wrote:
> I found a strange bug in base64.encode and decode, when I try to encode
> - decode a file 1728512 bytes lenth.
does this work on your machine?
>>> import base64
>>> x = base64.encodestring(1728512 * "*")
>>> len(base64.decodestring(x))
1728512
does it work also if you cha
Jon Bowlas wrote:
> Ok so I changed it to this:
>
> attobject = context.get_attobject()
> navstring = context.get_uclattribute(attobject, 'ucl_navhide')
> hiddennavelements = navstring.split(' ')
> for hiddennavelement in hiddennavelements:
>yield hiddennavelements
>
> But I get the following
[EMAIL PROTECTED] wrote:
> def parse_for_products(filename):
>
>for event, elem in iterparse(filename):
>if elem.tag == "Products":
>root = ElementTree(elem)
>print_all(root)
>else:
>elem.clear()
>
> My problem is that if i pass the 'elem' fo
Mike Rose wrote:
> I am currently using ArcGIS 9.1 and was referred to this list to ask my
> question. I am using a python script to loop through a series of
> features, select all polygons that are within 5 miles, run statistics on
> those selected polygons, then append the values to a new datab
Alessandro Bottoni wrote:
> (Python has even been told to be used by Yahoo! and Google, among others,
> but nobody was able to demonstrate this, so far)
hint:
http://mail.google.com/support/bin/answer.py?answer=6554
--
http://mail.python.org/mailman/listinfo/python-list
"max(01)*" <[EMAIL PROTECTED]> wrote:
> i would like to do some uri-decoding, which means to translate patterns
> like "%2b/dhg-%3b %7E" into "+/dhg-; ~"
>>> import urllib
>>> urllib.unquote("%2b/dhg-%3b %7E")
'+/dhg-; ~'
--
http://mail.python.org/mailman/listinfo/python-list
Jim Washington wrote:
> 4. List comprehensions might be troublesome, though it's not clear to me
> how a DoS or exploit is possible with these.
see item 1.
> Or is eval() simply too evil?
yes.
however, running a tokenizer over the source string and rejecting any string
that contains unknown t
Russell E. Owen wrote:
>>>The current issue is associated with Tkinter. I'm trying to create a tk
>>>callback function that calls a python "function" (any python callable
>>>entity).
>>>
>>>To do that, I have to create a name for tk that is unique to my python
>>>"function". A hash-like name would
"dcrespo" wrote:
> ...If the answer is Yes, can you give me an example either in the
> server side and the client side?
>
> I googled a lot, but I can't find nothing regarding this.
the XML-RPC specification
http://www.xmlrpc.com/spec
mentions the following data types
four-byte signed i
Peter Hansen wrote:
> from path import path
> path('myfile').touch()
import os
os.utime('myfile', None)
is a bit shorter, of course.
>>> help(os.utime)
Help on built-in function utime:
utime(...)
utime(path, (atime, utime))
utime(path, None)
Set the access and modified time of the
Donnal Walter wrote:
>I would like to be able to write something like:
>
> import dcw as dw
> import xyz as dw
>
> such that the 'dw' namespace includes definitions from both dcw and xyz,
> but in the script above names from dcw1 are lost. How can I combine the
> two? (I'd rather not use 'import *'
"Joe T." wrote:
> 2. I know there's a Jpython but what use would I get from using Python
> with
> Java? If I'm already familiar with Java programming why would I want to
> use
> Python with Java?
see, e.g.
http://www.onjava.com/pub/a/onjava/2002/03/27/jython.html
http://www.javaworld
Peter Hansen wrote:
> And, depending on your needs, quite ineffective:
>
> >>> import os
> >>> os.utime('missing.file', None)
> Traceback (most recent call last):
> File "", line 1, in ?
> OSError: [Errno 2] No such file or directory: 'missing.file'
>
> >>> from path import path
> >>> path('miss
"dcrespo" wrote:
> I'm sorry, I didn't the right question... Of course that I can break
> the file and rewrite it on an xmlrpc protocol for transmition, or send
> a byte each time through the socket lib. I meant is there a program
> already developed that sends and receives files based on xmlrpc c
Peter Hansen wrote:
> You've quoted selectively. He also said "Unix-style 'touch'", from
> which one could quite legitimately infer
nope. read his post again.
--
http://mail.python.org/mailman/listinfo/python-list
Michele Petrazzo wrote:
> I want to redistribute the library that I create.
> I create a project, its setup.py that when launched copy all files into
> the "site-packages/library" directory. And here it's all ok.
> When I call my library with:
>
> import library
> library.class()
>
> I want that my
<[EMAIL PROTECTED]> wrote:
>I have the following code:
>
> A.py
>
>
> from B import B
> B.py
>
>
> from A import R
> I think python does not support this kind of 'mutual inclusion'. Am I
> right? Thanks. Cesar.
this page
http://effbot.org/zone/import-confusion.htm
might help you
Steve Holden wrote:
> If you want a fast language, try Holden. I've just invented it.
> Unfortunately it gets the answer to every problem wrong unless the
> answer is 42, but boy it runs quickly. The code for the whole
> interpreter (it's written in Python) follows:
>
> print 42
>
> Why are you lo
Konrad Mühler wrote:
> a simple question but i found no solution:
>
> How can i convert a float value into a string value?
>
>
> string_value1 = string(float_value) + ' abc'
str(float_value) + 'abc'
repr(float_value) + "abc"
'%fabc' % float_value
'%gabc' % float_value
(etc)
the tutorial has
"jau" <[EMAIL PROTECTED]> wrote:
> print "hello world"
>
> i get this output
>
> hello world
> sys:1: DeprecationWarning: Non-ASCII character '\xf3' in file
> C:\Workspace\J&J\src\es\jau\main.py on line 2, but no encoding declared;
> see http://www.python.org/peps/pep-0263.html for details
>
> the
[EMAIL PROTECTED] wrote:
> The API reference isn't clear on whether parseString can only handle
> discrete bits of valid XML
the documentation says that "parse" expects an XML document,
and that "parseString" is the same thing, but parses from a buffer.
it's probably easier to pass a BZ2File ins
Peter A.Schott wrote:
> Been reading the docs saying that file should replace open in our code,
> but this
> doesn't seem to work:
what docs?
"open" is the preferred way to open a file. "file" is a type constructor.
in contemporary python, they happen to map to the same callable, but
that's no
Russell E. Owen wrote:
> Having looked at it again, it is familiar. I copied it when I wrote my
> own code. I avoided using at the time both because the initial
> underscore suggested it was a private method and because it introduces
> an extra function call.
>
> _register has the same weakness th
"Nx" <[EMAIL PROTECTED]> wrote:
> I am unpacking a list into variables, for some reason they need to be
> unpacked into variable names like a0,a1,a2upto aN whatever is
> in the list.
why?
--
http://mail.python.org/mailman/listinfo/python-list
"Yoav" wrote:
>I am trying the following:
>
> re.search(r'\\[^"\\]+(?=("?$))', "c:\ret_files")
>
> and I get a return of NoneType, and I have no idea why. I know that I
> missing something here, but I really can't figure out why
instead of struggling with weird REs, why not use Python's standard
f
Wouter van Ooijen wrote:
>I have a tool in Python to which I want to add a small GUI. The tools
> currently runs everywhere PySerial is supported. I need a file-access
> dialog. What is the preffered way to to this? Is there a
> platform-independent file-access dialog available, or should I use th
Robert Kern wrote:
> You might find that the more Pythonic XML modules are better suited to
> handling mixed content. I've been using lxml and ElementTree quite
> successfully.
fwiw, here's an ET snippet that inserts an anchor element inside
a paragraph element:
# from lxml.etree import * # or
#
"billiejoex" wrote_
> Than you James. I'll take a look as soon as possible.
> It is possible do the contrary (integrates python source in a C project)?
http://docs.python.org/ext/embedding.html
--
http://mail.python.org/mailman/listinfo/python-list
"Tompa" <[EMAIL PROTECTED]> wrote:
> Yes, I believe so too. Something like this, as suggested by Benjamin:
> sys.stdout.write('Status: 200 OK\r\n')
> sys.stdout.write('Content-type: image/gif\r\n')
> sys.stdout.write('\r\n')
> im.save(sys.stdout, "GIF")
>
> But it does not work for some reason!?
Paul Rubin wrote
>> (1) Can this be done with python? If so, what module do I need to look
>> up?
>
> You could do it with PIL, or run jpegtran in an external process.
> jpegtran may be easier.
eh? are you sure you know what jpegtran does?
JPEGTRAN(1)
JPEGTRAN(1)
NAME
jpegtran - lossl
Mike C. Fletcher wrote:
> The core function looks something like this:
>
> import Image # this is PIL
>
> def getThumbnail( filename, size = (32,32) ):
>'''Get a thumbnail image of filename'''
>image = Image.open(filename)
>rx, ry = image.size[0]/float(size[0]), image.size[1]/float(siz
"jog" wrote:
> I want to get text out of some nodes of a huge xml file (1,5 GB). The
> architecture of the xml file is something like this
> I want to combine the text out of page:title and page:revision:text for
> every single page element. One by one I want to index these combined
> texts (so f
Alan Kennedy wrote:
> SAX is perfect for the job. See code below.
depends on your definition of perfect...
using a 20 MB version of jog's sample, and having replaced
the print statements with local variable assignments, I get the
following timings:
5 lines of cElementTree code: 7.2 seconds
60+
Steve Holden wrote:
> Yes. A large part of learning a language is discovering the many idioms
> that have already been established for doing certain things. These are a
> kind of shorthand, established by long convention, that allow one to
> avoid the "learning-by-use" curve.
it's not obvious tha
801 - 900 of 4900 matches
Mail list logo