Kay Schluehr:
>You won't find many deep class hierarchies and extensive frameworks.
Zope comes to mind.
>This has the advantage that a classification you have done once at
>the beginning of your project in the design phase is not considered
>to be carved in stone.
Zope 3 comes to mind.
--
ht
Alex Martelli:
>PEAK is an interesting counterexample, particularly since Philip Eby
>tends to be "ahead of the curve":
I never noticed PEAK before. Is it well worth studying?
--
http://mail.python.org/mailman/listinfo/python-list
Neal Becker:
>I see various answers that Python doesn't need interfaces. OTOH, there are
>responses that some large Python apps have implemented them (e.g., zope).
>Does anyone have an explanation of why these large systems felt they needed
>to implement interfaces?
A programming language doesn'
Julien ARNOUX:
>I have a problem :), I just want to extract text from pdf file with
>python. There is differents libraries for that but it doesn't work...
>
>pyPdf and pdfTools, I don't know why but it doesn't works with some
>pdf...
Text can be represented in different ways in PDF: as tagged tex
[EMAIL PROTECTED]:
>i have a script that waits for message packets from a data server over
>a socket.
Using what network protocol?
>it works fine for a while, but the server requires that i send a
>heartbeat ping every 600 seconds or it will terminate the connection.
[...]
>should i do this with
harold:
>The output (when given the data I want to parse) is:
If you'd told us that data, and told us what version of Python you're
using, we could have reproduced the problem to look into it.
>ValueError: need more than 3 values to unpack
>
>Why does python think that I want to unpack the outcom
harold:
>A similar error happens in an interpreter session, when typing
for line in ["1 2 3 4"] :
>...for a,b,c,d in line.split() :
>...pass
>...
>Traceback (most recent call last):
> File "", line 2, in ?
>ValueError: need more than 1 value tyo unpack
>
>maybe this might help to
gangesmaster:
>(i forgot to say it didn't work)
It's the remaining threads that need to be daemon, when some thread
performs sys.exit. When no non-daemon thread remains, the application
terminates.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>i have discovered that the server will send a request for the heartbeat
>ping if its almost timed out, so i use the length of the message to
>determine what to do with it.
>
>msg = sockobj.recv(1024)
>
>if len(msg) == 158:
>record the data
>elif len(msg) == (34): # length of
[EMAIL PROTECTED]:
>I was wondering, why you always have to remember to call bases'
>constructors explicitly from the derived class constructor? Why hasn't
>this been enforced by the language?
Probably because the language doesn't know whether the subclass wants to
override its base class's constr
[EMAIL PROTECTED]:
>I think I'll need some shift in thinking after C++.
+1 qotw
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Steve Juranich:
>is there some big master diff, along the lines of "What's new
>in Python X.X" that I could look at to get an idea of what z3 has that 2.9
>(which I'm currently still cutting my teeth on) doesn't?
It's a redesign.
Z2: mixin base classes
Z3: component architecture with interfaces
Micah:
>I'd like a full-featured tree
What features?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>I was wondering if anyone knew of a built in Python function that will
>check if an item is a member of a list, i.e., if item i is a member of
>list l.
>>> 1 in [1,3,4]
True
>>> 2 in [1,3,4]
False
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno:
>I always read about how you need to set certain file permissions (for
>cgi files, for example), but it's never been clear to me *how* you do
>this. I know you can run the line
>
>chmod 755 scriptname.py
>
>but *where* do you run this?
This is a Unix/Linux command. You run it in a
Gary Wessle:
>tx = "now 04/30/2006 then"
>data = re.compile('(\d{2})/\1/\1\1', re.IGNORECASE)
>d = data.search(tx)
>print d
>
>Nono
>I was expecting 04/30/2006
You should expect: NameError: name 're' is not defined
> what went wrong?
\1 matches the content of the first group, which is '04'. It d
[EMAIL PROTECTED]:
>with urllib2 it doesn't seem possible to get HTTP status codes.
except urllib2.HTTPError, e:
if e.code == 403:
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>Rene Pijlman wrote:
>> [EMAIL PROTECTED]:
>> >with urllib2 it doesn't seem possible to get HTTP status codes.
>>
>> except urllib2.HTTPError, e:
>> if e.code == 403:
>
>Thanks. Is there documentation for this
Fredrik Lundh:
>PATH is used by the operating system to find executables, and PYTHONPATH
>is used by Python to find Python modules.
Yes, but Python also finds modules in its own installation. So changing
PATH may cause another installation of Python to be run, which may have
some other set of inst
Luis P. Mendes:
>I'm developing a django based intranet web server that has a search page.
>
>Data contained in the database is mixed. Some of the words are
>accented, some are not but they should be. This is because the
>collection of data began a long time ago when ascii was the only way to go
malv:
>Did anybody get this recipe to work?
Did you?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
malv:
>At the statement b = Bar(), the following error occurs:
>The debugged program raised the exception unhandled AttributeError
>"type object 'Bar' has no attribute '__instance_refs__'"
I haven't studied it at all, but the code on
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/160164 s
Jack:
>I have to run the installer to install dozens of directories and
>hundreds of files,
That's not unusual and not considered a problem by most people.
>and I don't really know if all of them are necessary.
Don't let that bother you. Life's too short.
>Plus, lots of libraries are in .py,
Sullivan WxPyQtKinter:
>Why do the three expression yield the same result "abc"?
Because all three converted "ABC" to lowercase, as per your request.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>how can i copy text to the linux clipboard?
Linux is an operating system. It doesn't have a clipboard. The clipboard
is provided by desktop frameworks, such as KDE or Gnome.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>Help please with a URLError.
Post your code (a small self-contained example, preferrably) and the URL.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
JuHui:
>If a proxy is alive then return true, else return fals after 1 second.
What kind of proxy? Design pattern? Protocol? Which one?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]:
>Can you please tell me how Use python to process XML file?
>The example I find is build a DOM, but I just need to do it in SAX
>based, how can I do that?
http://docs.python.org/lib/module-xml.sax.html
http://pyxml.sourceforge.net/topics/howto/section-SAX.html
--
René Pijlman
Bill:
>In general I try to initialize the state of my objects as late as
>possible, in the accessor. [...]
>Is there a more Pythonic way of looking at this?
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/131495
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/363602
--
René Pijlm
Sullivan WxPyQtKinter:
>I hope that an IDE should be featured with:
I use WingIDE 2.1.0 (beta1) and I'm pleased with it.
>1. Grammar Colored highlights.
Yes, Wing does that.
>2. Manage project in a tree view or something alike, ie, a project file
>navigator.
Yes.
>3. Code collapse and foldin
Kevin:
>#!/usr/bin/python
>
>import os
>import urllib
>os.system("python pyq.py ibm > text1.txt")
Check the return value of os.system.
>note: currently the text1.txt outputted is just blank, however if i run
>the command normally as 'python pyq.py ibm' in the command line, it
>works correctly a
[EMAIL PROTECTED]:
>Is there any editor or IDE in Python (either Windows or Linux) which
>has very good debugging facilites like MS VisualStudio has or something
>like that.
Here's a recent thread about IDEs:
http://groups.google.nl/group/comp.lang.python/browse_frm/thread/fd9604e225252ad4
--
Re
[EMAIL PROTECTED]:
>I'm using Queue to send images from one thread to another, and some of
>the images are not appearing in the consumer threadmaybe 1 in 3
>arrive.
I find that hard to believe. Could there be a bug in your program,
somewhere, somehow?
--
René Pijlman
--
http://mail.python.o
Rc:
>My question is where can I find a compiler for free.
>For Windows XP.
http://www.python.org/download/
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Mudcat:
>My initial thought was to put the data in large dictionaries and shelve
>them (and possibly zipping them to save storage space until the data is
>needed). However, these are huge files.
ZODB solves that problem for you.
http://www.zope.org/Wikis/ZODB/FrontPage
More in particular "5.3 BTr
Per:
>how to find whether there is/are common item(s) between two list
>in linear-time?
To find items in common between two lists, make the first into a
dictionary and then look for items in the second in it.
--
René Pijlman
Wat wil jij leren? http://www.leren.nl
--
http://mail.python.org/mai
<[EMAIL PROTECTED]>:
>Just wondering if anyone knows of a way to keep a function,
>E.g. socket.gethostbyaddr("12.34.56.78"),
>>From taking to long-if it's run for more than 1 second, the function
>gethostbyaddr will be terminated?
import socket
socket.setdefaulttimeout(1)
--
René Pijlman
Wat wi
<[EMAIL PROTECTED]>:
>I'm using windows, and from what I've tried, the setdefaulttimeout
>function doesn't work on my machine.
It should. It does on mine.
--
René Pijlman
Wat wil jij leren? http://www.leren.nl
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger:
>There are some competing approaches. One is to attach sentinel objects
>to the end of the line as a way for consumer threads to know that they
>should shut down. Then a regular t.join() can be used to block until
>the consumers threads have shut-down. This approach is
>straig
Carl Banks:
>Rene Pijlman:
>> for i in range(self.numberOfThreads):
>> self.workQueue.put(None)
>
>Or, you could just put one sentinel in the Queue, and subclass the
>Queue's _get method not to take the sentinel out.
Ah yes, clever trick. But you
[EMAIL PROTECTED]:
>I am new to python. How can I compare if 2 files has duplicate
>entries in python?
What is an 'entry'?
--
René Pijlman
Wat wil jij leren? http://www.leren.nl
--
http://mail.python.org/mailman/listinfo/python-list
Sion Arrowsmith:
>I've got an established client-server application here where there
>is now a need to shovel huge amounts of data (structured as lists of
>lists) between the two, and the performance bottleneck has become
>the amount of time spent parsing XML
http://xmlsucks.org/
>Anyone got any
Carl Banks:
>Rene Pijlman:
>> Ah yes, clever trick. But you'd have to worry about thread-safety of your
>> subclass though.
>
>Queue worries about this for you. The Queue class only calls _get when
>it has the queue's mutex, so you can assume thread safet
Dan:
>New to python. Running under windows xp. Need help getting started
>writing COM server and client.
Highly recommended:
http://safari.oreilly.com/?XmlId=1-56592-621-8
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber:
>Raymond Hettinger:
>> Because of the GIL, thread pools are not as useful in Python as you
>> might expect -- they execute one at a time and do not take advantage of
>> hyper-threading or multiple processors. If that kind of efficiency is
>
> If the task is I/O bound (some
DataSmash:
>I'm confused. Why is it that when I say "while len(list) < 5:", I get
>5 items in my list.
Because the last time when len(list) was < 5, the block of code following
the while executed and did something to the list to give it a length >= 5
(otherwise the block of code would be executed
Gerard Flanagan:
>* To create an empty __init__.py file I do 'vim __init__.py' then
>immediately exit vim, is there a shell or vim command which will create
>an empty file without opening the editor?
touch __init__.py
>* cd ~ brings me to my home directory, is there a means by which I can
>set up
Tony Burrows:
>With something like Java I can find the syntax of a method call with no
>problems, how do I do the same with Python?
The basic syntax is just the name, with parameters in brakcets:
object.method(par1, par2, ...)
This is explained in the documentation, of course.
>how do I find
Aahz:
>If you were going to name three or five essential recipes from the
>Python Cookbook suitable for beginners, what would you pick?
>Yes, this is for _Python for Dummies_, so idioms that aren't in the
>Cookbook are also fine.
Constants
Static methods / Class methods
Bunch
TaskQueue (Queue f
mwql:
>Hey guys, this maybe a stupid question, but I can't seem to find the
>result anywhere online. When is the right time to use 'is' and when
>should we use '=='?
http://docs.python.org/ref/comparisons.html
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy:
>The Python specification allows but does not require such behind-the-scenes
>implementation optimization hacks. As released, CPython 2.4 caches -5 to
>99, I believe. In 2.5, the upper limit was increased to 256. The limits
>are in a pair of #define statements in the int object s
I. Myself:
>I can't get this to work
With what versions of what software on what platform?
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Bror Johansson:
>I have a class-hierarchy (fairly deep and fairly wide).
>
>Is there a good and general way to test an instance-object obj for having a
>class belonging to a certain "sub-tree" of the hierarchy with a common
>parent class C?
isinstance(obj,C)
--
René Pijlman
--
http://mail.pytho
[EMAIL PROTECTED]:
>Can I use Pickle to store about 500,000 key value pairs..
Performance would be horrible. Use a BTree in ZODB instead:
http://www.zope.org/Wikis/ZODB/guide/node6.html#SECTION00063
>or should I use mySql.
You should use a relational database, such as PostgreSQL
Sakcee:
>how can i get page response from a site e.g. google.com port 80
[...]
>can i do at socket level?
Yes, but you'll need to implement HTTP:
http://www.ietf.org/rfc/rfc2616.txt
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Lawrence D'Oliveiro:
>I've been using HTMLParser to scrape Web sites. The trouble with this
>is, there's a lot of malformed HTML out there. Real browsers have to be
>written to cope gracefully with this, but HTMLParser does not.
There are two solutions to this:
1. Tidy the source before parsin
WENDUM Denis 47.76.11 (agent):
>While testing recursive algoritms dealing with generic lists I stumbled
>on infinite loops which were triggered by the fact that (at least for my
>version of Pyton) characters contain themselves.
No, strings contain characters. And 'a' is a string consisting of on
Arne:
>I want to connecto to a ftp server. There I woult like to read the
>directiroy and getting the filename, file owner and the file size.
>
>How can I do this in python
http://docs.python.org/lib/module-ftplib.html
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Grzegorz ¦lusarek:
>I sending email using standard python modules smtplib, email,
>coding email in utf but subject of message is not coded properly. In
>subject i use my national characters (polish) and after send i get XX in
>place these characters.
>Here is the code
>
>Message = email.message_
Bas:
>just out of curiosity, is there a list of all the syntactic sugar that
>is used in python?
http://docs.python.org/ref/specialnames.html
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
101 - 160 of 160 matches
Mail list logo