Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Gregor Horvath
Paul Rubin schrieb: > > Name mangling is a poor substitute for private variables. If you want > to be able to share private variables with other classes under certain > circumstances, it's better to use something like C++'s "friend" > declaration, where you can export the variables to a specific

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Gregor Horvath
Paul Rubin schrieb: > Gregor Horvath <[EMAIL PROTECTED]> writes: > >>>to be able to share private variables with other classes under certain >>>circumstances, it's better to use something like C++'s "friend" >>>declaration, where you ca

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Gregor Horvath
Paul Rubin schrieb: > allowed to do that--that's why the variable is private. Is he > supposed to get your permission every time he wants to change how the > private variables in his class work? > No, but the assumption here is that the maintainer / designer of a class alaways knows everything

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Gregor Horvath
Paul Rubin schrieb: > > Huh? If my car has a "feature" that lets someone blow it to > smithereens from hundreds of miles away without even intending to, > that's somehow an advantage? I would not accept a car that does constraint my driving directions. I want to drive for myself, because its f

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Gregor Horvath
Paul Rubin schrieb: > > If you don't want the compiler to make sure your private instance > variables stay private, then don't declare them that way. You're the > one asking for less flexibility. I want to declare them as privat, but want to give the flexibilty to access them at the users own

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Gregor Horvath
Paul Rubin schrieb: > > You could have a "friend" declaration like in C++, if you want to let > some class see the private instance variables of another class. Everything is said on this topic. There are two ligitimate solutions to the problem of private instance variables. Its a matter of tas

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Gregor Horvath
Paul Rubin schrieb: > Bill Mill <[EMAIL PROTECTED]> writes: > >>Python is for consenting adults. > > Python might be for consenting adults, but multi-person software > projects are supposed to be done in the workplace, not the bedroom. Are the numerous working python open source projects not mul

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Gregor Horvath
Paul Rubin schrieb: > > I don't know of a single program that's actually relying on the > non-enforcement. I've asked for examples but have only gotten > theoretical ones. As far as I can tell, the feature is useless. Real open source live example from yesterdays mailinglists: quick question:

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Gregor Horvath
Paul Rubin schrieb: > Gregor Horvath <[EMAIL PROTECTED]> writes: > >>Real open source live example from yesterdays mailinglists: > > > I don't see any use of name mangling in that example. Someone has a problem and tweaks a private variable as a workaround.

Re: Will python never intend to support private, protected and public?

2005-09-30 Thread Gregor Horvath
Paul Rubin wrote: > Gregor Horvath <[EMAIL PROTECTED]> writes: >>Someone has a problem and tweaks a private variable as a workaround. > > They should have patched the source instead. > I think they are going to do that. In the meantime our friend has a working sol

Re: Will python never intend to support private, protected and public?

2005-10-02 Thread Gregor Horvath
El Pitonero schrieb: > > The fact that you can override Python's "list()" function can be either > viewed as pro or con. The fact that you can override member variables > can also be viewed as pro or con. > If there is a tool like pyChecker, which can detect such pitfalls and warns but not forb

Re: Reaching the real world

2005-01-04 Thread Gregor Horvath
Hi, I have just written a python module to program the M232 measurement unit from elv. It has 8 digital I/O and 6 analog ports (0-5V). Works fine, although it is a little bit slow (0,2 s to measure) Furthermore the digital ports do not have enough power to switch a relay directly, I had to do it

HTML table input data grid

2005-01-04 Thread Gregor Horvath
Hi, I googled for a possibilty to create a html table where the user can input data. I just found this site: http://www.codeproject.com/aspnet/I3HTree2.asp That is what I am looking for. Is there an existing solution for python? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

HTML Tree View with and

2005-01-27 Thread Gregor Horvath
Hi, Before I reinvent the wheel I`d like to ask if someone has done this before since I did not find an advice at Google. The goal is to create a dynamic Tree View in HTML. Say I have a data strucure like this: structList = {'Sun':{'Sun.1':['Sun1.1','Sun1.2'],'Sun.2':['Sun2.1','Sun2.2']},'Kupa':

String from File -> List without parsing

2005-09-04 Thread Gregor Horvath
Hi, given the dynamic nature of python I assume that there is an elegant solution for my problem, but I did not manage to find it. I have a file that contains for example on line: ['147', '148', '146'] when I read the file f = file("I050901.ids").readlines() I have a string f[0] == "['147

Re: String from File -> List without parsing

2005-09-04 Thread Gregor Horvath
John Machin wrote: >> f = file("I050901.ids").readlines() > > Y3K bug alert :-) but then there is Python 3000 and Hurd, which solves all problems of this universe :-) > Something like this: > > >>> def munch(astrg): > ...return [x[1:-1] for x in astrg.rstrip("\n")[1:-1].split(", ")] T

Why tuple with one item is no tuple

2005-03-15 Thread Gregor Horvath
Hi, >>>type(['1']) >>>type(('1')) I wonder why ('1') is no tuple Because I have to treat this "special" case differently in my code. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-15 Thread Gregor Horvath
thanks are given to all "problem" solved... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python like VB?

2005-03-17 Thread Gregor Horvath
James wrote: You will probably find migrating to VB.NET easier than to Python if you have to do WYSIWYG data bound form design. VB.NET is quite a nice language (I personally prefer C#). Much nicer than VB6. Python is better but it may not meet YOUR needs infrastructure wise. This is more a strategi

Newby Q: nested classes, access of upper method

2004-12-03 Thread Gregor Horvath
Hello, class A(self): def A1(): pass class B(self): def B1(): # #*** How can I access A1 here *** # self.A1() # doesnet work because self references to B self.self.A

Re: Newby Q: nested classes, access of upper method

2004-12-04 Thread Gregor Horvath
Hello Nick, thank you, your answer really helped me.. -- Greg Nick Coghlan wrote: Gregor Horvath wrote: Hello, class A(self): def A1(): pass class B(self): def B1(): # #*** How can I access A1 here

Re: BASIC vs Python

2004-12-16 Thread Gregor Horvath
Hi, Adam DePrince wrote: computers of the day. This was in a misguided effort to make computers understandable to their target audience. The goal of the day was to build a system that a manager would want to buy; it was believed that [..] BASIC = Beginners all purpose symbolic instruction code A

Re: BASIC vs Python

2004-12-17 Thread Gregor Horvath
Peter Otten wrote: May you could give us an idea of the current state of basic affairs then by translating the following example snippet: yes you can do it in VB6, but pythons lists and dictionarys are superior to those built in in VB and I think to those in most other languages. It's me wrote:

Re: BASIC vs Python

2004-12-17 Thread Gregor Horvath
It's me wrote: Absolutely *ugly*! But still, your point is well taken. Thank you for pointing this out. Adam was right: "Don't do it, unless your goal is simply to embarrass and insult programmers". OK. Then please schow me, how you can create a complex form with grids, explorer like trees etc.

Re: lies about OOP

2004-12-15 Thread Gregor Horvath
Daniel T. wrote: [EMAIL PROTECTED] wrote: A paper finding that OOP can lead to more buggy software is at http://www.leshatton.org/IEEE_Soft_98a.html Sure, OOP *can* lead to more buggy software, that doesn't mean it always does. I think that costs(=time) to develop and maintain software depends

Re: BASIC vs Python

2004-12-17 Thread Gregor Horvath
Thomas Bartkus wrote: > On what basis do you think the mechanics of producing a working > language are easier because the language is interpreted. Because: Type code Run code. VB6 goes a step further: Run Code Type Code That means that you can set a breakpoint. While the debugger sto

Re: BASIC vs Python

2004-12-18 Thread Gregor Horvath
Adam DePrince wrote: On Fri, 2004-12-17 at 09:25, Steve Holden wrote: Or make any given standard python object accessible from MS Excel in 2 minutes. What you describe is a political, not technical, challenge. What I describe is a daily costumer demand. Like or not, the world uses Excel and co

Re: BASIC vs Python

2004-12-18 Thread Gregor Horvath
Andrew Dalke wrote: Huh? I'm talking about my views of myself. I said that BASIC was a programming language I could learn without access to anyone else, on a microcomputer circa 1982. All I had was the book that came with the computer, and after a while a book on BASIC games. The machine I had w

Re: Use macros in Excel via win32com

2004-12-18 Thread Gregor Horvath
chris wrote: I'm creating an excel document dynamically from scratch using Python and the win32com module. All is well, but now I need to add a macro to the spreadsheet and run it (to enable some sorting features in the spreadsheet). I think I know how to run a macro once it's installed (using th

Re: what would you like to see in a 2nd edition Nutshell?

2004-12-30 Thread Gregor Horvath
RM wrote: What you say is true. However, I didn't think the target audience of this book was newbies. Python newbies yes, but not programming newbies. For programming newbies I would recommend the "Learning Python" book instead. The availability argument, however, is a good point. I was/am a pyt

Logging: Formatter: name of the function

2005-12-23 Thread Gregor Horvath
Hi, Is there a possibility to format a log message to give the function name where the log appears? Example import logging def aTestFunction(): logger.debug("This is a message") The log should read: aTestFunction This is a message. There is a possibilty to format the module namewith %(m

Re: Best way to read, and analyze a log file?

2006-08-01 Thread Gregor Horvath
Hi, [EMAIL PROTECTED] schrieb: > I am reading a log file, and wondering what is the best way to read and > analize this. Look at: http://pyparsing.wikispaces.com/ There is also an example for parsing an apache log. -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.or

Re: Grammar parsing

2006-08-03 Thread Gregor Horvath
Paolo Pantaleo schrieb: > How can I write a pareser for a certain gramamr? I found PyPy that > does it, is thare any other tool? Maybe something built-in the python > interpreter? > http://pyparsing.wikispaces.com/ -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/

Re: Dallas One wire tempreture measurement.

2006-08-09 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > a previous thread > > http://mail.python.org/pipermail/python-list/2002-June/107616.html > > discussed this issue, and Dave Moor kindly pointed to his solution. > However this is no longer a current link, does anyone know if there is > a currently available solution?

Re: Looking for a text file based wiki system written in Python

2006-08-12 Thread Gregor Horvath
Jack schrieb: > I'd like to set up a wiki system for a project I'm working on. > Since I'm not good at databases, and there's really not much > stuff to put into the wiki, I hope it is text file-based. > I used DokuWiki before, which is very nice but it's written > in PHP. Is there a similar system

Re: Using SVN with Python and .pyc files

2006-10-13 Thread Gregor Horvath
James Stroud schrieb: > project or package. How do people manage this? Do you run a script to > find files with the .pyc extension and delete those before every commit, > or is there a more elegant way? It seems like a lot of wasted bandwidth > an memory on the server side to constantly be dealing

Re: Web Hosting

2006-10-15 Thread Gregor Horvath
Sir Psycho schrieb: > > Im looking at making a site in Python, however, Im lost as to what ISPs > actually support. Some ISPs say they support Python so does that mean > if I wanted to use TurboGears It would just work anyway? http://docs.turbogears.org/1.0/Hosting?highlight=%28hosting%29 --

Re: python's OOP question

2006-10-15 Thread Gregor Horvath
neoedmund schrieb: > python use multiple inheritance. > but "inheritance" means you must inherite all methods from super type. > now i just need "some" methods from one type and "some" methods from > other types, > to build the new type. > Do you think this way is more flexible than tranditional in

Scope of decorator argument

2006-10-16 Thread Gregor Horvath
Hi, this: class base(object): @adecorator(xy) def edit(self): print "edit" class child(base): xy = 3 obviously fails because "xy" is not bound at class creation time of the base object. One solution could be delegation: class base(object): @classmethod def edit(se

Re: Scope of decorator argument

2006-10-17 Thread Gregor Horvath
Gregor Horvath schrieb: > > Is there any other solution, probably with metaclasses ? > I've found this one: class mymeta(type): def __new__(meta, class_name, bases, new_attrs): new_attrs["edit"] = adecorator(new_attrs['xy'])(bases[0].edit)

Webprogr: Link with automatic submit

2006-10-20 Thread Gregor Horvath
Hi, As I am no expert web programmer I thought I'd better ask the experts if there is a simpler or better solution to my problem than the one I am thinking of. (using TurboGears) The problem --- I have a form. Ok. you can submit, validate it etc. Now I have a link on that form to another

Re: Webprogr: Link with automatic submit

2006-10-20 Thread Gregor Horvath
Bruno Desthuilliers schrieb: > yes : replace the link with another submit button, then in your > controller check which submit has been successful and take appropriate > action. Thanks ! -- Servus, Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Good Form

2006-10-21 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > Would you normally write methods to retrive and set your class > variables or just refrence them directly? > you start by referencing them directly and ONLY if you need you can add getters and setters later on without breaking any client code. see the property functi

Re: The fastest search

2006-10-21 Thread Gregor Horvath
Fulvio schrieb: > > Is there some trick to apply the best search in wise use of resources while > using the above said methods? > measure it: http://docs.python.org/lib/module-timeit.html Regarding your debugger question in the seperate thread I don't know since I am not using a debugger at a

Interpretation of UnhandledException.rpt

2006-06-06 Thread Gregor Horvath
Hi, in a windows server python application I receive once a week suddenly and not reproducible the following error. UnhandledException.rpt file: //=== Exception code: C090 FLT_INVALID_OPER

win32 Service: path to .py script

2006-09-19 Thread Gregor Horvath
Hi, I have a testservice.py (see below). I installed the Windows-Service successfully. (via commandlineoption install) The problem is that it runs only when it is in c:\windows\system32 or in the python path. I added the desired path (Y:\) to the PYTHONPATH environment variable for the system acco

Re: win32 Service: path to .py script

2006-09-19 Thread Gregor Horvath
Larry Bates schrieb: > I believe that your problem is that services run under Local > System account. Normally Local System account would not have > a drive mapping Y:\. You can change the account that a service You are absolutly correct. I moved the script to a local drive instead of a mapped

Re: What do I look for in a shared Python host?

2006-11-17 Thread Gregor Horvath
walterbyrd schrieb: > > What other "gotchas" would I look for? > Maybe this is helpfull for you: http://docs.turbogears.org/1.0/Hosting -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Can Python help?

2006-12-26 Thread Gregor Horvath
Lad schrieb: > On my website I allow users to upload files. I would like a user to see > how much time is left before a file is uploaded. So, I would like to > have a progress bar during a file uploading. Can Python help me with > that?Or how can be a progress bar made? > Thank you for ideas. > L

_tkinter.TclError: can't set "PY_VAR0": invalid command name "-1210125972check"

2006-03-02 Thread Gregor Horvath
Hi, I searched the web and docs but cannot figure out whats wrong with this code: #!/usr/bin/python import Tkinter as Tk class testtk(Tk.Frame): def __init__(self): self.root = Tk.Tk() Tk.Frame.__init__(self,self.root) self.frame = Tk.Frame(self.root) self.var = Tk.Stri

Re: _tkinter.TclError: can't set "PY_VAR0": invalid command name "-1210125972check"

2006-03-02 Thread Gregor Horvath
Gregor Horvath schrieb: > if __name__ == "__main__": > t = testtk() > t.var.set("TEST") > > Result: > > _tkinter.TclError: can't set "PY_VAR0": invalid command name > "-1210125972check" > > > Any ideas, wh

Re: The best platform and editor for Python

2007-07-05 Thread Gregor Horvath
kimiraikkonen schrieb: > My another aim is: Can i develop graphical applications (like in > Windows) which contain menus, interactive dialog boxes etc. using > Ptyhon? > > I got it quite but not sure. I don't know Ptyhon's capability skills > for creating interactive softwares like in Windows's c

Re: The best platform and editor for Python

2007-07-05 Thread Gregor Horvath
Kay Schluehr schrieb: > That's what I love most about the Python community. Whenever there is > just a non-standard, platform-dependent or crappy implementation of a > feature you get told that you don't need it. When printf was good for > little David print is good enough for me. > That's a pro

Re: The best platform and editor for Python

2007-07-05 Thread Gregor Horvath
Kay Schluehr schrieb: > The problem is simply that the Python community has failed in this > respect. There are many platform dependent and ideology driven ways to > do deal with code editing / debugging but not actually a recommend or > "pythonic" way. Other than Smalltalk, Python has not created

Re: howto check is object a func, lambda-func or something else?

2007-04-29 Thread Gregor Horvath
dmitrey schrieb: > howto check is object Arg1 > - a func, lambda-func > - something else? > > I tried callable(Arg1), but callable(lambda-func) returnes False I don't understand your problem: >>> callable(lambda:0) True Please post your relevant code. Greg -- http://mail.python.org/mailman

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-15 Thread Gregor Horvath
René Fleschenberg schrieb: > > We all know what the PEP is about (we can read). The point is: If we do > not *need* non-English/ASCII identifiers, we do not need the PEP. If the > PEP does not solve an actual *problem* and still introduces some > potential for *new* problems, it should be rejected

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-15 Thread Gregor Horvath
Ross Ridge schrieb: > non-ASCII identifiers. While it's easy to find code where comments use > non-ASCII characters, I was never able to find a non-made up example > that used them in identifiers. If comments are allowed to be none English, then why are identifier not? This is inconsistent becau

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
René Fleschenberg schrieb: > today, to the best of my knowledge. And "in some form or another" > basically means that the PEP would create more possibilities for things > to go wrong. That things can already go wrong today does not mean that > it does not matter if we create more occasions were th

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
René Fleschenberg schrieb: >> I love Python because it does not dictate how to do things. >> I do not need a ASCII-Dictator, I can judge myself when to use this >> feature and when to avoid it, like any other feature. > > *That* logic can be used to justify the introduction of *any* feature. >

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > code on the (GUI-less) production servers over a terminal link. They > have to use all kinds of environments where they can't install the > latest and greatest fonts. Promoting code that becomes very hard to > read and debug in real situations seems like a sound nega

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Hendrik van Rooyen schrieb: > It is not so much for technical reasons as for aesthetic > ones - I find reading a mix of languages horrible, and I am > kind of surprised by the strength of my own reaction. This is a matter of taste. In some programs I use German identifiers (not unicode). I and o

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Eric Brunel schrieb: > Highly improbable in the general context. If I stumble on a source code > in Chinese, Russian or Hebrew, I wouldn't be able to figure out a single > sound. If you get source code in a programming language that you don't know you can't figure out a single sound too. How i

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Eric Brunel schrieb: > > The point is that today, I have a reasonable chance of being able to > read, understand and edit any Python code. With PEP 3131, it will no > more be true. That's what bugs me. That's just not true. I and others in this thread have stated that they use German or other

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
Istvan Albert schrieb: > Here is something that just happened and relates to this subject: I > had to help a student run some python code on her laptop, she had > Windows XP that hid the extensions. I wanted to set it up such that > the extension is shown. I don't have XP in front of me but when I

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: >> 2) Create a way to internationalize the standard library (and possibly >> the language keywords, too). Ideally, create a general standardized way >> to internationalize code, possibly similiar to how people >> internationalize strings today. > > Why? Or more acurate

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > On May 16, 12:54 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: >> Istvan Albert schrieb: >> >> So the solution is to forbid Chinese XP ? >> > > It's one solution, depending on your support needs. > That would be

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Gregor Horvath
Hendrik van Rooyen schrieb: > I can sympathise a little bit with a customer who tries to read code. > Why that should be necessary, I cannot understand - does the stuff > not work to the extent that the customer feels he has to help you? > You do not talk as if you are incompetent, so I see no rea

Re: Sending a JavaScript array to Python script?

2007-05-17 Thread Gregor Horvath
placid schrieb: > Just wondering if there is any way of sending a JavaScript array to a > Python cgi script? A quick Google search didn't turn up anything > useful. http://mochikit.com/doc/html/MochiKit/Base.html#json-serialization http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.3/docs/i

Re: Declaring variables

2007-05-17 Thread Gregor Horvath
HMS Surprise schrieb: > > #~~ > createdIncidentId = 0 > . > . > . > #attempt to change varialbe > createdIncidentID = 1 > . > . > . > if createdIncidentId == 1: >... > test.py is your code above $ pychecker -v test.py Processing test... Warnings... test.py:7: Variable

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Gregor Horvath
Martin v. Löwis schrieb: > I've reported this before, but happily do it again: I have lived many > years without knowing what a "hub" is, and what "to pass" means if > it's not the opposite of "to fail". Yet, I have used their technical > meanings correctly all these years. That's not only true f

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Gregor Horvath
Istvan Albert schrieb: > > After the first time that your programmer friends need fix a trivial > bug in a piece of code that does not display correctly in the terminal > I can assure you that their mellow acceptance will turn to something > entirely different. > Is there any difference for you

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-17 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > With the second one, all my standard tools would work fine. My user's > setups will work with it. And there's a much higher chance that all > the intervening systems will work with it. > Please fix your setup. This is the 21st Century. Unicode is the default in Pyt

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Gregor Horvath
Hendrik van Rooyen schrieb: > I suppose that this "one language track" - mindedness of mine > is why I find the mix of keywords and German or Afrikaans so > abhorrent - I cannot really help it, it feels as if I am eating a > sandwich, and that I bite on a stone in the bread. - It just jars. Ple

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Gregor Horvath
Istvan Albert schrieb: > On May 17, 2:30 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > >> Is there any difference for you in debugging this code snippets? > >> class Türstock(object): > > Of course there is, how do I type the ü ? (I can copy/paste for &

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Gregor Horvath
Paul Boddie schrieb: > Perhaps, but the treatment by your mail/news software plus the > delightful Google Groups of the original text (which seemed intact in > the original, although I don't have the fonts for the content) would > suggest that not just social or cultural issues would be involved.

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-18 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > opposed. But dismissing the fact that Outlook and other quite common > tools may have severe problems with code seems naive (or disingenuous, > but I don't think that's the case here). Of course there is broken software out there. There are even editors that mix tab

Re: What's the best way to iniatilize a function

2007-05-28 Thread Gregor Horvath
Jack schrieb: > I didn't call del explicitly. I'm expecting Python to call it when > the program exits. I put a logging line in __del__() but I never > see that line printed. It seems that __del__() is not being called > even when the program exits. Any idea why? > > http://effbot.org/pyfaq/my-

Re: Why PHP is so much more popular for web-development

2007-07-25 Thread Gregor Horvath
walterbyrd schrieb: > Don't get me wrong: I am not saying that PHP is better than Python for > web-development. But, I sometimes think that Python could learn a few > things from PHP. Yes, indeed we can learn that popularity is not superiority. ;-) Gregor -- http://mail.python.org/mailman/listi

Re: advice about `correct' use of decorator

2007-09-03 Thread Gregor Horvath
Gerardo Herzig schrieb: > > @is_logued_in > def change_pass(): >bla >bla > > And so on for all the other functions who needs that the user is still > loged in. > > where obviosly the is_logued_in() function will determine if the dude is > still loged in, and THEN execute change_pass().

Re: Class design (information hiding)

2007-09-07 Thread Gregor Horvath
Alexander Eisenhuth schrieb: > > I'm wodering how the information hiding in python is ment. As I > understand there doesn't exist public / protected / private mechanism, > but a '_' and '__' naming convention. > > As I figured out there is only public and private possible as speakin in > "C+

Re: Class design (information hiding)

2007-09-09 Thread Gregor Horvath
Alex Martelli schrieb: > > Why, thanks for the pointer -- I'm particularly proud of having written > """ > The only really workable way to develop large software projects, just as > the only really workable way to run a large business, is a state of > controlled chaos. > """ Yes, indeed a good sa

Re: newbie: stani's python editor if-else

2007-09-11 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > I agree with Steve. I have yet to see an IDE for Python (or anything > else) that unindents statements. Even IDLE, the Official IDE for > Python, doesn't do that. emacs in python-mode Just hit TAB and it unindents "else" in the given example. Hit TAB again and it cy

Re: Python code-writing for the blind. Was (Re: newbie: stani's python editor if-else)

2007-09-11 Thread Gregor Horvath
madzientist schrieb: > > Is Python a bad choice for the blind programmer, as a result of a > tight linkage between visual aspects of the code and its function ? I > wish the site blindprogramming.com weren't so lifeless... There was a thread regarding blind people and python indentation shortly:

Re: Complex HTML forms

2007-02-18 Thread Gregor Horvath
George Sakkis schrieb: > I'd like to gather advice and links to any existing solutions (e.g. > libraries, frameworks, design patterns) on general ways of writing > complex web forms, as opposed to the typical {name:value} flat model. > A particular case of what I mean by complex is hierarchical for

Re: multiline comments

2006-04-19 Thread Gregor Horvath
Edward Elliott schrieb: > On top of that, the expressive power of nested comments seems greater > than an endless string of ^#s. Sometimes it's just easier to see what's > going on. not if you are using grep -- Gregor http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/py

Re: Events in Python?

2006-04-26 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > > Does Python have a mechanism for events/event-driven programming? > Probably this is something for you: http://twistedmatrix.com/trac/ -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: finding IP address of computer

2006-04-27 Thread Gregor Horvath
Chris schrieb: > How do I find and print to screen the IP address of the computer my > python program is working on? > IP adresses are bound to network interfaces not to computers. One Computer can have multiple network interfaces. -- Servus, Gregor http://www.gregor-horvath.com -- http://

Re: Protocols for Python?

2006-04-27 Thread Gregor Horvath
[EMAIL PROTECTED] schrieb: > > Is there a standard way to document protocols in Python? Of should I > come up with something tailored to my needs. > Write unittests or doctest strings. -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Install libraries only without the program itself

2006-05-11 Thread Gregor Horvath
Hi, My application is a client/server in a LAN. I want to keep my programs .py files on a central File Server serving all clients. The clients should load those over the LAN every time they start the program since I expect that they are rapidly changing and I dont want to update each client sepera

Re: Install libraries only without the program itself

2006-05-11 Thread Gregor Horvath
Serge Orlov schrieb: > I believe it's better to keep *everything* on the file server. Suppose Certainly! > your OS is windows and suppose you want to keep everything in s:/tools. > The actions are: > 3. Create little dispatcher s:/tools/win32/client.py: > #!s:/tools/python24-win32/python.exe > i

Why is None <= 0

2008-04-25 Thread Gregor Horvath
Hi, >>> None <= 0 True Why? Is there a logical reason? Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is None <= 0

2008-04-25 Thread Gregor Horvath
D'Arcy J.M. Cain schrieb: On Fri, 25 Apr 2008 20:27:15 +0200 Gregor Horvath <[EMAIL PROTECTED]> wrote: >>> None <= 0 True Why? Why not? Because, from http://www.python.org/dev/peps/pep-0020/ : Errors should never pass silently. In the face of ambiguity, refuse

getattr nested attributes

2008-08-15 Thread Gregor Horvath
Hi, class A(object): test = "test" class B(object): a = A() In [36]: B.a.test Out[36]: 'test' In [37]: getattr(B, "a.test") --- Traceback (most recent call last) / in () : type object 'B' has no attribut

Re: getattr nested attributes

2008-08-15 Thread Gregor Horvath
Peter Otten schrieb: make your own function that loops over the attributes, or spell it reduce(getattr, "a.test".split("."), B) 'test' Thank's, but this does not work for this case: class A(object): test = "test" class B(object): a = [A(),] In [70]: reduce(getattr, "a[0].test".s

Overwriting property-> can't set attribute

2008-08-22 Thread Gregor Horvath
Hi, why is this code failing? class B(object): pass B.testattr = property(lambda s:"hallo") b = B() b.testattr = "test" Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) /tmp/python-14202ViU.py in () 14 B.testattr = property(lambda s:"hallo") 15 b = B() ---> 16 b.testattr = "tes

Re: Overwriting property-> can't set attribute

2008-08-22 Thread Gregor Horvath
Gregor Horvath schrieb: why is this code failing? OK I answer myself :-) Because there is not fset function definied in the property. I have to del the attr before rebinding the attributename to another object. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

__del__ not called?

2006-03-12 Thread Gregor Horvath
Hi, I do not understand why __del__ does not get executed in the following example. test.py: #!/usr/bin/python class A(object): def __init__(self): print "init" def __del__(self): print "del" test1.py #!/usr/bin/python import test class B(object): a = test.A() Running te

Re: __del__ not called?

2006-03-13 Thread Gregor Horvath
Felipe Almeida Lessa schrieb: del B # We'll to tell him to collect the garbage here, but > > ... # usually it should not be necessary. Thanks. If I do del B then the __del__ of A gets called. That surprises me. I thought that B gets del'd by python when it goes out of scope? Do I

Re: __del__ not called?

2006-03-13 Thread Gregor Horvath
Duncan Booth schrieb: > What is less obvious is that new style classes always include circular > references, so a class is never detroyed until the garbage collector runs. Thanks. I tried the same example with old style classes and A.__del__ gets correctly called. > Of course, if your __del__

Re: __del__ not called?

2006-03-13 Thread Gregor Horvath
Duncan Booth schrieb: > First off, never depend on __del__ to do anything critical. The only Thanks to all of you! Everything's clear now! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >