the following code works perfectly import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("www.python.org", 80)) s.send("GET") while 1: buf = s.recv(1000) if not buf: break sys.stdout.write(buf) s.close() but the following code does not work
Bengt Richter wrote:
> On Thu, 19 Jan 2006 14:12:24 +0200, Juho Schultz <[EMAIL PROTECTED]> wrote:
>
>>Last month I spent about an hour trying to explain why
>>a*2.5e-8 = x
>>raises a SyntaxError and why it should be written
>>x = a*2.5e-8
>>The guy who wrote the 1st line has MSc in Physics from C
Eric Wong wrote:
> Using Tkinter, I have a Canvas with vertical Scrollbar attached. At
> runtime, I dynamically create Checkboxes on the Canvas, each one on a
> different row. When I add a lot of Checkboxes, instead of the
> scrollbar kicking in, the Canvas resizes and subsequently, my
> Applica
Steven Bethard schrieb:
> Carl Cerecke wrote:
>
>> Python has no goto.
>
>
> Not in the standard library. You have to download the module:
> http://www.entrian.com/goto/
>
> ;)
>
> STeVe
This remerbers me to VATICAL, a famous programming language from the 80s.
http://www.uni-weimar.de/~m
pycraze wrote:
> Surely adopting the above method is much better than what i have
> approached earlier . The main reason i did adopt this exercise was when
> i have to marshal a 20 - 40 MB above test.py file to the disk , the
> simple load of the test.py will sky rocket my virtual memory
> consumpt
archana sambandam wrote:
> the following code works perfectly
> import socket, sys
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> s.connect(("www.python.org", 80))
> s.send("GET")
> while 1:
> buf = s.recv(1000)
> if not buf:
> break
> sys.stdout.write(buf)
Bengt Richter wrote:
> On 19 Jan 2006 01:19:06 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> wrote:
>
> >I want to manipulate a deeply nested list in a generic way at a
> >determined place. Given a sequence of constant objects a1, a2, ..., aN
> >and a variable x. Now construct a list from them recursiv
Brett Hoerner wrote:
> [EMAIL PROTECTED] wrote:
[...]
> "or" returns the first true element, anything but False or None, I
> think... so 'food' (a string) is true, and always will return in that
> code.
Just in case newbies are reading: in Python several different values are
considered false in t
Hi!
I'm trying to use the csv Parser included with Python. Field Delimiter is
"|", Line Delimiter is "#". Unfortunately it doesn't work as expected. The
parser seems to just ignore the 'lineterminator'?
Here's some example:
> $ cat test.py
> #! /usr/bin/env python
>
> import sys, csv, cStringIO
Martha:
Please see
http://www.python.org/Jobs.html
http://www.python.org/Jobs-howto.html
to find out about the Python Jobs Board, which may be (even) more useful
than posting (or looking, for job seekers) on the Python list.
regards
Steve
Marsha Hoyt wrote:
> Hi Python fans,
>
>
>
Robert Kern <[EMAIL PROTECTED]> wrote:
> Installing Pexpect
>
> The pexpect-current.tgz tarball is a standard Python Distutil distribution.
>
> 1. download pexpect-current.tgz
> 2. tar zxf pexpect-current.tgz
> 3. cd pexpect-current
> 4. python setup.py install
If on linux you
Tino Lange wrote:
> I'm trying to use the csv Parser included with Python. Field Delimiter is
> "|", Line Delimiter is "#". Unfortunately it doesn't work as expected. The
> parser seems to just ignore the 'lineterminator'?
The csv reader accepts '\r' '\r\n' or '\n' as line endings, even mixed in
Peter Otten wrote:
> memfile = (s + "\n" for s in "1a|1b|1c|1d#2a|2b|2c|2d#3a|3b|3c
> 3d#".split("#") if s)
I just found out that you need not add "\n" to the line.
Peter
--
http://mail.python.org/mailman/listinfo/python-list
Mathijs wrote:
> Python beginner here and very much enjoying it. I'm looking for a
> pythonic way to find how many listmembers are also present in a
> reference list. Don't count duplicates (eg. if you already found a
> matching member in the ref list, you can't use the ref member
> anymore).
>
Veusz 0.9
-
Velvet Ember Under Sky Zenith
-
http://home.gna.org/veusz/
Veusz is Copyright (C) 2003-2006 Jeremy Sanders <[EMAIL PROTECTED]>
Licenced under the GPL (version 2 or greater)
Veusz is a scientific plotting package written in Python. It uses PyQt
for d
Michael wrote:
> Jan Decaluwe wrote:
>
>
>>I'm pleased to announce the release of MyHDL 0.5.
>>
>>MyHDL is an open-source package for using Python as a hardware
>>description and verification language. Moreover, it can convert
>>a design to Verilog. Thus, MyHDL provides a complete path
>>from Pyt
Frank Millman wrote:
> I have subclassed threading.Thread, and I store a number of attributes
> within the subclass that are local to the thread. It seems to work
> fine, but according to what you say (and according to the Python docs,
> otherwise why would there be a 'Local' class) there must be s
Debashis Dey wrote:
> Hello,
>
> I have a python CGI program. I would like to show a graph within a HTML
> plage. I would like to dynamically generate the graph using the python
> CGI script on the web server side and send it to the browser.
>
> My question is how can I do this in python? Is
Peter Otten wrote:
> Tino Lange wrote:
>
>> I'm trying to use the csv Parser included with Python. Field Delimiter is
>> "|", Line Delimiter is "#". Unfortunately it doesn't work as expected.
>> The parser seems to just ignore the 'lineterminator'?
>
> The csv reader accepts '\r' '\r\n' or '\n'
Steve Holden wrote:
> Debashis Dey wrote:
>> Hello,
>>
>> I have a python CGI program. I would like to show a graph within a HTML
>> plage. I would like to dynamically generate the graph using the python
>> CGI script on the web server side and send it to the browser.
>>
>> My question is how
Hey guys
I've been reading http://www.python.org/peps/pep-0249.html and I don't
quite get what level of thread safety I need for my DB connections.
If I call db = FOOdb::connect() at the start of my app, and then every
thread does it's own c = db.cursor() at the top, what level of thread
safety d
Terry Hancock wrote:
> On 19 Jan 2006 13:57:06 +0100
> Anton Vredegoor <[EMAIL PROTECTED]> wrote:
> > Some time ago I tried to 'sell' Python to a mathematician.
> > The crucial point was that it was not (in standard Python)
> > possible to have a matrix A and a matrix B and then do for
> > example
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Thomas Dickey wrote:
>>>ncurses expects byte strings (although I'm uncertain as to what
>>>impact multi-byte encodings have in ncurses).
>>
>>
>> It depends on whether python's curses binding is linked with the
>> wide-character
>> flavor (ncursesw)
Tino> Is this going to be changed? Is someone working on it? Or are
Tino> patches for SF wanted?
A patch that removes this constraint would be helpful.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Tino Lange wrote:
>>> I'm trying to use the csv Parser included with Python. Field Delimiter
>>> is "|", Line Delimiter is "#". Unfortunately it doesn't work as
>>> expected. The parser seems to just ignore the 'lineterminator'?
>>
>> The csv reader accepts '\r' '\r\n' or '\n' as line endings, ev
Op 2006-01-18, Diez B. Roggisch schreef <[EMAIL PROTECTED]>:
> Giovanni Bajo schrieb:
>> Diez B. Roggisch wrote:
>>
due to the nested parentheses. Note that replacing list comprehensions
with list(...) doesn't introduce any nested parentheses; it basically
just replaces brackets wi
Robin Haswell wrote:
> Hey guys
>
> I've been reading http://www.python.org/peps/pep-0249.html and I don't
> quite get what level of thread safety I need for my DB connections.
>
> If I call db = FOOdb::connect() at the start of my app, and then every
> thread does it's own c = db.cursor() at the
ago wrote:
[Something I mostly agree with]
> According to Anton the number of possible solutions can be reduced
> using 1) number swapping, 2) mirroring, 3) blocks/rows/columns
> swapping. All those operations create equivalent matrices. For a 9X9
> grid, this should give a reduction factor = (9
"Tim Golden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| [EMAIL PROTECTED]
|
|| I've downloaded the hypertext module and put it in the
| c:\python24\lib
|| folder. I would have thought that since the lib directory is in the
|| Pythonpath,I would be able to import python scripts
"Twig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Szabolcs Nagy wrote:
| >>Is this possible?
| >
| > yes: movable python
| > http://www.voidspace.org.uk/python/movpy/introduction.html
| >
|
| Thanks! Also found this:
|
| http://arctrix.com/nas/python/standalone.html
BTW,
Wou
Daniel Dittmar wrote:
> Frank Millman wrote:
> > I have subclassed threading.Thread, and I store a number of attributes
> > within the subclass that are local to the thread. It seems to work
> > fine, but according to what you say (and according to the Python docs,
> > otherwise why would there be
Twig wrote:
> Would it work if I just install Python locally (yes, Win..) and copy the
> files to shared dir/drive?
absolutely.
1) do a local install to, say, c:\python24
2) check if the python DLL (python24.dll) was installed along the
python.exe file in that directory.
if not, copy it from \
Hi,
a = '/home/suresh/doc/html/a1/'
b = '/home/suresh/doc/'
I am looking for a standard function which will return the location of b
relative to a i.e. '../..'
I have gone through the os and os.path modules, but could not find any
function of use. Should I write my own?
Just guessing but are the files binary yet you are downloading them without declaring binary?On 1/16/06, Peter A.Schott <
[EMAIL PROTECTED]> wrote:I download a lot of 4-6 KB files and regularly run into issues with files that
don't get downloaded all the way or otherwise get corrupt.I do something
Claudio Grondi wrote:
> You seem here to try to give a definition of the term 'value' for
> Python. If I understand it right, the definition of the term can't be
> generally given for many reasons. It depends at least on type and in
> advanced usage it can be arbitrary defined or changed.
> That
http://groups.google.com/group/comp.lang.python/browse_thread/thread/390d8d3e3ac8ef44/d8c74f96468c6a36?q=relative+path&rnum=1#d8c74f96468c6a36
--
http://mail.python.org/mailman/listinfo/python-list
Suresh Jeevanandam wrote:
> a = '/home/suresh/doc/html/a1/'
> b = '/home/suresh/doc/'
>
> I am looking for a standard function which will return the location of b
> relative to a i.e. '../..'
>
> I have gone through the os and os.path modules, but could not find any
> function
Suresh Jeevanandam wrote:
> Hi,
> a = '/home/suresh/doc/html/a1/'
> b = '/home/suresh/doc/'
>
> I am looking for a standard function which will return the location of b
> relative to a i.e. '../..'
Jason Orendorff's path module has a method for this (relpathto()).
http://www.jorendorff.c
I have a xml tree like this
tree = ET.ElementTree(root)
How can i put tree in a string?tree is generated like this:import elementtree.ElementTree as ET
root = ET.Element("manager")
req=ET.SubElement(root,"request")app=ET.SubElement(req,"append")
app.set("mode","INPUT")met=ET.SubElement(app,"m
pathutils has a function to do this (actually extracted from the path
module).
http://www.voidspace.org.uk/python/pathutils.html
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
--
http://mail.python.org/mailman/listinfo/python-list
Robin Haswell wrote:
> Hey guys
>
> I've been reading http://www.python.org/peps/pep-0249.html and I don't
> quite get what level of thread safety I need for my DB connections.
>
> If I call db = FOOdb::connect() at the start of my app, and then every
> thread does it's own c = db.cursor() at the
I don't have experience on this, but I think that you can make the
script return the image "contents" directly to the img tag, without
passing it to a img file, so you can use something like this:
wich saves some processing and I/O.
--
http://mail.python.org/mailman/listinfo/python-list
Sorry for the off-topic post, but I know of no better collection of brains
than this one. I'm starting to investigate clustering as a means to address
some growing computing needs at work, but know essentially zip about the
concept. If you know of a good introduction to computing clusters (Linux
Fredrik Lundh wrote:
> if you can find one that's relatively stable, simple enough to enable
> beginners to
> do simple things with just a little python code, can do simple stuff without
> needing
> a full-blown DB, and can run as an ordinary CGI if necessary, I'm definitely
> +1.
>
> (hmm. ma
How can i write a program that supports simultaneous multipart
download. So i want to open multiple connections to download one file.
Is this possible. If so, how?
--
http://mail.python.org/mailman/listinfo/python-list
On 20 Jan 2006 06:01:15 -0800, datbenik <[EMAIL PROTECTED]> wrote:
>How can i write a program that supports simultaneous multipart
>download. So i want to open multiple connections to download one file.
>Is this possible. If so, how?
http://twistedmatrix.com/
>
>--
>http://mail.python.org/mailman
Sparklines is a script that does exactly what you are asking using python
and PIL:
http://bitworking.org/projects/sparklines/
max
--
http://mail.python.org/mailman/listinfo/python-list
Sbaush wrote:
> Is possible to have the XML in a string (for example xmlstring) and for
> printing do a print xmlstring ?
most about anything that can be written to a file can be written to a string
using the StringIO module:
http://www.effbot.org/librarybook/stringio.htm
file = StringI
Is it possible to create a DLL (pr on unix a .a, .so, etc) from python
code, perhaps using freeze or some other application? Freeze seems to
assume that it's creating the main program body, but I don't really
understand it well enough to say.
If it doesn't work, is there another application th
Hello,
I am currently looking to write a utility in python that will monitor
the statis of a RAID card within linux. The card in Question is the LSI
SAS1064 as the tools provided by the vendor to monitor the software
does not suit our requirements.
However I am unsure how to convert dmidecode inf
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Twig wrote:
|
| > Would it work if I just install Python locally (yes, Win..) and copy
the
| > files to shared dir/drive?
|
| absolutely.
|
| 1) do a local install to, say, c:\python24
|
| 2) check if the python DLL (p
So this isn't possible with the urllib or with the urllib2?
--
http://mail.python.org/mailman/listinfo/python-list
Steve,
This is an aside: I'd love to see someone implement in Python a
framework similar to the Quantum Leaps Quantum Framework for
event-driven programming. I think Python has some features that lend
themselves to a neater implementation than what can be done in C/C++.
More generally, I'd like t
Luiz Geron wrote:
> I don't have experience on this, but I think that you can make the
> script return the image "contents" directly to the img tag, without
> passing it to a img file, so you can use something like this:
>
>
>
> wich saves some processing and I/O.
>
No it doesn't, because the s
Jan,
What do you see as the main advantage for using MyHDL rather than VHDL
for coding up a chip design?
--
http://mail.python.org/mailman/listinfo/python-list
in the elementtree implementation the tostring function doesn't work with a tree, work only with an element. What is the way to put the tree in a string?2006/1/20, Fredrik Lundh <
[EMAIL PROTECTED]>:Sbaush wrote:> Is possible to have the XML in a string (for example xmlstring) and for
> printing do
Steve Holden wrote:
> Luiz Geron wrote:
>> I don't have experience on this, but I think that you can make the
>> script return the image "contents" directly to the img tag, without
>> passing it to a img file, so you can use something like this:
>>
>>
>>
>> wich saves some processing and I/O.
>>
>
I have a simple intranet web app whose job is to synchronize a couple of
databases. The web part is that you can change settings such as how often the
sync should happen, force the sync, or see the log. Since it runs periodically,
I want the process that does the db sync to run happily along but
Hello,
I'm trying to redirect standard out in a single namespace.
I can replace sys.stdout with a custom object - but that affects all
namespaces.
There will be code running simultaneously that could import sys
afterwards - so I don't want to make the change in the sys module.
I have an idea to
FreeImagePy 1.2.0 is available at freeimagepy.sf.net
What is?
It' a python wrapper for FreeImage, Open Source library for developers
who would like to support popular graphics image formats.
How work?
It use a binary freeimage library present on the system and ctypes.
Major changes fro
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>
>Sorry for the off-topic post, but I know of no better collection of brains
>than this one. I'm starting to investigate clustering as a means to address
>some growing computing needs at work, but know essentially zip about the
>concept.
"Sbaush" wrote:
> in the elementtree implementation the tostring function doesn't work with a
> tree, work only with an element. What is the way to put the tree in a
> string?
this is the code you posted:
root = ET.Element("manager")
... snip ...
tree = ET.ElementTree(root)
tree
Antoon Pardon wrote:
> Well we could have list(a) return [a], and have a list_from_iterable.
> Although I would prefer a different name.
Or reverse it - list() always takes a single iterable, and
list_from_scalars() is defined something like follows:
>>> def list_from_scalars(*args):
retu
Xavier Morel wrote:
> Generate inline base64 encoded images in your HTML page and you're done.
> (yes, this is ugly,
especially if you have a browser that don't support data: urls.
--
http://mail.python.org/mailman/listinfo/python-list
Xavier Morel wrote:
> Steve Holden wrote:
> > Luiz Geron wrote:
> >> I don't have experience on this, but I think that you can make the
> >> script return the image "contents" directly to the img tag, without
> >> passing it to a img file, so you can use something like this:
> >>
> >>
> >>
> >> wi
Magnus Lycka wrote:
> Claudio Grondi wrote:
>
>> You seem here to try to give a definition of the term 'value' for
>> Python. If I understand it right, the definition of the term can't be
>> generally given for many reasons. It depends at least on type and in
>> advanced usage it can be arbitra
Sometimes creating files and separate processes are all that's needed.
Write the settings into a config file with the web process and read
them from the file with the sync process. Then create a second file at
the start of the process and delete it once the process is complete.
Lastly run a proced
You need libreadline to make it work. For some stupid reason OSX
doesnt come with it installed.
just get the gzipped one from here:
http://www.pycs.net/bbum/2004/1/21/readline.so.gz
then gunzip it and put the readline.so into
/Library/Python/2.3/site-packages/
then fire up python again and it s
Hi All,
tried to install the RPM for bittorrent, and got the following,
[EMAIL PROTECTED] bittorrent]# rpm -Uvh
BitTorrent-4.2.2-1-Python2.3.noarch.rpm
error: Failed dependencies:
python(abi) = 2.3 is needed by BitTorrent-4.2.2-1.noarch
[EMAIL PROTECTED] bittorrent]# python -V
Python 2.3.4
why
Hi,
During optimizing SPE for Ubuntu, I found something strange. I have
Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not
working:
>>> import webbrowser
>>> webbrowser.open("http://www.python.org";)
It does not throw an exception, but is not able to launch a browser.
Ubuntu shi
I'm trying to move the building of a zip file from a shell script into
python. It is mostly working but when I unzip the files the UNIX
permissions are not preserved. The zip program I've been using is the
standard(?) one on Linux, from Info-Zip. Presumably I need to do
something with external_a
Pete Forman wrote:
> I'm trying to move the building of a zip file from a shell script into
> python. It is mostly working but when I unzip the files the UNIX
> permissions are not preserved. The zip program I've been using is the
> standard(?) one on Linux, from Info-Zip. Presumably I need to d
There is a script running continuously which executes an external
script in a loop using os.spawnlp(os.P_WAIT, 'extscript.py') function.
After several hundred executions (cycles of the loop), the main script
gets an exception while trying to start the process. This situation is
repeated until the m
IT Industry Predicament
Xah Lee, 200207
As most of you agree, there are incredible wrongs in software industry.
Programs crash, injurious tools, uninformed programers, and decrepit
education system. Over the years of my computing industry experience
since 1995, i have recently gradually come to r
Xah Lee wrote:
> • The reason fucking languages like C and family mask technically
Contrary to popular opinion, languages don't multiply. Certainly they
don't have sex. Most (human) languages merely have something called
gender, and words don't interact. C has a bastard child called C++,
tru
Johhny wrote:
> I am currently looking to write a utility in python that will monitor
> the statis of a RAID card within linux. The card in Question is the LSI
> SAS1064 as the tools provided by the vendor to monitor the software
> does not suit our requirements.
What are your requirements?
> How
Fuzzyman wrote:
> Is there another way to shadow the sys module from a single namespace ?
I've never actually tried this, but try making a copy of the sys module
then replacing the stdout object with your own object. Then you can
replace "sys" of the namespace with your custom "sys" module. I gu
Randall Parker wrote:
> Jan,
>
> What do you see as the main advantage for using MyHDL rather than VHDL
> for coding up a chip design?
The fact that MyHDL is technically just another Python application.
So it makes all typical Python advantages available to hardware
designers. No need to discuss
Hi,
I have to say I am confused about the documentation on pyxml.sf.net.
When I want to use DOM, I effectively am using a class called Sax2? ^^
I also have to catch SAXExceptions, which reside in xml.sax._exceptions.
I thought DOM and SAX are two completely different things. Why is PyXML
mixing
Oh and:
Where can I find an API reference for PyXML? Am I supposed to /guess/
which methods and attributes e.g. Sax2 supplies? :D
Thanks again,
Matthias
--
http://mail.python.org/mailman/listinfo/python-list
Yeah, going back to the sourceforge site now I see the install
instructions you quote above.
Perhaps I'm spoiled by all the FSF packages I've dealt with over the
years. In addition to being impatient I expect the README file to
either tell me how to install the product or direct me to the INSTALL
Matthias Kaeppler wrote:
> I have to say I am confused about the documentation on pyxml.sf.net.
> When I want to use DOM, I effectively am using a class called Sax2? ^^
> I also have to catch SAXExceptions, which reside in xml.sax._exceptions.
>
> I thought DOM and SAX are two completely different
"Xah Lee" <[EMAIL PROTECTED]> writes:
[the usual]
___
/| /| | |
||__|| | Please do |
/ O O\__ NOT |
/
Would anyone else find this syntax useful for generator expressions?
py> [x for x in '1234' if x%2 else 'even']
[1, 'even', 3, 'even']
I'm guessing this has been suggested before?
James
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
> I don't have an answer to your real question, but if you're not
> committed to a particular XML package yet, you might consider ElementTree:
> http://effbot.org/zone/element-index.htm
>
> The API is much simpler, and the package has a much more sane
> organization. ;)
James Stroud <[EMAIL PROTECTED]> writes:
> py> [x for x in '1234' if x%2 else 'even']
> [1, 'even', 3, 'even']
>
> I'm guessing this has been suggested before?
You could (in 2.5) use:
[(x if x%2 else 'even') for x in '1234']
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> Would anyone else find this syntax useful for generator expressions?
>
> py> [x for x in '1234' if x%2 else 'even']
> [1, 'even', 3, 'even']
>
> I'm guessing this has been suggested before?
>
> James
Before anyone notices, I should say:
[x for x in [1,2,3,4] if x%2 else '
>>py> [x for x in '1234' if x%2 else 'even']
>>[1, 'even', 3, 'even']
>>
>>I'm guessing this has been suggested before?
>
>
> You could (in 2.5) use:
>
>[(x if x%2 else 'even') for x in '1234']
This failed on multiple levels in 2.3.5 (the "if" syntax is
unrecognized, and trying the below w
As Paul already demonstrated, this is hardly needed since it can be
done more clearly with existing lang. features.
--
http://mail.python.org/mailman/listinfo/python-list
> You could (in 2.5) use:
>
>[(x if x%2 else 'even') for x in '1234']
Or this:
[int(x)&1 and x or 'even' for x in '1234']
--
http://mail.python.org/mailman/listinfo/python-list
Tim Chase <[EMAIL PROTECTED]> writes:
> > You could (in 2.5) use:
> >[(x if x%2 else 'even') for x in '1234']
>
> This failed on multiple levels in 2.3.5 (the "if" syntax is
> unrecognized,
Yes, that syntax is new to 2.5.
> However, this worked in my 2.3.5:
> [((x%2 == 0 and 'even') or x
I'm sorry, but i don't see how this will solve the problem? It is
exactly the same, only now you've replaced everything in sys except
just sys.stdout?
At any rate, perhapse the code you will write will be more maintainable
if instead of redirecting sys.stdout for some of the code just use a
differe
Roy Smith wrote:
> [EMAIL PROTECTED] wrote:
>
>
>>I have a regular expression that is approximately 100k bytes. (It is
>>basically a list of all known norwegian postal numbers and the
>>corresponding place with | in between. I know this is not the intended
>>use for regular expressions, but it s
I thought I would
post this here first before seeking more experienced ears for this particular
strangness.
I have Python 2.4.2
installed from source on a dual processor dell server. These are x86_64
processors (verified by /bin/arch) (aka emt64 extensions).
uname -a
gives
Linux eps-li
In article <[EMAIL PROTECTED]>,
Bryan Olson <[EMAIL PROTECTED]> wrote:
> Roy Smith wrote:
> > [EMAIL PROTECTED] wrote:
> >
> >
> >>I have a regular expression that is approximately 100k bytes. (It is
> >>basically a list of all known norwegian postal numbers and the
> >>corresponding place wit
I'm working on a final project for my EE degree that requires the use
of digital camera with high resolution. I'd like to do the image
capture with Python, preferably in a cross-platform manner, but if
necessary, we can limit ourselves to Windows. Any ideas on
modules/hardware for doing this?
Than
Duncan Booth wrote:
> Here's the way I would do it:
>
def occurrences(it):
>
> res = {}
> for item in it:
> if item in res:
> res[item] += 1
> else:
> res[item] = 1
> return res
I slightly prefer:
def occurrences(it):
res = {}
re
[EMAIL PROTECTED] (Alex Martelli) writes:
> > How would you make a one-element list, which we'd currently write as [3]?
> > Would you have to say list((3,))?
>
> Yep. I don't particularly like the "mandatory trailing comma" in the
> tuple's display form, mind you, but, if it's good enough for tup
Alex Gittens wrote:
> I'm working on a final project for my EE degree that requires the use
> of digital camera with high resolution. I'd like to do the image
> capture with Python, preferably in a cross-platform manner, but if
> necessary, we can limit ourselves to Windows. Any ideas on
> modules/
Can someone explain what I'm doing wrong? The following code snipet
produces an error about addch() expecting an int:
u = u'\u2591'
s = u.encode("UTF-8")
stdscr.addch((y+1), (x+1), s, curses.color_pair(1))
If I try this instead:
u = u'\u2591'
s = u.encode(
1 - 100 of 158 matches
Mail list logo