Hi,
I am new to python. I am trying to use the python files given to me
for bringing up a setup.
I get the following error while trying to use a python file -
AttributeError : Classroom instance has no attribute 'desk_offset'
How to resolve this ?
Should i need to define desk_offset to zero in th
Hello
Lets say I have a string:
--a href="/browse/brick"--brick--/a--
The -- needs to be replaced with < or > where applicable.
and I want the "brick" out of that string (the second brick that is). How
can I get just the "brick" out of that string?
--
View this message in context:
http://ww
s = '--a href="/browse/brick"--brick--/a--'
s
'--a href="/browse/brick"--brick--/a--'
''.join('<%s>' % l if i % 2 == 1 else l for i, l in
enumerate(s.split('--')))
'brick'
--
http://mail.python.org/mailman/listinfo/python-list
Alexandr N Zamaraev wrote:
>
s = '--a href="/browse/brick"--brick--/a--'
s
> '--a href="/browse/brick"--brick--/a--'
''.join('<%s>' % l if i % 2 == 1 else l for i, l in
> enumerate(s.split('--')))
> ' /browse/brick brick '
>
> --
> http://mail.python.org/mailman/listinfo/python
Alexnb wrote:
s = '--a href="/browse/brick"--brick--/a--'
s
'--a href="/browse/brick"--brick--/a--'
''.join('<%s>' % l if i % 2 == 1 else l for i, l in
enumerate(s.split('--')))
' /browse/brick brick '
I'm sorry, I don't think I was being clear. I replaced the <'s with -- so it
would post on
-On [20080717 09:01], karthikbalaguru ([EMAIL PROTECTED]) wrote:
>AttributeError : Classroom instance has no attribute 'desk_offset'
You are using a Classroom instance and probably assigning something to the
instance's variable/attribute 'desk_offset'. Except tha
Hi,
I'm trying to create a rectangle when the user presses or releases the
mouse over a cairo object.I'm using the eventBox to capture the mouse
events.
Now the problem is the shapes is beng drawn when I call it from the
expose_event event handler and nothing happens when I call the same
from t
Create something else. There is no such thing as "very"
verbose!!! There is only verbose or not verbose.
**Get the scoop on last night's hottest shows and the live music
scene in your area - Check out TourTracker.com!
(http://www.tourtracker.com?NCID=aolmus0005000112)
-
Alexandr N Zamaraev wrote:
>
> Alexnb wrote:
>> s = '--a href="/browse/brick"--brick--/a--'
>> s
>>> '--a href="/browse/brick"--brick--/a--'
>> ''.join('<%s>' % l if i % 2 == 1 else l for i, l in
>>> enumerate(s.split('--')))
>>> ' /browse/brick brick '
>>
>> I'm sorry, I don't th
J-Burns wrote:
Is there a built in Python function for this?
for answering questions that have nothing to do with programming, and
looks quite a bit like homework? don't think they've added that one yet.
maybe you should look for a geometry newsgroup/forum?
--
http://mail.python.org/mai
[EMAIL PROTECTED] schrieb:
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.
That is exactly what attaching a C-debugger to python will give you.
Stefan Scholl wrote:
Django isn't ready.
That's a remarkably ignorant statement.
The 1.0 release will be in September.
So? "1.0" will be done then, yes. In what way does that mean that
Django itself isn't ready, in any sane sense of that word?
(For bystanders, Django's 0.91 release in
I am trying to do something with a very large tarfile from within
Python, and am running into memory constraints. The tarfile in
question is a 4-gigabyte datafile from freedb.org,
http://ftp.freedb.org/pub/freedb/ , and has about 2.5 million members
in it.
Here's a simple toy program that just go
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> 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 Septem
Can anyone recommend a good HTML/XHTML parser, similar to
HTMLParser.HTMLParser or htmllib.HTMLParser, but able to intelligently
know that certain tags, like , are implicitly closed? I need to
iterate through the entire DOM, building up a DOM path, but the stdlib
parsers aren't calling handle_endta
On Jul 17, 12:53 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> J-Burns wrote:
> > Is there a built in Python function for this?
>
> for answering questions that have nothing to do with programming, and
> looks quite a bit like homework? don't think they've added that one yet.
>
> maybe you should
Hi,
I can't seem to find the right regular expression to achieve what I
want. I'd like to remove all characters from a string that are not
numbers, letters or underscores.
For example:
>>> magic_function('[EMAIL PROTECTED]')
str: 'si_98udasgf'
Would you have any hint?
Thanks a lot!
Julien
--
I dont quite understand what u want. U should paste the html here
http://pastebin.com/ also provide the result that u want.
If u dont take the time to write what u wont, nobody will take the
time to help u
On Jul 17, 7:38 am, Alexnb <[EMAIL PROTECTED]> wrote:
> The trick to this one is that the h
On Jul 17, 9:50 am, Alexnb:
> how can I test to see if the first char of a string is "<"?
I suggest you to try the interactive shell:
>>> "hello"[0]
'h'
>>> "hello"[0] == "<"
False
>>> "hello"[0] == "h"
True
>>> "hello".startswith("h")
True
Bye,
bearophile
--
http://mail.python.org/mailman/list
patrol wrote:
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?
OK. Thanks for your patience on this one, Patrol. What I propose
to do is to di
bearophileHUGS wrote:
>
> On Jul 17, 9:50 am, Alexnb:
>> how can I test to see if the first char of a string is "<"?
>
> I suggest you to try the interactive shell:
>
"hello"[0]
> 'h'
"hello"[0] == "<"
> False
"hello"[0] == "h"
> True
"hello".startswith("h")
> True
>
> B
Hello,
I am a beginner in python.
following program prints the second element in list of lists 4 for the
first elements in list 4 that are common with the elements in list 5
list4 = [['1', 'a'],['4', 'd'],['8', 'g']]
list5 = ['1', '2', '3']
for j in list4:
for k in list5:
>>> list4 = [['1', 'a'],['4', 'd'],['8', 'g']]
>>> list5 = [1, 2, 3]
>>> set5 = set(list5)
>>> [x for n, x in list4 if int(n) in set5]
['a']
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 17, 10:13 am, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I can't seem to find the right regular expression to achieve what I
> want. I'd like to remove all characters from a string that are not
> numbers, letters or underscores.
>
> For example:
>
> >>> magic_function('[EMAIL PROTECTED]')
>
Stefan Scholl wrote:
And by the way: The quote was changed by deleting something on
the same line:
"June 2008 is a bit too early. Django isn't ready."
vs.
"Django isn't ready."
Is this a language issue? That you meant to write "django 1.0 isn't
done" (as in
On Jul 17, 9:13 am, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I can't seem to find the right regular expression to achieve what I
> want. I'd like to remove all characters from a string that are not
> numbers, letters or underscores.
>
> For example:
>
> >>> magic_function('[EMAIL PROTECTED]')
>
Julien wrote:
I can't seem to find the right regular expression to achieve what I
want. I'd like to remove all characters from a string that are not
numbers, letters or underscores.
For example:
magic_function('[EMAIL PROTECTED]')
str: 'si_98udasgf'
the easiest way is to replace the things
On Jul 17, 4:30 pm, antar2 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am a beginner in python.
> following program prints the second element in list of lists 4 for the
> first elements in list 4 that are common with the elements in list 5
>
> list4 = [['1', 'a'],['4', 'd'],['8', 'g']]
> list5 = ['1'
Alexnb wrote:
"hello"[0]
'h'
"hello"[0] == "<"
False
"hello"[0] == "h"
True
"hello".startswith("h")
True
really? That's just like C. I thought that it would fail because of the way
lists work. Thanks!
what way?
the first three will fail if the string is empty.
>>> ""[0]
Tra
Hi all
I have started experimenting with properties.
The example in the 2.5 docs uses an inconsistent mixture of single and
double underscores for the internal representation of the attribute. I
was going to file a documentation bug, but then I checked the 2.6 docs
online, and I see it has been f
Frank Millman wrote:
> I thought that the main point of using property was to prevent direct
> access to the attribute.
Not "prevent access to" as much as "add behaviour to".
Is this a valid comment, or does it come under the category of 'we are
all adults here'?
The latter. And the "__" do
Hello ,
Traceback (most recent call last):
File "C:\Python25\hadi_yahoo.py", line 12, in
file_source.write(urllib2.urlopen(req).read())
File "C:\Python25\lib\urllib2.py", line 124, in urlopen
return _opener.open(url, data)
File "C:\Python25\lib\urllib2.py", line 387, in open
res
Hello everybody,
I try to use Pmw library -> ScrollListBox. If I take the example of
the reference web site (see below, I just quote the minimal code to
launch, I note by <- the line which are not execute when I click)
It works, except selectioncommand and dblclickcommand: associate
function do
Jan Claeys wrote:
I'd say that PyGame could be a solution.
Or otherwise you could do your own audio/graphics programming (you don't
tell us which OS you use, but there exist python modules that allow you
to do barebones graphics & sound programming on linux...).
Yes, I'm using a very small L
spandana g wrote:
HTTPError: HTTP Error 999: Unable to process request at this time --
error 999
Previously i got the error which I have attached below when I use just
urlopen . But now when I use this http request
user_agent='Mozilla/3.0(compatible;MISE 5.5;Windows NT)'
headers={'User-Agen
On Jul 16, 7:01 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> In message
> <[EMAIL PROTECTED]>, Craig
>
> Allen wrote:
> > ... the ideal is still that
>
> > tl = TehLibrary() would always return the same object.
> >> class TehLibrary(object) :
>
> ... @classmethod
> they have an official API, you know:
>
> http://developer.yahoo.com/search/boss/
and yes, there are other options too, including pYsearch which is
available from their developer network:
http://developer.yahoo.com/python/python-pysearch.html
for more Python stuff from/for Yahoo, see
hello,
I've build a translation tool, to translate all strings in a python
source file.
As a extra gadget I added translation through Babel Fish,
using beautifulsoup.
Although it works functionally,
it can take lots of time waiting for the translation.
What I basically do is, after selecting
On Jul 17, 6:04 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Django's 0.91 release in early 1996
While I totally agree with position, I'm pretty sure you mean 2006
here :)
--
http://mail.python.org/mailman/listinfo/python-list
Chris wrote:
> Can anyone recommend a good HTML/XHTML parser, similar to
> HTMLParser.HTMLParser or htmllib.HTMLParser, but able to intelligently
> know that certain tags, like , are implicitly closed? I need to
> iterate through the entire DOM, building up a DOM path, but the stdlib
> parsers are
Hello everyone,
I'm storing functions in a dictionary (this is basically for cooking up
my own fancy schmancy callback scheme, mainly for learning purpose):
>>> def f2(arg):
... return "f2 " + arg
...
>>>
>>> def f1(arg):
... return "f1" + arg
...
>>> a={'1': f1, '2': f2}
>>>
>>> [ x[
Thanks for your reply
The apache log contains lines like :
[Tue Jul 15 23:31:01 2008] [notice] mod_python (pid=11836,
interpreter='www.toto.fr'): Importing module
'/usr/local/apache2/htdocs/intranet/courrier/test.py'
[Tue Jul 15 23:31:02 2008] [notice] child pid 11836 exit signal
Segmentation fau
ping the universal DNS ? (4.2.2.2)
-Venky
On Wed, Jul 16, 2008 at 1:17 AM, Jordan <[EMAIL PROTECTED]> wrote:
> On Jul 15, 3:43 pm, Alexnb <[EMAIL PROTECTED]> wrote:
> > Okay, I already made this post, but it kinda got lost. So anyway I need
> to
> > figure out how to test if the user is able
may be try to open a connection to 4.2.2.2 at port 53 ?
-vks
On Wed, Jul 16, 2008 at 12:13 AM, norseman <[EMAIL PROTECTED]> wrote:
>
> Grant Edwards wrote:
>
>> On 2008-07-15, Alexnb <[EMAIL PROTECTED]> wrote:
>>
>> What exactly do you think will work? I am not sure what you
>>> think I should
On 16 juil, 10:35, Stefan Scholl <[EMAIL PROTECTED]> wrote:
> Dave U. Random <[EMAIL PROTECTED]> wrote:
>
> >http://snipr.com/PracticalDjango
>
> June 2008 is a bit too early. Django isn't ready.
Oh, really ? Too bad. But, wait... If Django isn't ready, what's that
framework I've been using for al
On 17 Jul., 13:45, mk <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm storing functions in a dictionary (this is basically for cooking up
> my own fancy schmancy callback scheme, mainly for learning purpose):
>
> >>> def f2(arg):
> ... return "f2 " + arg
> ...
> >>>
> >>> def f1(arg):
>
On 16 juil, 11:06, zhw <[EMAIL PROTECTED]> wrote:
> On 7月16日, 下午4时47分, Ben Finney <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > zhw <[EMAIL PROTECTED]> writes:
> > > How can i use a variable without define it ?
>
> > What do you mean by "use"? That's so vague I can think of many
> > possible interpretatio
On 17 Jul., 00:20, Craig Allen <[EMAIL PROTECTED]> wrote:
>
> I have several classes in our system which need to act like
> singletons, they are libraries of data classifications, and other such
> libraries of configurations for the system which need to be global.
> ...
>
> Is it pythonic?
My appr
Dear Diez:
It is attaching a C-debugger to python. I can attach python-
debugger(for example:wingIDE) to c-debugger(for example:VS2008), but I
cannot attach VS2008 to wingIDE. I need both python statement and c
statement can be single-step debugged.
best regards
fang
--
http://mail.python.org/ma
Thanks, that made things very clear. I like that technique for adding
memoization via the parameter. That is clever. It would be nice if
there were a way to have multiple functions close over a shared local
variable in Python, like let-binding in lisp.
--
http://mail.python.org/mailman/listinfo/
On Jul 17, 9:45 pm, mk <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm storing functions in a dictionary (this is basically for cooking up
> my own fancy schmancy callback scheme, mainly for learning purpose):
>
> >>> def f2(arg):
> ... return "f2 " + arg
> ...
> >>>
> >>> def f1(arg):
On Thu, Jul 17, 2008 at 7:45 AM, mk <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm storing functions in a dictionary (this is basically for cooking up my
> own fancy schmancy callback scheme, mainly for learning purpose):
>
def f2(arg):
> ... return "f2 " + arg
> ...
def f1
On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am new to python. I am trying to use the python files given to me
> for bringing up a setup.
> I get the following error while trying to use a python file -
> AttributeError : Classroom instance has no attribute
Hallöchen!
[EMAIL PROTECTED] writes:
> On 16 juil, 10:35, Stefan Scholl <[EMAIL PROTECTED]> wrote:
>
>> Dave U. Random <[EMAIL PROTECTED]> wrote:
>>
>>> http://snipr.com/PracticalDjango
>>
>> June 2008 is a bit too early. Django isn't ready.
>
> Oh, really ? Too bad. But, wait... If Django isn't
BeautifulSoup. You need a good html parsing, not some one-shot code to
handle one tiny unflexable pattern.
On Thu, Jul 17, 2008 at 3:07 AM, Alexnb <[EMAIL PROTECTED]> wrote:
>
> Hello
>
> Lets say I have a string:
>
> --a href="/browse/brick"--brick--/a--
>
> The -- needs to be replaced with < or
D. J. Webre, Jr. PE & PLS
"Gabriel
Genellina"
<[EMAIL PROTECTED]
Hi,
Thank you very much. Your code is worked like a charm and saved my
honeymoon :)
Thanks again,
Evren
On Jul 4, 6:19 pm, [EMAIL PROTECTED] wrote:
> Evren Esat Ozkan napisa³(a):
>
>
>
>
>
> > Hello,
>
> > I'm trying to encrypt a string with RSA. But it needs to be compitable
> > with Dave's Ja
On 17 Jul., 10:01, Terry Carroll <[EMAIL PROTECTED]> wrote:
> I am trying to do something with a very large tarfile from within
> Python, and am running into memory constraints. The tarfile in
> question is a 4-gigabyte datafile from
> freedb.org,http://ftp.freedb.org/pub/freedb/, and has about 2
Calvin Spealman wrote:
To your actual problem... Why do you wanna do this anyway? If you want
to change the function in the dictionary, why don't you simply define
the functions you'll want to use, and change the one you have bound to
the key in the dictionary when you want to change it? In other
I'd say that PyGame could be a solution.
Or otherwise you could do your own audio/graphics programming (you don't
tell us which OS you use, but there exist python modules that allow you
to do barebones graphics & sound programming on linux...).
After some more reading I've stumbled over pygle
Stef Mientki gmail.com> writes:
> Although it works functionally,
> it can take lots of time waiting for the translation.
>
> What I basically do is, after selecting a new string to be translated:
>
> kwds = { 'trtext' : line_to_be_translated, 'lp' :'en_nl'}
> soup = BeautifulSoup (urlop
What does this operator do? Specifically in this context
test.log( "[[Log level %d: %s]]" % ( level, msg ), description )
(Tried googling and searching, but the "%" gets interpreted as an
operation and distorts the search results)
--
http://mail.python.org/mailman/listinfo/python-list
korean_dave wrote:
What does this operator do? Specifically in this context
test.log( "[[Log level %d: %s]]" % ( level, msg ), description )
(Tried googling and searching, but the "%" gets interpreted as an
operation and distorts the search results)
It's the string formatting operator:
h
fang wrote:
> Dear Diez:
>
> It is attaching a C-debugger to python. I can attach python-
> debugger(for example:wingIDE) to c-debugger(for example:VS2008), but I
> cannot attach VS2008 to wingIDE. I need both python statement and c
> statement can be single-step debugged.
AFAIK that's not possi
The percent sign is a placeholder.
For example, if
level = 1
msg = 'look'
Then
'[[Log level %d: %s]]' % ( level, msg )
becomes
'[[Log level 1: look]]'
%d means insert an integer
%s means insert a string
You can also use dictionaries.
d = {'string1': 'hey', 'string2': 'you'}
Then
'%(string1)s %(
Hi.
I'm newbie in Twisted.
Can anyone explain how does twisted server work? What happens after
reactor.listenTCP running?
I've got many connections from one client (one connection-one socket),
each of them is served by class serve(Protocol).
every protocol owns transport
every transport owns sock
mk wrote:
Calvin Spealman wrote:
To your actual problem... Why do you wanna do this anyway? If you want
to change the function in the dictionary, why don't you simply define
the functions you'll want to use, and change the one you have bound to
the key in the dictionary when you want to change i
Uwe Schmitt wrote:
Python stores references in dictionaries and does not copy ! (unless
you explicitly use the copy module) !
In your case the entry in the dictionary is a reference to the same
object which f1 references, that is the object at 0xb7f0ba04.
If you now say "f1=...:" then f1 refere
It seems like getter is defined in such way that it passes only 'self':
class FunDict(dict):
def __init__(self):
self.fundict = dict()
def fget(self, fun):
return fundict[fun.func_name]
def fset(self, newfun):
self.fundic
On Jul 17, 9:57 am, Thomas Troeger <[EMAIL PROTECTED]>
wrote:
> > I'd say that PyGame could be a solution.
>
> > Or otherwise you could do your own audio/graphics programming (you don't
> > tell us which OS you use, but there exist python modules that allow you
> > to do barebones graphics & sound
Dear Diez:
I see. I appreciate your help really.
best regards
fang
--
http://mail.python.org/mailman/listinfo/python-list
Chris wrote:
> Can anyone recommend a good HTML/XHTML parser, similar to
> HTMLParser.HTMLParser or htmllib.HTMLParser, but able to intelligently
> know that certain tags, like , are implicitly closed? I need to
> iterate through the entire DOM, building up a DOM path, but the stdlib
> parsers aren
def f2(arg):
return "f2 "+arg
def f1(arg):
return "f1 "+arg
a={"1":"f1","2":"f2"}
print [eval(x[1])(x[0]) for x in a.items()]
def f2(arg):
return "New f2 "+arg
print [eval(x[1])(x[0]) for x in a.items()]
Neat trick, if probably dangerous in some circumstances. Anyway, thanks,
I
Evren Esat Ozkan <[EMAIL PROTECTED]> writes:
> I'm trying to encrypt a string with RSA. But it needs to be compitable
> with Dave's JavaScript RSA implementation*.
What exactly are you trying to do? That Javascript implementation
looks like bad news. If you're trying to secure a web page, use S
Hello Chaps,
I have an unusual situation with my application which I've also seen once or
twice in the past but never found a solution too. Basically the application
stops properly reporting Exceptions when they are thrown.
My application logs extensively to a file using the python logging
I have looked through the application for any unusual or bare try/except
blocks that don’t actually do anything with the except just in case any
of them are causing the issue but can’t seem to see any.
Why not capture exceptions themselves to a log file?
http://aspn.activestate.com/ASPN/Cookbo
On Thu, 17 Jul 2008 06:14:45 -0700 (PDT), Uwe Schmitt
<[EMAIL PROTECTED]> wrote:
>I had a look at tarfile.py in my current Python 2.5 installations
>lib path. The iterator caches TarInfo objects in a list
>tf.members . If you only want to iterate and you are not interested
>in more functionallity
Hi Mk,
> Why not capture exceptions themselves to a log file?
>
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466332
Thanks for the reply mate, I appreciate you getting back to me so quickly.
I certainly like that implementation for logging the exceptions, however, at
the moment I do
Hi all,
probably a dumb question, but I didn't find something elegant for my
problem so far.
In perl you can unpack the element of a list to variables similar as
in python
(a, b, c = [0, 1, 2]), but the number of variables need not to fit the
number
of list elements.
That means, if you have less l
Greetings, Pythonistas!
My employer has a Squid Proxy between my Python programs and The
Internet.
I've searched high-and-low, and can only find examples online of how
to do basic authentication to connect TO an external Web Server, but
not how to go THROUGH a (corporate) Proxy, thus my question
Robert Rawlins wrote:
I certainly like that implementation for logging the exceptions, however, at
the moment I don't even know where the exceptions are occurring, or what
type they are, could I still use this method to log any and all exceptions
raised in the application?
Sure.
I'm a little
Say you have something like this:
for item in myList:
del item
Would this actually delete the item from the list or just decrement
the reference counter because the item in myList is not associated
with name "item" anymore (but still is with myList[itemIndex])? In
other words, is "item" a temp
McA wrote:
Hi all,
probably a dumb question, but I didn't find something elegant for my
problem so far.
In perl you can unpack the element of a list to variables similar as
in python
(a, b, c = [0, 1, 2]), but the number of variables need not to fit the
number
of list elements.
That means, if yo
Err, the line above should be:
proxy_handler = urllib2.ProxyHandler( { "http": "http://
myusername:[EMAIL PROTECTED]:3128" } )
(Sorry! :)
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 17 Jul 2008 09:27:27 -0700, Ratko wrote:
> for item in myList:
>del item
>
> Would this actually delete the item from the list or just decrement
> the reference counter because the item in myList is not associated
> with name "item" anymore (but still is with myList[itemIndex])? In
>
Ratko wrote:
Say you have something like this:
for item in myList:
del item
Would this actually delete the item from the list or just decrement
the reference counter because the item in myList is not associated
with name "item" anymore (but still is with myList[itemIndex])? In
other words, i
Hi MK,
>>Robert Rawlins wrote:
>>
>> I certainly like that implementation for logging the exceptions, however,
at
>> the moment I don't even know where the exceptions are occurring, or what
>> type they are, could I still use this method to log any and all
exceptions
>> raised in the application?
Gary Herron wrote:
You could remove the object from the list with
del myList[i]
if you knew i. HOWEVER, don't do that while looping through the list!
Changing a list's length will interact badly with the for loop's
indexing through the list, causing the loop to mis the element following
the
On Jul 17, 9:57 am, mk <[EMAIL PROTECTED]> wrote:
> Gary Herron wrote:
> > You could remove the object from the list with
> > del myList[i]
> > if you knew i. HOWEVER, don't do that while looping through the list!
> > Changing a list's length will interact badly with the for loop's
> > indexing t
http://linux.byexamples.com/archives/365/python-convey-the-exception-traceba
ck-into-log-file/
if __name__=="__main__":
try:
main()
except:
print "Trigger Exception, traceback info forward to log file."
traceback.print_exc(file=open("errlog.txt","a"))
> That's seriously weird. What's your Python version and platform? On my
> Windows and Linux machines, with more recent Python versions the above
> trick works flawlessly.
>
> Check your environment, namely PYTHON* variables. There may be something
> causing this behaviour. Unset them.
>
> Check
mk <[EMAIL PROTECTED]> wrote:
> Iterating over a copy may _probably_ work:
>
> >>> t=['a', 'c', 'b', 'd']
> >>>
> >>> for el in t[:]:
> del t[t.index(el)]
>
>
> >>> t
> []
>
>
> However, is it really safe? Defining safe as "works reliably in every
> corner case for every indexable
On 17 Jul., 18:33, Gary Herron <[EMAIL PROTECTED]> wrote:
>
> In Python 2.x, you can't do that directly, but you should be able to
> create a function that lengthens or shortens an input tuple of arguments
> to the correct length so you can do:
>
> a,c,b = fix(1,2)
> d,e,f = fix(1,2,3,4)
>
> Ho
I don't understand what you're trying to do here.
On Thu, Jul 17, 2008 at 10:57 AM, mk <[EMAIL PROTECTED]> wrote:
>
> It seems like getter is defined in such way that it passes only 'self':
>
>
> class FunDict(dict):
>def __init__(self):
>self.fundict = dict()
>
>d
On Jul 17, 8:27 am, Jeff <[EMAIL PROTECTED]> wrote:
> Thanks, that made things very clear. I like that technique for adding
> memoization via the parameter. That is clever. It would be nice if
> there were a way to have multiple functions close over a shared local
> variable in Python, like let-
On 17 Jul., 17:55, Terry Carroll <[EMAIL PROTECTED]> wrote:
> On Thu, 17 Jul 2008 06:14:45 -0700 (PDT), Uwe Schmitt
>
> <[EMAIL PROTECTED]> wrote:
> >I had a look at tarfile.py in my current Python 2.5 installations
> >lib path. The iterator caches TarInfo objects in a list
> >tf.members . If you o
>> That's seriously weird. What's your Python version and platform? On my
>> Windows and Linux machines, with more recent Python versions the above
>> trick works flawlessly.
>>
>> Check your environment, namely PYTHON* variables. There may be
>> something causing this behaviour. Unset them.
>>
On 2008-07-16 20:00, Keith Hughitt wrote:
Thanks Gabriel!
That helps clear things up for me. The above method works very well. I
only have one remaining question:
How can I pass a datetime object to MySQL?'
So far, what I've been doing is building the query as a string, for
example:
query = "I
McA wrote:
On 17 Jul., 18:33, Gary Herron <[EMAIL PROTECTED]> wrote:
In Python 2.x, you can't do that directly, but you should be able to
create a function that lengthens or shortens an input tuple of arguments
to the correct length so you can do:
a,c,b = fix(1,2)
d,e,f = fix(1,2,3,4)
H
Ratko wrote:
On Jul 17, 9:57 am, mk <[EMAIL PROTECTED]> wrote:
Gary Herron wrote:
You could remove the object from the list with
del myList[i]
if you knew i. HOWEVER, don't do that while looping through the list!
Changing a list's length will interact badly with the for loop's
indexin
1 - 100 of 158 matches
Mail list logo