[EMAIL PROTECTED] wrote:
This script uses a simple for loop to zip some files. However I am
repeating code that cries out for a nested loop.
Cries out for a *function*, I'd say.
My two lists of files_to_be_zipped (spare and seekfacts) are of
> uneven length so I can't seem to decipher the "
Alis <[EMAIL PROTECTED]>:
> Is there any component-oriented (non-MVC) web framework available for
> Python?
>
> That is something like Apache Wicket, Tapestry or JSF, but I need it
> to be in Python.
Zope [1] might be worth trying.
[1] http://www.zope.org
--
Freedom is always the freedom of d
On Jul 16, 9:38 am, Peng Yu <[EMAIL PROTECTED]> wrote:
> On Jul 15, 10:29 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
>
>
>
> > Peng Yu wrote:
> > > Hi,
>
> > > The following code snippet is from /usr/bin/rpl. I would like the it
> > > to match a word, for example, "abc" in ":abc:". But the current
John S wrote:
> Not sure why you picked \A and \Z -- they are only useful if you are
> using the re.M flag.
Well, they're aliases for ^ and $ in "normal" mode, at least for strings
that don't end with a newline.
re.I is the same as re.IGNORECASE. More than one option may be OR'ed
together. T
On Jul 16, 3:22 pm, Alexnb <[EMAIL PROTECTED]> wrote:
> Alexnb wrote:
>
> > Mike Driscoll wrote:
>
> >> On Jul 16, 1:37 pm, Alexnb <[EMAIL PROTECTED]> wrote:
> >>> Hello
>
> >>> I am sure most of you are familiar with py2exe. I am having a bit of a
> >>> problem. See the program has a few pictures
Okay, what I want to do with this code is to got to thesaurus.reference.com
and then search for a word and get the syns for it. Now, I can get the syns,
but they are still in html form and some are hyperlinks. But I can't get the
contents out. I am not that familiar with BeautifulSoup. So if anyon
On Jul 16, 4:42 pm, Whyatt <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm trying to create a message using SMTP Mail through Python with a
> message Importance of either 0 (Low) or 2 (High).
>
> If I do outer.Add_header('Importance', '0') it is ignored.
>
> If I do uter.Replace_header('Importance', '
On Jul 15, 4:28 pm, "Joel Koltner" <[EMAIL PROTECTED]>
wrote:
> "Sion Arrowsmith" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > What's wrong with sys.argv ?
>
> Mainly that it doesn't exist. :-) The example was slightly contrived -- I'm
> really dealing with commands inter
Hey, forgive me for just diving in, but I have a question I was
thinking of asking on another list but it really is a general question
so let me ask it here. It's about how to approach making singletons.
Background: I've been programming in python seriously for about a year
now, maybe a little lon
On Jul 16, 11:33 pm, John Savage <[EMAIL PROTECTED]> wrote:
> I save posts from a midi music newsgroup, some are encoded with
> yenc encoding. This gave me an opportunity to try out the decoders
> in Python. The UU decoder works okay, but my YENC effort gives
> results unexpected:
>
> import ye
Other possibility, combining Dan and Fredrik's posts:
import zipfile
import os
zips = {
'c:/spare.zip': ['c:/spare/huge.fm3', 'c:/spare/huge.wk3'],
'c:/seekfacts.zip': ['c:/seekfacts/bookmark.html', 'c:/seekfacts/
index.htm', 'c:/seekfacts/seek.css', 'c:/seekfacts/seek.js']
};
def z
web2py (not to be confused with web.py although both of them are
excellent) comes with XMLRPC, XML, JSON and RSS API. You can find an
XMLRPC example here:
http://mdp.cti.depaul.edu/examples/default/examples#xmlrpc_examples
The web2py source (including the optional web based interface) fits
Hi,
Perl has a command line help perldoc. I'm wondering if python has a
similar help command.
Thanks,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
Peng Yu wrote:
Perl has a command line help perldoc. I'm wondering if python has a
similar help command.
it's built into the interpreter, and Python tells you how to use it when
you start Python in interactive mode.
$ python
Python 2.5.1
Type "help", "copyright", "credits" or "license" for
Peng Yu <[EMAIL PROTECTED]> writes:
> Perl has a command line help perldoc. I'm wondering if python has a
> similar help command.
The interactive interpreter has a "help" command, and a corresponding
"help" function which can be passed an object to display its
docstrings recursively and nicely-fo
I've done a lot of web searching, a fair bit of C-source reading, and
quite a lot of miscellaneous head scratching, and I find that I am not
necessarily closer to an ideal solution.
I have a Python/C interface layer that essentially does the following:
Py_XDECREF (some_callback);
closeService (so
Kyle Lanclos wrote:
I want to modify the above sequence to manually prompt Python's garbage
collection routine(s) to take over (performance is not an issue here),
similar to the following:
Py_XDECREF (some_callback);
PyCollect_Garbage ();
closeService (some_service);
return;
Is that possible?
Andreas Tawn wrote:
Terry Reedy wrote:
For loop variables continue after the loop exits. This is
intentional.
I never knew that and I can't find reference to it in the docs. Can you
help me with the reasons for it?
1. Python's reluctance to multiply scopes without necessity (as other
re
John Savage wrote:
I save posts from a midi music newsgroup, some are encoded with
yenc encoding. This gave me an opportunity to try out the decoders
in Python. The UU decoder works okay, but my YENC effort gives
results unexpected:
import yenc, sys
fd1=open(sys.argv[1],'r')
#y
Fredrik Lundh wrote:
> what magic do you expect the "manual garbage collection" to do here that
> the DECREF doesn't already do?
The DECREF decrements the reference count, but does not immediately prompt
garbage collection when the reference count drops to zero; that garbage
collection does not a
Prashant Saxena wrote:
import sys
class Float(float):
"""
Custom float datatype with addtional attributes.
"""
def __new__(self,
value=0.0, #default value
name='', # string
& nbsp; range=(0.0, 1.0) # tuple
On Jul 16, 5:20 pm, Craig Allen <[EMAIL PROTECTED]> wrote:
> Hey, forgive me for just diving in, but I have a question I was
> thinking of asking on another list but it really is a general question
> so let me ask it here. It's about how to approach making singletons.
> Background: I've been progr
Kyle Lanclos wrote:
The DECREF decrements the reference count, but does not immediately prompt
garbage collection when the reference count drops to zero; that garbage
collection does not appear to occur until I return from the particular C
function I am in the middle of executing.
Yeah, but wh
Fredrik Lundh wrote:
> Do these objects have direct references to a resource that you're
> explicitly destroying from your C code?
and yes, if this is the problem, the correct solution is to create an
separate object type that's designed to manages the resource and act as
a proxy against it, a
On 7月17日, 上午3时20分, Tim Golden <[EMAIL PROTECTED]> wrote:
> patrol wrote:
> > On 7月17日, 上午12时16分, Tim Golden <[EMAIL PROTECTED]> wrote:
> >> Assuming that the error comes back in the sys.stdout encoding, the
> >> following version *should* work ok. I still haven't got a non-English set
> >> up to
I will try to modify the wmi.py ,however I'm a novice.It will take a
long time. You can give it up temporarily. If you don't mind ,can you
tell me where needs modifying and how? Just unicode? Or Other?
--
http://mail.python.org/mailman/listinfo/python-list
I don't intend to do much subclassing of this, but of course, I'd
rather not second guess the future and it's not hard to imagine we
will come to some point that we need to do just that. Thanks for the
ideas about repairing option one, which I'd given up, though the ideal
is still that
tl = TehLi
Fredrik Lundh wrote:
> Yeah, but what do you expect that garbage collection pass to result in?
Basically, I want to toss the objects before I close the service that they
depend on.
> PyGC_Collect() does exactly that, so if that doesn't solve your problem,
> the only way to fix is this is to go b
dear all:
I have searched the debug informations of many python's IDE, but I
cannot find the method about debuging the extend module written in
Visual studio 2008 on windows.
The wingIDE tell me that we can debug the extend module on linux, but
cannot on windows. and using wingdbstub.py we can emb
Please take close look at the details of the two snapshots.
I need explanation and correcting this problem.
begin 666 after.png
MB5!.1PT*&@[EMAIL PROTECTED];0```#-" ,```#GL'7)`7-21T(`KLX<
MZ01G04U!``"[EMAIL PROTECTED]>B8``("[EMAIL PROTECTED]@``'4P
M``#J8 [EMAIL PROTECTED]/ ```P!03%1%
Thank you , Mike.
"Mike Driscoll" <[EMAIL PROTECTED]>
??:[EMAIL PROTECTED]
On Jul 2, 8:40 pm, "Leo Lee" <[EMAIL PROTECTED]> wrote:
> I need a window's handle to be passed to external c++.
> Thanks in advance
Are you talking about a wxPython wx.Window object or an external
window handle? If th
Ben Sizer wrote:
Although the standard library in Python is great, there are
undoubtedly some great packages available from 3rd parties, and I've
encountered a few almost by accident. However, I don't know how a user
would become aware of many of these. http://pypi.python.org/pypi/
presumably lis
Phillip B Oldham wrote:
We're looking at the next phase of development for our webapp, and the
main focus will be to move the core from the app to a web service so
other systems can use the data we've gathered (we're thinking along
the lines of the XML API of Highrise from 37Signals).
Its possib
Alexnb wrote:
Hello
I am sure most of you are familiar with py2exe. I am having a bit of a
problem. See the program has a few pictures involved and the .ico it uses
for the windows. However, the pictures are stored in the same directory as
the source, something like: C:\Docs and settings\me\My d
Hi, I think I have already solved this problem while I am digging into the
installation sources.
I found this:
C:\Python25\Lib\site-packages\py2exe\samples\singlefile\gui\setup.py
# Requires wxPython. This sample demonstrates:
#
# - single file exe using wxPython as GUI.
from distutils.core im
On Jul 17, 8:20 am, Craig Allen <[EMAIL PROTECTED]> wrote:
> Is it pythonic?
You probably can't get anymore pythonic than something written by the
BDFL. In describing the use of __new__ in Unifying types and
classes in Python 2.2 he gives this recipe for a Singleton.
class Singleton(object):
Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Stefan Scholl wrote:
>
>> Django isn't ready.
>
> That's a remarkably ignorant statement.
The 1.0 release will be in September.
--
Web (en): http://www.no-spoon.de/ -*- Web (de): http://www.frell.de/
--
http://mail.python.org/mailman/listinfo/python-
On Thu, 17 Jul 2008 05:41:11 +0200, Stefan Scholl wrote:
> Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>> Stefan Scholl wrote:
>>
>>> Django isn't ready.
>>
>> That's a remarkably ignorant statement.
>
> The 1.0 release will be in September.
So what? It's not the version number that matters but
import sys
class Attribute(object):
"""
Common attributes and methods for custom types
"""
__slots__ = []
def __init__(self, name=None, type=None, range=(0,1)):
self.__name = name
self.__type = type
self.__range = range
#Read only attribute
In message
<[EMAIL PROTECTED]>, Craig
Allen wrote:
> ... the ideal is still that
>
> tl = TehLibrary() would always return the same object.
>> class TehLibrary(object) :
... @classmethod
... def __new__(self, cls) :
... return self
>>> s = TehLibrary()
>>> s == TehLibrary()
True
In message
<[EMAIL PROTECTED]>, Keith
Hughitt wrote:
> I have a UTC date (e.g. 2008-07-11 00:00:00). I would like to create a
> UTC date ...
>>> import calendar
>>> calendar.timegm((2008, 7, 11, 0, 0, 0, 0, 0, -1))
1215734400
[EMAIL PROTECTED]> TZ=NZ date -d "00:00:00 01-Jan-1970Z +1215734400 s
On Jul 16, 7:16 am, Ben Sizer <[EMAIL PROTECTED]> wrote:
> Although the standard library in Python is great, there are
> undoubtedly some great packages available from 3rd parties, and I've
> encountered a few almost by accident. However, I don't know how a user
> would become aware of many of thes
In message <[EMAIL PROTECTED]>, Cyril Bazin
wrote:
> But it seems, after many tests, that the script stops at the
> instruction : "c.execute(requete)"
What's the error message? This should be in Apache's error_log file.
--
http://mail.python.org/mailman/listinfo/python-list
In message <[EMAIL PROTECTED]>, Sebastian "lunar" Wiesner
wrote:
> Relying on the destructor is *always* a bad idea, you should always
> close files explicitly!
There shouldn't be any problem with files opened read-only.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] schrieb:
dear all:
I have searched the debug informations of many python's IDE, but I
cannot find the method about debuging the extend module written in
Visual studio 2008 on windows.
The wingIDE tell me that we can debug the extend module on linux, but
cannot on windows. and u
The trick to this one is that the html looks something like this:
american,
/browse/blue blue
,
/browse/brick brick
, brie, cheddar, cheshire,
/browse/churn churn
,
/browse/cottage cottage
,
/browse/cream cream
, dunlop,
and it goes on
My question is I want everything inside, the conten
Alis schrieb:
Hi
Is there any component-oriented (non-MVC) web framework available for
Python?
That is something like Apache Wicket, Tapestry or JSF, but I need it
to be in Python.
ToscaWidgets, can be used with any WSGI-compliant framework.
Diez
--
http://mail.python.org/mailman/listinfo/py
dear Diez:
I need step into c function in extending module(DLL) when debugging
the script. and I want Single-step debugging the extend module itself,
but python script Launched The whole process.
best regards
fang
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 16, 6:20 pm, Craig Allen <[EMAIL PROTECTED]> wrote:
> Anyone have any comments? Is there anything wrong, evil, or ugly
> about using a module this way, or am I correct to think that actually,
> this is a common approach in python.
>
> Is it pythonic?
The one drawback to this is that it co
Hello. Need some help here. I have a 4*4 cube. So the equation of the
cube becoming:
x + 4*y + 16*z
Now i want to rotate this cube 90 degrees anticlockwise( a right
rotation). How can i do that? The rotation must take place with the
axis of rotation b
101 - 150 of 150 matches
Mail list logo