Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-26 Thread Steven D'Aprano
On Tue, 25 Dec 2012 16:19:21 -0800, Rick Johnson wrote: On Tuesday, December 25, 2012 4:56:44 PM UTC-6, Steven D'Aprano wrote: Rick, what makes you think that this is logically inconsistent? Method is the accepted name for functions attached to classes. They report themselves as methods:

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-26 Thread Michael Torrie
On 12/25/2012 04:42 PM, Rick Johnson wrote: What IS a variable Dennis? # #Variable (ComputerScience)# Found the reference you are quoting

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-26 Thread Michael Torrie
On 12/25/2012 04:42 PM, Rick Johnson wrote: With that accurate definition in mind you can now understand how Python classes CAN and DO have variables, just as Python modules have variables; psst: they're called global variables! Nice ascii graphic, but citation needed. What CS text book are

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-26 Thread Rick Johnson
On Wednesday, December 26, 2012 2:29:13 AM UTC-6, Steven D'Aprano wrote: [snip] I won't reply to your last post on a line-by-line basis because i feel we are straying from my general point: which is that we should NEVER re-interpret existing words (in an illogical manner) whilst transforming

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-26 Thread Steven D'Aprano
On Wed, 26 Dec 2012 20:07:53 -0800, Rick Johnson wrote: My specific point is that the English word variable is unambiguous I'm sorry, do you mean variable the noun, or variable the adjective? If you mean the adjective, do you mean something which naturally changes, in the sense that the

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Steven D'Aprano
On Mon, 24 Dec 2012 00:19:18 -0500, Dave Angel wrote: Nobody's going to be able to understand your code if you persist in using self in unpythonic ways. It's used as the first argument of a class method. Period. To be pedantic, self is the conventional argument for *instance* methods, not

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread prilisauer
Hello Steven, to learn python I've bought a book, and it's not a thin one :-) it's more a 788p. long documentation about python. BUT! I have to say: The autor started using the self. argument at the chapter classes. So You've shown me the book descr. non correct way. Better using this

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Dave Angel
On 12/25/2012 09:41 AM, prilisa...@googlemail.com wrote: Hello Steven, to learn python I've bought a book, and it's not a thin one :-) it's more a 788p. long documentation about python. BUT! I have to say: The autor started using the self. argument at the chapter classes. So You've

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread prilisauer
By the way i haven't add the Title because it's a german only book named Python 3: Das umfangreiche Handbuch, Published by Galileo Computing and also, because I've registered to first check if the Autor has allready published a update. Too many information's could ocurre in an avalanche I see

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 11:10:49 AM UTC-6, Dave Angel wrote: We all make mistakes, like my referring to class methods when I meant instance methods. This mistake reminded of how people in this group (maybe not you in particular) happily accept the terms instance method and class method

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Steven D'Aprano
On Tue, 25 Dec 2012 12:16:16 -0800, Rick Johnson wrote: On Tuesday, December 25, 2012 11:10:49 AM UTC-6, Dave Angel wrote: We all make mistakes, like my referring to class methods when I meant instance methods. This mistake reminded of how people in this group (maybe not you in

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 3:08:21 PM UTC-6, Dennis Lee Bieber wrote: Only that many of us don't believe Python has /variables/, the use of instance/class as a modifier is thereby moot. What IS a variable Dennis? # #

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 4:56:44 PM UTC-6, Steven D'Aprano wrote: Rick, what makes you think that this is logically inconsistent? Method is the accepted name for functions attached to classes. They report themselves as methods: [...] There are two built-ins for creating different types

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread prilisauer
Hello Dave, Thank you, for your help, I'll try my best. To all others, PLEASE be pleasant with my nescience, I'll tried to describe not a specific error at my Program. I'll tried to get rid of that missing link this sample is only theoretic, but the code really exists and is over 1000 lines

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread Cameron Simpson
On 24Dec2012 00:23, prilisa...@googlemail.com prilisa...@googlemail.com wrote: | To all others, PLEASE be pleasant with my nescience, I'll tried to | describe not a specific error at my Program. If you don't describe specific errors, you won't get specific advice. If you're after stylistic and

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread Alexander Blinne
At this point I think i could just refer to my other 2 postings and urge you to read them again. They offer the idea of encapsulating the function QuerySqlite into a method of an object that can be passed over to some object (possibly throu the __init__-method) and store it in an attribute of that

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread Dave Angel
On 12/24/2012 03:23 AM, prilisa...@googlemail.com wrote: Hello Dave, Thank you, for your help, I'll try my best. To all others, PLEASE be pleasant with my nescience, I'll tried to describe not a specific error at my Program. I'll tried to get rid of that missing link this sample is only

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread Dave Angel
Python is a flexible language, but manages to let one write readable code even while using that flexibility. It does, however, require that one gets a grasp of some concepts that may differ greatly, either in implementation or in name, from other languages. Every language has its quirks and

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-24 Thread Dave Angel
(Part 3 of my dissertation; I hope it's useful for you in particular) Up to now in my discussion, it wasn't usually important to know that everything is a class. You just know that everything has attributes, and that you use the dot notation to get at an attribute. So what if %x.format() is a

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread prilisauer
By the way, I think I have found the correct wording. for my understood, the handover of objects to imported modules doesn't work because, e.g. trying to hand-over an SQLite connection into a imported module, can't work because the attributes are not transfered. I'm sorry for my bad english,

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread prilisauer
secondly, it is absolutely not bad meaned, but, why does people post, their personal meaning, but nothing about the Posters Problem? Everybody is free to read or not, but correcting the WWW could became a very very big task, (maybe it's easier to climb the 7 summits) Best Regards. --

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Cameron Simpson
On 22Dec2012 12:43, prilisa...@googlemail.com prilisa...@googlemail.com wrote: | I Think I describe my Situation wrong, the written Project is a | Server, that should store sensor data, perfoms makros on lamps according | a sequence stored in the DB and Rule systems schould regulate home devices

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread prilisauer
Thanks to all your answers, I have read a lot about namespaces, but still there's something I do not understood. I have tried your example but as I expected: line 13, in HandoverSQLCursor curs.execute(SELECT * FROM lager) AttributeError: 'builtin_function_or_method' object has no attribute

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Peter Otten
prilisa...@googlemail.com wrote: Thanks to all your answers, I have read a lot about namespaces, but still there's something I do not understood. I have tried your example but as I expected: line 13, in HandoverSQLCursor curs.execute(SELECT * FROM lager) AttributeError:

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Roy Smith
In article mailman.1225.1356296379.29569.python-l...@python.org, prilisa...@googlemail.com wrote: Thanks to all your answers, I have read a lot about namespaces, but still there's something I do not understood. I have tried your example but as I expected: line 13, in HandoverSQLCursor

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread prilisauer
Okay, I try to publish this sample, and yes it's not a working piece of code, but I try to draw my problem that way. As you will see, I load modules, create cursor,... in the main.py. In the lower section you see, that the modules should execute sqls. In case It could occur that two queries

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Rhodri James
On Sun, 23 Dec 2012 21:42:14 -, prilisa...@googlemail.com wrote: Okay, I try to publish this sample, and yes it's not a working piece of code, but I try to draw my problem that way. So instead of telling us what your problem is, you're going to give us an artist's impression of your

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Terry Reedy
On 12/23/2012 4:32 AM, prilisa...@googlemail.com wrote: By the way, I think I have found the correct wording. for my understood, the handover of objects to imported modules doesn't work because, e.g. trying to hand-over an SQLite connection into a imported module, can't work because the

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Thomas Bach
Hi there, On Sun, Dec 23, 2012 at 01:42:14PM -0800, prilisa...@googlemail.com wrote: […] In the lower section you see, that the modules should execute sqls. In case It could occur that two queries occur at the same time. PS: IT IS NOT A QUESTION ABOUT SQL, etc. I do not understand, how I

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-23 Thread Dave Angel
On 12/23/2012 04:42 PM, prilisa...@googlemail.com wrote: Okay, I try to publish this sample, and yes it's not a working piece of code, but I try to draw my problem that way. As you will see, I load modules, create cursor,... in the main.py. In the lower section you see, that the modules

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Peter Otten
prilisa...@googlemail.com wrote: Hello, to all, I hope I can describe me problem correctly. I have written a Project split up to one Main.py and different modules which are loaded using import and here is also my problem: 1. Main.py executes: 2. Import modules 3. One of the Modules

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread prilisauer
Am Samstag, 22. Dezember 2012 12:43:54 UTC+1 schrieb Peter Otten: wrote: Hello, to all, I hope I can describe me problem correctly. I have written a Project split up to one Main.py and different modules which are loaded using import and here is also my problem:

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread prilisauer
Am Samstag, 22. Dezember 2012 13:38:11 UTC+1 schrieb prili...@googlemail.com: Am Samstag, 22. Dezember 2012 12:43:54 UTC+1 schrieb Peter Otten: wrote: Hello, to all, I hope I can describe me problem correctly. I have written a

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Peter Otten
prilisa...@googlemail.com wrote: I don't know, Python allways looks for me like a one script File. But there are big projects. like the the Model of an SQL Server, using coordinators no problems running threads and exchange Data through a Backbone. I have searched a lot, but I havent find

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread prilisauer
Am Samstag, 22. Dezember 2012 14:54:27 UTC+1 schrieb Peter Otten: wrote: I don't know, Python allways looks for me like a one script File. But there are big projects. like the the Model of an SQL Server, using coordinators no problems running threads and exchange Data through a

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Alexander Blinne
Am 22.12.2012 13:45, schrieb prilisa...@googlemail.com: Ps.: The Socket, the DB has to be kept allways open, because of it's Server functionality, A lot of Sensors, Timers, User interaction, must recived , Calculated, etc so a reaction must be send in about 16~100 ms, different modules

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread prilisauer
Am Samstag, 22. Dezember 2012 18:26:43 UTC+1 schrieb Alexander Blinne: Am 22.12.2012 13:45, schrieb: Ps.: The Socket, the DB has to be kept allways open, because of it's Server functionality, A lot of Sensors, Timers, User interaction, must recived , Calculated, etc so a reaction must

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Alexander Blinne
Am 22.12.2012 19:10, schrieb prilisa...@googlemail.com: It's for me a view of top side down, but how could the midlevel comunicate to each oter... not hirachical You could use something like the singleton pattern in order to get a reference to the same datastore-object every time

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread prilisauer
Am Samstag, 22. Dezember 2012 20:29:49 UTC+1 schrieb Alexander Blinne: Am 22.12.2012 19:10, schrieb: It's for me a view of top side down, but how could the midlevel comunicate to each oter... not hirachical You could use something like the singleton pattern in order to get a

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Terry Reedy
On 12/22/2012 7:45 AM, prilisa...@googlemail.com wrote: Am Samstag, 22. Dezember 2012 13:38:11 UTC+1 schrieb prili...@googlemail.com: Am Samstag, 22. Dezember 2012 12:43:54 UTC+1 schrieb Peter Otten: wrote: Hello, to all, And my mail reader text window is

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Alexander Blinne
Am 22.12.2012 21:43, schrieb prilisa...@googlemail.com: I Think I describe my Situation wrong, the written Project is a Server, that should store sensor data, perfoms makros on lamps according a sequence stored in the DB and Rule systems schould regulate home devices and plan scheduler jobs

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-22 Thread Dave Angel
On 12/22/2012 03:43 PM, prilisa...@googlemail.com wrote: snip I Think I describe my Situation wrong, the written Project is a Server, that should store sensor data, perfoms makros on lamps according a sequence stored in the DB and Rule systems schould regulate home devices and plan scheduler