Re: Now what!?

2008-05-12 Thread Marco Mariani
notbob wrote: frustrated and give up on learning programming, not really caring much for coding, anyway. But, dammit, I'm gonna stick with it this time. I'll learn python if it kills me! No, it won't kill you but make you stronger ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Some comparison operators gone in Python 3.0?

2008-05-13 Thread Marco Mariani
[EMAIL PROTECTED] wrote: Is that true that this comparison operators are gone in Python 3.0: <(is less than) (is greater than) <= (is less than or equals) = (is greater than or equals) Is it true? Nope. -- http://mail.python.org/mailman/listinfo/python-list

Re: array in class

2008-05-13 Thread Marco Mariani
alefajnie wrote: class B: this_is_common_for_all_instances = [] def __init__(self, v): self.this_is_common_for_all_instances.append(v) now I can create some instances of B, but all of them have the same array, why Because you didn't reassign the attribute 'this_is_

Re: The 'is' identity operator checking immutable values caution

2008-05-13 Thread Marco Mariani
[EMAIL PROTECTED] wrote: We have to avoid the use of the 'is' identity operator with basic, immutable values such as numbers and strings. I'm glad for you. Did you really write checks like "if foo is 27" ? The point is, you have to learn technologies to use them. It's not like technologies l

Re: Some comparison operators gone in Python 3.0?

2008-05-13 Thread Marco Mariani
alex23 wrote: Given that all nine of his postings have inflammatory topics, he's beginning to sound like a troll. Thank you, I couldn't decide if he was silly or nasty. Now I know he's both. -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie: some surprises

2008-05-15 Thread Marco Mariani
Kees Bakker wrote: So far, I have seen only one editor that understands the difference between TABs and indentation, and that is Emacs. Oh, well... in .vimrc: autocmd FileType python set tabstop=8 autocmd FileType python set softtabstop=4 autocmd FileType python set expandtab --

fafdasf

2008-05-20 Thread marco furchi
asdfdg-- http://mail.python.org/mailman/listinfo/python-list

BeautifulSoup: problems with parsing a website

2008-05-28 Thread Marco Hornung
Hy guys, I'm using the python-framework BeautifulSoup(BS) to parse some information out of a german soccer-website. I spend some qualitiy time with the BS-docs, but I couldn't really figure out how to get what I was looking for. Here's the deal: I want to parse the article shown on the website. T

Python on Gcc llvm

2008-06-24 Thread Marco Bazzani
I would like to point you to this post readed some days ago got from planet python I search inside this group but I didn't find anything related (am I wrong?) anyway here it is, http://sayspy.blogspot.com/2008/06/i-cant-build-python-using-llvm.html I've more or less the same questions reported in t

Re: [OT] troll poll

2008-04-01 Thread Marco Mariani
Daniel Fetchinson wrote: > This is a quick poll to have scientific data on our beloved troll community: > > Whose trolling behaviour is more professional? (check one) You forgot to mention Ilias Lazaridis. He needs to be Analyzed and Evaluated, too. -- http://mail.python.org/mailman/listinfo

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Marco Mariani
Steve Holden wrote: >> the XML file is almost a TB in size... >> > Good grief. When will people stop abusing XML this way? Not before somebody writes a clever xmlfs for the linux kernel :-/ -- http://mail.python.org/mailman/listinfo/python-list

Re: splitting an XML file on the basis on basis of XML tags

2008-04-03 Thread Marco Mariani
Marco Mariani wrote: >>> the XML file is almost a TB in size... >>> >> Good grief. When will people stop abusing XML this way? > > Not before somebody writes a clever xmlfs for the linux kernel :-/ Ok. I meant it as a joke, but somebody has been there

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: > sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p > in m.split('@')]) Pff... you call that a quicksort? From http://www.p-nand-q.com/python/obfuscated_python.html import sys funcs = range(10) def A(_,o): _[3]=_[5]() def B(_,o):

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: > sig=lambda m:'@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p > in m.split('@')]) Pff... you call that a quicksort? From http://www.p-nand-q.com/python/obfuscated_python.html import sys funcs = range(10) def A(_,o): _[3]=_[5]() def B(_,o):

Re: who said python can't be obsfucated!?

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: >> Pff... you call that a quicksort? >> > Nope, only somewhat obfuscated Python. And it seems it's at least > obfuscated enough for you to believe it could be a quicksort > implementation !-) You're right, but I'm past the quine age and don't bother parsing obfuscate

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Tim Golden wrote: > I've recently used Elixir and found it very useful for a small-scale > database with no more than a dozen tables, well-structured and > easily understood. I'd certainly use it again for anything like that > to save me writing what would amount to boilerplate SQL. But I'd > hate

Re: object-relational mappers

2008-04-03 Thread Marco Mariani
Bruno Desthuilliers wrote: >> A simple select query would be db.select('customers') or >> db.select('customers', name='John'). >> But you can also resort to plain sql as follows: db.query('select * >> from customers where name = "John"'). >> >> Simple, effective and doesn't get in your way. > > S

PyGtk Windows all in one installer

2008-04-06 Thread Marco Bonifazi
installers: http://www.bonifazi.eu/appunti/2008/04/pygtk-all-in-one-installer.html I'll try to keep update this installer. I hope it could be useful to someone. Bye. Marco Bonifazi -- http://mail.python.org/mailman/listinfo/python-list

Re: Java or C++?

2008-04-14 Thread Marco Mariani
[EMAIL PROTECTED] wrote: > Which one do you think will educate me the best? Advanced javascript might teach you something too, and be very useful at the same time. Take a look at the Crockford lessons on Yahoo! Video. http://video.yahoo.com/watch/111593 http://video.yahoo.com/watch/111594 htt

Re: 答复: Java or C++?

2008-04-14 Thread Marco Mariani
Penny Y. wrote: > Javascript is different from Java at all. I think even rocks know that. Yet, some use of closure and prototype-based inheritance might be interesting to the OP. > Why not Perl? Come on, learning Perl after two years of Python? How harsh. > Perl is a functional language, And

Re: py3k s***s

2008-04-16 Thread Marco Mariani
Aaron Watters wrote: > stuff out there you can get so easily -- all the stuff that py3k > will break -- most of which won't get ported -- and if it does can > we be sure it will be tested properly? No, probably you will end > up beta testing someone's quick port of what used to be rock > solid co

Re: I just killed GIL!!!

2008-04-17 Thread Marco Mariani
Torsten Bronger wrote: >>> If I were you I would keep it a secret until a Hollywood producer >>> offers big bucks for the film rights. >> Who would play Guido, I wonder? > > Ralf Möller. No other. And the GIL killer? Clive Owen, Matt Damon, Mark Wahlberg? -- http://mail.python.org/mailman/lis

Re: Can't do a multiline assignment!

2008-04-17 Thread Marco Mariani
[EMAIL PROTECTED] wrote: > Yes, it makes it more readable. And yes, it does make it (a lot) more > maintainable. Mainly because I don't have those four variables, I have > about thirty. And I think I won't need to one or two of them, but > maybe all of them at once. have fun with locals(), then (

Re: Python Success stories

2008-04-22 Thread Marco Mariani
azrael wrote: Please give me any arguments to cut him down about his commnets like :"keep programing i python. maybe, one day, you will be able to program in VisualBasic" This hurts. Please give me informations about realy famous aplications. He's joking. Perl is a dysfunctional language and

Re: Zope/DTML Infuriating...

2008-04-29 Thread Marco Mariani
Jens wrote: I've the checked that i'm referring to the variables correctly, so the only explanation i can come up with, is that '+' doesn't result in a string concatenation (with implicit typecast to string of the integer variable(this is a interpreted language after all)). No, sorry. You real

Re: Zope/DTML Infuriating...

2008-04-29 Thread Marco Mariani
Jens wrote: You might have wrong assumptions from previous PHP experiences. >>> 'x'+4 Traceback (most recent call last): File "", line 1, in TypeError: cannot concatenate 'str' and 'int' objects > ... and the non snobby answer would have been: ... Sorry. Not trying to be snobbish,

Re: Zope/DTML Infuriating...

2008-04-29 Thread Marco Mariani
Jens wrote: Hey no worriest. Is this the tutorial you're referring to: http://docs.python.org/lib/typesmapping.html Is there anything better? That's the library reference - the one to keep under the pillow. It also documents the core -- i.e. builtin objects. As for the language semantics,

Re: computing with characters

2008-04-30 Thread Marco Mariani
Torsten Bronger wrote: However, join() is really bizarre. The list rather than the separator should be the leading actor. No, because join must work with _any sequence_, and there is no "sequence" type to put the join method on. This semantic certainly sets python apart from many other lang

Re: Decimal vs Float comparasion

2008-05-06 Thread Marco Mariani
Gasto wrote: > I still don't see why such a module exists. There are 2.0 types of programmers: those who always use floating point, and those who know how to use them. -- http://mail.python.org/mailman/listinfo/python-list

Re: parameters to lambda's executed at run time.

2008-05-06 Thread Marco Mariani
Boris Borcic wrote: One way : >>> from functools import partial >>> def func(item) : print item >>> llist = [partial(func,item) for item in range(5)] >>> for thing in llist : thing() 0 1 2 3 4 Another way: class Func(object): def __init__(self, item): self.item = item

Re: sed to python: replace Q

2008-05-06 Thread Marco Mariani
Raymond wrote: Aren't sed, awk, grep, and perl the reference implementations of search and replace? I don't know about "reference implementations", but I daresay they are a mess w.r.t. usability. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Duncan Booth wrote: It does this: @greedy def getCommandsFromUser(): while True: yield raw_input('Command?') for cmd in getCommandsFromUser(): print "that was command", cmd Command?hello Command?goodbye that was command hello Comma

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Marco Mariani wrote: Not here.. Oh, sorry, I obviously didn't see the @greedy decorator amongst all the quoting levels. Anyway, the idea doesn't make much sense to me :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Duncan Booth wrote: Perhaps if you'd copied all of my code (including the decorator that was the whole point of it)... Sure, I missed the point. Python's > symbols become quoting levels and mess up messages. Anyway, I would loathe to start execution of a generator before starting to iterat

Re: "prove"

2008-05-08 Thread Marco Mariani
Lucas Prado Melo wrote: How could I "prove" to someone that python accepts this syntax using the documentation (I couldn't find it anywhere): classname.functionname(objectname) TUtorial 9.3.4, method objects What exactly happens when a method is called? You may have noticed that x.f() was ca

source beautifier

2008-05-08 Thread Marco Mariani
Is there a program (free, payware, whatever) like polystyle for linux/python? http://www.polystyle.com/features/python-beautifier.jsp I've never used it, but the example is quite clear. I just need it for python -- but it should not force me to use PEP8. -- http://mail.python.org/mailman/lis

Re: How to kill Python interpreter from the command line?

2008-05-08 Thread Marco Mariani
[EMAIL PROTECTED] wrote: The default way of killing the current process on the command line is Ctrl+C, but that doesn't work with Python. It should work. Do you have a bare except: which intercepts SystemExit as well? If so, be as specific as possible in what you intercept, or at least catc

Re: Display the results of a query to an html table

2008-08-19 Thread Marco Nawijn
://www.sqlalchemy.org/ These can assist in translating SQL query results into Python objects. For generating the html forms and tables out of the sql results data you can try: genshi: http://genshi.edgewall.org/ kid: http://www.kid-templating.org/ I hope this helps. Marco -- http://ma

Re: Python and database unittests

2008-08-27 Thread Marco Bizzarri
hould help you here: > > http://python-mock.sourceforge.net/ > > There's even an example on that page for mocking a database. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Marco Bizzarri http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and database unittests

2008-08-27 Thread Marco Bizzarri
ainful, and leads you to frustration when the actual SQL and the generated SQL do not match. Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and database unittests

2008-08-27 Thread Marco Bizzarri
atabase (or whatever external resource you want to access), and, after that, it should be transparent for you, more or less. Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie needs help

2008-08-27 Thread Marco Bizzarri
On Tue, Aug 26, 2008 at 8:33 PM, frankrentef <[EMAIL PROTECTED]> wrote: > > Would the second file need something akin to... > > loginout.admin (ie,url,adminlogin) Yes. Since you're importing the whole module. -- Marco Bizzarri http://iliveinpisa.blogspot.com/ --

Re: Python and database unittests

2008-08-27 Thread Marco Bizzarri
On Wed, Aug 27, 2008 at 10:26 AM, Simon Brunning <[EMAIL PROTECTED]> wrote: > 2008/8/27 Marco Bizzarri <[EMAIL PROTECTED]>: >> I strongly disagree on using mocks for a database; checking sequences >> of SQL statement is fragile, painful, and leads you to frustration >

Re: problem with packages and path

2008-08-28 Thread Marco Bizzarri
d. However, when I execute the code from the command line, I > get the following error: > > ImportError: No module named mypackage.unittests.test1 > 1) What is the command you're using to run the alltest.py module? 2) what is the result of: - python -c

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
o/python-list > Have you tried to use ldd against the _libfoo.so to check if it is able to get all the libraries it needs? Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
a flat module) or from package.subpackage import module and then use module.MyClass (( for a package/subpackage structure )) Thank you all for your attention Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ http://notenotturne.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
her possibility, which you can check googling a little, is that you've two different versions of the libarary around your system, and that you're loading the wrong one (i.e., python is looking at the wrong one) again, setting the LD_LIBRARY_PATH should help Regards Marco On Sat, Aug 30,

Re: __stack_chk_fail_local

2008-08-30 Thread Marco Bizzarri
m, also, because I think it has to do with your setup (not that you setup something in the wrong way: just to have context). Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
ks Fredrik; I understand that is the underlying message of your article. I'm just confused because PEP8 seems to suggest that the from module import Class style is acceptable; is there a big "if you know what are doing" before, which I'm unable to see? Regards Marco --

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
nction/method (or even in > their argument list, but that's a hack to be used only once in a > while): > localname = somemodule.somename > > Bye, > bearophile > -- > http://mail.python.org/mailman/listinfo/python-list > Thanks again for sharing your thoughts with

Re: Advice on the style to use in imports

2008-08-30 Thread Marco Bizzarri
mport datetime # This might be a bad idea... I haven't > had problems yet though. datetime.datetime gets on my nerves though. > > just my .02 > > Eric > -- > http://mail.python.org/mailman/listinfo/python-list > Thanks Eric; your 02 cents are worthy for me ;) Regards Marco -- Marco Bizzarri http://iliveinpisa.blogspot.com/ http://notenotturne.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to ms excel

2008-08-30 Thread Marco Bizzarri
will be calculated in the process). > I've been searching, but couldn't find any examples which allows that. Is it suitable for you to use a python program talking with a running instance of openoffice? in that case, pyuno could help you. -- Marco Bizzarri http://notenotturn

Re: Counting Elements in an xml file

2008-08-30 Thread Marco Bizzarri
> > Does anyone have any experience with this sort of thing? If so, could > you suggest a good library and possibly some samples? Isn't the SAX part of this howto http://pyxml.sourceforge.net/topics/howto/xml-howto.html enough for you to create your parser? Regards Marco -- M

Re: Retrieving http headers from HTTPConnection object

2008-09-01 Thread Marco Bizzarri
oes the HTTPConnection object have a property that stores this ? > or is it retrievable by some other form? > > Thanks a lot. > -- Looking at the code of HTTPConnection, all that goes through the _output message (including, therefore, the putheaders) are appended to the self._buffer l

Re: How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread Marco Bizzarri
in your snippet of code, if encoding is latin1, at least for what I can understand. Do not assume utf8 is a two byte encoding; utf8 is a variable length encoding. Indeed, 'a' encoded as utf8 is 'a' (one byte) 'à' encode as utf8 is '\xc3\xa0'

Re: How to print first(national) char from unicode string encoded in utf-8?

2008-09-01 Thread Marco Bizzarri
encode('utf8') I'm assuming here that the urlib.unquote(c.user.firstName) returns an encodable string (which I'm absolutely not sure), but if it does, this should take the first 'character'. Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Using httplib to access servlets on tomcat server

2008-09-03 Thread Marco Bizzarri
error: > > socket.gaierror: (11001, 'getaddrinfo failed') > > Do you know what I do wrong? > Thank you very much. > > localhost is not resolved to 127.0.0.1 on your machine. Try changing it to http://127.0.0.1:8080 Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python IDEs with F5 or hotkey shell interaction

2008-09-03 Thread Marco Bizzarri
st? > -- > http://mail.python.org/mailman/listinfo/python-list > I do not think I qualify for experienced users; I've used pydev for many years, and I'm quite comfortable with it. It is an eclipse based IDE, therefore you've some of its niceties and some of its dra

Re: overwrite set behavior

2008-09-04 Thread Marco Bizzarri
source, maybe you could create a subclass of Set redefining the __contains__ method? Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: overwrite set behavior

2008-09-04 Thread Marco Bizzarri
s, > Wojtek Walczak, > http://tosh.pl/gminick/ > -- > http://mail.python.org/mailman/listinfo/python-list > Saluti Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Coming from .NET and VB and C

2008-09-04 Thread Marco Bizzarri
plication. Using Python. I found "Dive >> Into Python" which I will be reading shortly. >> >So one question: what RDBMs are supported in that space? The appearance is not an RDBMS, at least, maybe it is, but under the surface. Looks more that y

Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
Let's say I've a class a, where I can write: -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 1:00 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Marco Bizzarri wrote: > >> Let's say I've a class a, where I can write: > > Anticipating this obviously premature posting: > > http://dirtsimple.org/2004/12/python-is-not-java.htm

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
r all, if it is wrong, I can move to a language like Java, which has a different approach on it. I'm really very interested in reading past discussion on it, if they are available. Regards Marco On Thu, Sep 4, 2008 at 12:57 PM, Marco Bizzarri <[EMAIL PROTECTED]> wrote: > Let's sa

Re: Coming from .NET and VB and C

2008-09-04 Thread Marco Bizzarri
org/mailman/listinfo/python-list > Thanks for the pointer, Bruno... I wrote from my memory, but there is some bank of it which need quick replace ;) -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: overwrite set behavior

2008-09-04 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 3:07 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le Thursday 04 September 2008 14:31:23 Michele Petrazzo, vous avez écrit : >> Marco Bizzarri wrote: >> > looking at the source, maybe you could create a subclass of Set >> > redefining th

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 1:19 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > What you are essentially asking is: why is python dynamic instead of static? > Most probably you're right. Maybe I will make a trip back to my university books and take a look at them aga

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 4:39 PM, Marco Bizzarri <[EMAIL PROTECTED]> wrote: > > Most probably you're right. Maybe I will make a trip back to my > university books and take a look at them again :-) > Meant: you *are* right. Sorry. Saluti Marco -- Marco Bizzarri http://no

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 2:43 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Well, Bruno, it looks like I've to wider my search in order to read something about it. Thanks for your suggestions, in any case. Regards Marco -- Marco Bizzarri http://notenotturne.blogspo

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-04 Thread Marco Bizzarri
re, if I want them, I will go for Java, or some other language like that. I understand that Python is a balance between different forces (like any software object around the world) and I'm simply asking some pointers to the discussion leading to this balance. That's all. -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding the pythonic way: why a.x = 1 is better than a.setX(1) ?

2008-09-05 Thread Marco Bizzarri
typo. > > > -- > Stand Fast, > tjg. [Timothy Grant] > Right; that is one of the things I try to do to avoid this sort of problems. -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Core dumped while interacting with OpenOffice.org via pyuno

2008-09-05 Thread Marco Bizzarri
a debug-enabled python in order to have more meaningful backtraces? - is there something else I should do in order to have more clues ("Read The Fine Manual (tm)" is an acceptable answer) Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/

Re: Core dumped while interacting with OpenOffice.org via pyuno

2008-09-05 Thread Marco Bizzarri
On Fri, Sep 5, 2008 at 3:50 PM, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le Friday 05 September 2008 15:04:22 Marco Bizzarri, vous avez écrit : >> Hi all. >> >> I'm experiencing a core dump while working in the following environment >> >> - debain

Re: use str as variable name

2008-09-05 Thread Marco Bizzarri
On Thu, Sep 4, 2008 at 10:47 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > (...as Bruno implies, setattr(), len() et al can be and should be viewed as > generic functions. Just a question: "generic functions" are not meant in the sense of "generic functions&qu

Re: use str as variable name

2008-09-05 Thread Marco Bizzarri
On Fri, Sep 5, 2008 at 9:16 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Marco Bizzarri a écrit : >> >> Just a question: "generic functions" are not meant in the sense of >> "generic functions" of CLOS, am I right? > > Nope. Ju

Re: use str as variable name

2008-09-05 Thread Marco Bizzarri
On Sat, Sep 6, 2008 at 7:52 AM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Marco Bizzarri wrote: > >>> (...as Bruno implies, setattr(), len() et al can be and should be viewed >>> as >>> generic functions. >> >> Just a question: "gene

Adding further report options to unittest.py

2008-09-10 Thread Marco Bizzarri
%s " % self.testsRun) _TextTestResult.startTest(self, test) now, of course, this is ugly, because I'm using _TextTestResult, which I'm not supposed to know, and I'm changing behaviour by subclassing, which is not exactly what I would like to do. What is the pythonic way to accompl

Re: Presenting calculation results

2008-09-10 Thread Marco Bizzarri
point me in the right > direction from where to start? > > Thanks in advance! > -- > http://mail.python.org/mailman/listinfo/python-list > http://www.modpython.org/ Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding further report options to unittest.py

2008-09-10 Thread Marco Bizzarri
On Wed, Sep 10, 2008 at 3:25 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Marco Bizzarri wrote: > >> Hi all. >> >> I would like to change the way test reports are generated, in a Zope >> environment. >> > > Have you looked at nosetests? Nose

Re: Python and Open Office

2008-09-10 Thread Marco Bizzarri
noffice; you could try to get the OpenOffice.org developers guide and the SDK, and check it (but it is not a little work) Regards Marco > Thanks > > --greg > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Open Office

2008-09-11 Thread Marco Bizzarri
actively mantained and used in a big software project. And, also, it should be quite easy to extend in order to have your custom functions run via XML-RPC. Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo

Checking the boolean value of a collection

2008-09-12 Thread Marco Bizzarri
True return False Before devising my own solution for this kind of problem, I wonder if there is a common solution for the problem. I'm looking for a python2.3 solution. Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.o

Re: Checking the boolean value of a collection

2008-09-12 Thread Marco Bizzarri
On Fri, Sep 12, 2008 at 4:09 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Marco Bizzarri schrieb: >> >> Hi all. >> >> In many parts of my code I've the following schema of code: >> >>def isInUseByOutgoingRegistratio

Re: Checking the boolean value of a collection

2008-09-12 Thread Marco Bizzarri
> ... return True > ... > > Diez > -- > http://mail.python.org/mailman/listinfo/python-list > Thanks for the clarification, Diez! Indeed, I tried python2.3 and python2.4, and of course not python2.5 ;) I would like to make this available to the whole project. I suspect I

Re: Checking the boolean value of a collection

2008-09-12 Thread Marco Bizzarri
20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def any(iterable): pass ... >>> any(x for x in [1, 2, 3]) File "", line 1 any(x for x

Re: Checking the boolean value of a collection

2008-09-13 Thread Marco Bizzarri
On Fri, Sep 12, 2008 at 6:07 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Marco Bizzarri a écrit : > (snip) >> >> I'm afraid this have another problem for me... >> >> >> [EMAIL PROTECTED]:/var/local/zope28/porting/Products/PAFlow$ pytho

Re: Checking the boolean value of a collection

2008-09-13 Thread Marco Bizzarri
able, like: specification = FolderInUse(core) if specification.true_for(folder): ... Any thought about this? Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

code style and readability [was: Re: Checking the boolean value of a collection]

2008-09-13 Thread Marco Bizzarri
On Sat, Sep 13, 2008 at 4:11 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Marco Bizzarri wrote: > >> class FolderInUse: > >> >> >>def true_for(self, archivefolder): >>return any([instance.f

Re: Code example that will make a Skype connection?

2008-09-13 Thread Marco Bizzarri
e the connection is > made. > > Maybe you can find this useful? https://developer.skype.com/wiki/Skype4Py/examples/s4p_call_py Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion gotcha?

2008-09-14 Thread Marco Bizzarri
acc=0): >if len(xs) == 0: >acc >else: >suma(xs[1:], acc+xs[0]) You're just missing the "return" statements? def suma(xs, acc=0): if len(xs) == 0: return acc else: return suma(xs

Re: recursion gotcha?

2008-09-14 Thread Marco Bizzarri
On Sun, Sep 14, 2008 at 10:08 AM, Marco Bizzarri <[EMAIL PROTECTED]> wrote: > On Sun, Sep 14, 2008 at 10:01 AM, cnb <[EMAIL PROTECTED]> wrote: >> this recursive definition of sum thrumped me, is this some sort of >> gotcha or am I just braindead today? >> and yes

Re: how can I use a callable object as a method

2008-09-18 Thread Marco Wahl
Piotr Sobolewski <[EMAIL PROTECTED]> writes: > I would like to use a callable object as a method of a class. So, when I > have such normal class: > > I want to change it to something like that: > > class add: > def __call__(self, another_self): > return another_self.version

Re: Zsi interoperability

2008-09-18 Thread Marco Bizzarri
On Thu, Sep 18, 2008 at 7:10 PM, Dieter Maurer <[EMAIL PROTECTED]> wrote: > "Marco Bizzarri" <[EMAIL PROTECTED]> writes on Mon, 15 Sep 2008 20:26:27 > +0200: >> On Mon, Sep 15, 2008 at 8:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> > Mailing

Re: Launching a subprocess without waiting around for the result?

2008-09-19 Thread Marco Bizzarri
;m curious how this can be done, does anyone know this? > > Almar > > -- > http://mail.python.org/mailman/listinfo/python-list > First result in "making a daemon in python with google": http://mail.python.org/pipermail/python-list/2007-February/427692.html (not tested)

API/C memory mananegemnt problem

2006-03-10 Thread Marco Fumana
Thank for your help. I have try to follow your suggestion but I seem to fail. Now my C-module (call it C_Core) code is: *** /* create_list function */ int size=1000; output=(double *) calloc(size, sizeof(double)); py_output=PyList_New(0); for(i=0;

From Python to c++

2006-03-21 Thread Marco Aschwanden
I know no one who was able to. - I cannot write (*sigh*) the app in Python. Any suggestions are very welcome! Regards, Marco (Forced to code in c++ again let me estimate the simplicity of python) -- http://mail.python.org/mailman/listinfo/python-list

Re: From Python to c++

2006-03-22 Thread Marco Aschwanden
er way. But the program below > works and seems like it may be what you are asking for. Perfect! That is precisely what I was looking for. I can easily adapt it for my needs! Thanks a lot. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: From Python to c++

2006-03-22 Thread Marco Aschwanden
Heck! I received 1 useless answer in comp.lang.c++ and here I get useful links/hints and even a code-pattern! Great. Thank you all. Sorry for posting a c++-problem here, but it was derived from my thinking the Python way... Cheers, Marco -- http://mail.python.org/mailman/listinfo/python

Re: imap folder scanner

2006-03-24 Thread Marco Carvalho
On 3/24/06, Sebastjan Trepca <[EMAIL PROTECTED]> wrote: > m.select('myfolder') Some attention is required here to retrieve subfolders. Some imap servers like Cyrus and Courier uses "INBOX.subfolder" to access subfolders. -- Marco Carvalho (macs) | marcoacarvalho(

Re: a question on re

2006-03-31 Thread Marco Wahl
Could you please reveal your value for text-string 'something'? Further I suggest to replace the 'do something'-parts with 'print 42'. Best wishes Marco -- http://mail.python.org/mailman/listinfo/python-list

<    2   3   4   5   6   7   8   >