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

2007-09-11 Thread Gregor Horvath
le. Hit TAB again and it cylces in the possible indentations. Gregor -- http://mail.python.org/mailman/listinfo/python-list

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

2007-09-11 Thread Gregor Horvath
dentation shortly: http://groups.google.com/group/comp.lang.python/browse_thread/thread/80654a87bfa89e3b Gregor -- http://mail.python.org/mailman/listinfo/python-list

How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
I'm trying to write a Win32 service. The following is straight from Python Programming on Win32 and it doesn't work. Is that book out of date; is there a new way to do services? I searched Google for hours trying to find any other method, and have been beating on this one for 5 more hours. The pre

Re: How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
Giles Brown wrote: > Yeah. You've cleverly decided to simplify the "smallest possible > python service" by removing the > if __name__ == '__main__': Ha ha. :) Seriously, though, I removed that long after it was failing to work, and have since replaced it and it didn't affect a thing. Gabriel G

Re: How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
Giles Brown wrote: > Yeah. You've cleverly decided to simplify the "smallest > possible python service" by removing the > if __name__ == '__main__': Ha ha. :) Seriously, though, I removed that long after it was failing to work, and have since replaced it and it didn't affect a thing. Gabriel Ge

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.o

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

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
seperatly. On the clients there should only be python and the necessary libraries and third party modules (sqlobject etc.) installed. How do I make a setup script that only installs the necessary things, without the program itself. Is there a tool for that? -- Servus, Gregor http://www.gregor

Re: Install libraries only without the program itself

2006-05-11 Thread Gregor Horvath
s from the c:\winnt directory (for example pywintypes24.dll) into the current directory. Thanks for this solution, works great, did not know that you can run python programs even without a python installation on the local machine! Nice! -- Servus, Gregor http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

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
= test.A() Running test1.py outputs: init the "del" is missing. I suppose the a object should be garbage collected!? -- Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: __del__ not called?

2006-03-13 Thread Gregor Horvath
python when it goes out of scope? Do I manually have to del all class objects, so that their class attributes get gc'd -- Gregor -- http://mail.python.org/mailman/listinfo/python-list

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

Re: Basic python help

2006-03-13 Thread Gregor Horvath
Kevin Feng schrieb: > More information about this error may be available in the server error log. > > > > Any suggestions? Much thanks. > What does the error log of the webserver say? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine COM objects/functions

2006-03-30 Thread Gregor Horvath
a COM Browser. Or if you have MS-Office installed, there is a COM Browser in the VBA IDE. -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a language/framework

2006-03-31 Thread Gregor Horvath
pliciation the goal is to only have problem or domain specific code. Middelware or ORM is a way to this goal because it encapsulates and hides the technical details of persistence and helps for cleaner code. -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareen

Re: Looking for a language/framework

2006-04-01 Thread Gregor Horvath
better approach. -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: About classes and OOP in Python

2006-04-10 Thread Gregor Horvath
obgho -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: About classes and OOP in Python

2006-04-11 Thread Gregor Horvath
Steven D'Aprano schrieb: > I don't know of many other OO languages that didn't/don't have > inheritance, VB4 - VB6 -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a language/framework

2006-04-11 Thread Gregor Horvath
to avoid having to properly understand the way a von Neumann architecture (or Assembler) works? -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: VB to Python

2006-04-14 Thread Gregor Horvath
win32com.client.Dispatch(scopeProgID) scope.Connected = True -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung Mobil: +43(0)69910879004 Fax: +43(0)1/25330333931 http://www.gregor-horvath.com -- Mit freundlichen Grüßen, Ing. Gregor Horv

installation of jython program

2006-04-17 Thread Jan Gregor
Hello, I've done database console in jython called jydbconsole. It's now available on sourceforge. As you can guess console needs jdbc drivers. The script that runs jython itself doesn't public -cp option to add another classpaths. Yes I need to add jdbc drivers to classpath ... Of course I see

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Gregor Lingl
see a screenshot of a run of this script here: http://www.dropbox.com/gallery/2016850/1/TurtleCollector?h=6b370a The script could be expanded in several ways, e. g. for doing statistical investigations or examinig how the result depends on different parameters like drunkenness etc. Or you distrib

Re: [Edu-sig] teaching python using turtle module

2009-11-30 Thread Gregor Lingl
ht(90) designer.hideturtle() Hoping, you will find this a bit interesting, best regards Gregor Here's the graphical output: http://www.flickr.com/photos/17157...@n00/4148139184/in/photostream/ (Python 3.1) If you actually wanna fold the T, you need to snip off the cap and reverse it, per

Re: Business issues regarding adapting Python

2009-09-27 Thread Gregor Horvath
rk (Pakistan), we can't find Python developers. I asked HR to send [...] > 4. Any suggestions or idea? Related posts, articles etc would > certainly help! http://www.paulgraham.com/pypar.html -- Gregor http://gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: How to pass a global variable to a module?

2009-09-29 Thread Gregor Horvath
org/pipermail/tutor/2002-November/018353.html -- Gregor http://gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Making module content available in parent module

2010-11-23 Thread Gregor Horvath
fines TestFoo1 and TestFoo2 >bar.py # defines TestBar1 and TestBar2 Nose does what you want: http://packages.python.org/nose/ -- Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 put-downs: What's the point?

2010-07-05 Thread Gregor Horvath
Am Sun, 04 Jul 2010 18:51:54 -0500 schrieb Tim Chase : > I think it's the same venting of frustration that caused veteran > VB6 developers to start calling VB.Net "Visual Fred" -- the > language was too different and too non-backwards-compatible. > VB6 -> VB.NET and Python 2 -> 3 is not a vali

Re: Python 3 put-downs: What's the point?

2010-07-06 Thread Gregor Horvath
Am Mon, 05 Jul 2010 14:32:13 -0500 schrieb Tim Chase : > On 07/05/2010 02:50 AM, Gregor Horvath wrote: > > Am Sun, 04 Jul 2010 18:51:54 -0500 > > schrieb Tim Chase: > > > >> I think it's the same venting of frustration that caused veteran > >> VB6 dev

ANN: Python's turtle module: collection of examples + demoViewer

2009-08-04 Thread Gregor Lingl
ve to be useful. Best regards, Gregor P.S.: I tried to announce it at comp.lang.python.announce but for some unknown reason it was not accepted there -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
and Python's turtle module are quite different - as one could grasp easily by trying out the collection of examples at python-turtle-demo.googlecode.com that I posted in another posting. Anyway they could very well complement one another in some more mature state of development. Best regards, G

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
#x27;s not so a bad idea to install Python if one want's to learn it, anyway. Regards, Gregor Ram. -- http://mail.python.org/mailman/listinfo/python-list

Re: Announcing PythonTurtle

2009-08-04 Thread Gregor Lingl
brary must not break code of previous users of that module. In short: I did not name these functions but I had to use the names that already were there. Nevertheless I'd prefer left and right over turn even today, especially for kids as I argued before. Regards, Gregor It would be cer

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
print(".".join(sorted(k)), "%d-%d" % (min(v), max(v))) Regards, Gregor I've tried various methods, which all fail. Does anyone have an idea how to do this? Thank you very much! Jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
different though, if you had floating point boundaries of the intervals. Regards, Gregor Duane -- http://mail.python.org/mailman/listinfo/python-list

Re: Overlap in python

2009-08-04 Thread Gregor Lingl
Gregor Lingl schrieb: As my proposed solution shows this approach can be done with on board means of Python (namely the set type). This would be quite different though, if you had floating point boundaries of the intervals. ... or if the intgers involved were very big :-( Regards, Gregor

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Gregor Lingl
lease post it? (The one you posted below uses some commands of the turtle 2.6 module which are not present in 2.5, so it doesn't run with Python 2.5) Regards, Gregor Had to change to tooter = turtle.Turtle() tooter.screen.tracer(False) # tracer now a screen attribute to turn tracing

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Gregor Lingl
esn't concern the problem reported by mensator. Regards, Gregor Naturally, having tracing on caused my program to crash. It seg faulted or raised an exception? [...] Unfortunately, that calculation of nhops is illegal if diffsq is an .mpf (gmpy floating point). Otherwise, you get How do

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Gregor Lingl
ngle turtle objects but all the turtles on a given screen. So there is an icompatibility beween 2.6 and 3.x But as far as I have understood, this doesn't concern the problem reported by mensator. Only that the problem is hidden when tracing is off, as the nhops variable is never e

Re: Turtle Graphics are incompatible with gmpy

2009-08-05 Thread Gregor Lingl
at all: What would be the results when using the old turtle module with Python 3.1 (it will certainly not run out of the box, but perhaps 2to3 might do it?) That would clarify the question if there is some impact of new division or some changes in Tkinter. Best regards, Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into substrings of equal size

2009-08-15 Thread Gregor Lingl
n(z)>3 else z >>> comaSep("7") '7' >>> comaSep("2007") '2,007' >>> comaSep("12024") '12,024' >>> comaSep("509") '509' >>> comaSep("75096042068045") '75,096,042,068,045' >>> Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into substrings of equal size

2009-08-15 Thread Gregor Lingl
n(z)>3 else z >>> comaSep("7") '7' >>> comaSep("2007") '2,007' >>> comaSep("12024") '12,024' >>> comaSep("509") '509' >>> comaSep("75096042068045") '75,096,042,068,045' >>> Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into substrings of equal size

2009-08-15 Thread Gregor Lingl
; >>> Emile Less beautiful but more correct: >>> ",".join([jj[max(ii-3,0):ii] for ii in range(len(jj)%3,len(jj)+3,3)]) '1,234,567,890,123,456,789' Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: getting the fractional part of a real?

2009-08-15 Thread Gregor Lingl
1.5) (0.5, 1.0) Christian Or without the need to import something: >>> divmod(1.5, 1) (1.0, 0.5) >>> Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string into substrings of equal size

2009-08-16 Thread Gregor Lingl
Mark Tolonen schrieb: "Gregor Lingl" wrote in message news:4a87036a$0$2292$91cee...@newsreader02.highway.telekom.at... Emile van Sebille schrieb: On 8/14/2009 5:22 PM candide said... ... What is the pythonic way to do this ? I like list comps... >>> jj = &

Re: Splitting a string into substrings of equal size

2009-08-17 Thread Gregor Lingl
27;.join(list(chunks(s 1,234,567,890 >>> print(','.join(list(chunks(s,2 12,34,56,78,90 >>> print(','.join(list(chunks(s,4 12,3456,7890 Regards, Gregor -- http://mail.python.org/mailman/listinfo/python-list

Re: win32ui DLL Load Failed

2009-09-01 Thread Gregor Horvath
; > I have Python 2.6 on my developer machine and am using the pywin > support (Mark Hammonds???) for Python 2.6. Try to install: http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en 2.6 is linked against VS8 dlls, which are miss

logging sound / speech handler?

2009-09-09 Thread Gregor Horvath
etc.) I google search was not successfull. Does anybode know of such a handler? -- Gregor -- http://mail.python.org/mailman/listinfo/python-list

Encode HTML CDATA name token

2010-09-20 Thread Gregor Horvath
Hi, ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). [1] Is there a encoder / decoder in Python that can convert arbitrary text to and from this encoding in an re

Re: Encode HTML CDATA name token

2010-09-20 Thread Gregor Horvath
Am Mon, 20 Sep 2010 21:36:46 +1200 schrieb Lawrence D'Oliveiro : > In message <20100920104546.3699e...@valun>, Gregor Horvath wrote: > > > Is there a encoder / decoder in Python that can convert arbitrary > > text to and from this encoding in an readable manner? >

Re: polymorphic function question

2010-09-21 Thread Gregor Horvath
Am Tue, 21 Sep 2010 11:35:14 -0700 (PDT) schrieb joblack : > Let's say I've got a function with > > def doesSomething(A='bla'): > ... > > and I try to call it with a non existent variable with > > doesSomething(DoesNotExist) > > What will happen? Will it throw an exception or will it take the

<    1   2