Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #35441
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <d@davea.name> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:: [': 0.03; 'argument': 0.04; 'subject:Python': 0.05; 'method.': 0.05; 'socket': 0.05; 'arguments': 0.07; 'subject:help': 0.07; 'cmd': 0.09; 'filenames,': 0.09; 'imports': 0.09; 'skip:# 60': 0.09; 'sql,': 0.09; 'sqlite': 0.09; 'subject:2.7': 0.09; 'subject:Help': 0.10; 'def': 0.10; '........': 0.16; 'elsewhere.': 0.16; 'here..': 0.16; 'lowercase': 0.16; 'modules,': 0.16; 'parameters,': 0.16; 'sees': 0.16; 'socketserver': 0.16; 'subject:] [': 0.16; 'tcp': 0.16; 'threaded': 0.16; 'threading': 0.16; 'wrote:': 0.17; 'driver': 0.17; 'code,': 0.18; 'subject:] ': 0.19; 'load': 0.19; 'module': 0.19; 'skip:p 30': 0.20; 'parameters': 0.20; 'trying': 0.21; 'import': 0.21; 'names.': 0.22; 'help.': 0.22; 'device': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'question': 0.27; 'connects': 0.27; 'module.': 0.27; 'see,': 0.27; 'piece': 0.29; 'skip:( 50': 0.29; 'skip:q 20': 0.29; '"the': 0.29; 'class': 0.29; "we're": 0.30; 'attach': 0.30; 'bus': 0.30; 'function': 0.30; 'code': 0.31; 'file': 0.32; 'could': 0.32; 'getting': 0.33; 'builds': 0.33; 'skip:h 40': 0.33; 'handle': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'skip:d 20': 0.34; 'self': 0.34; 'done': 0.34; 'server': 0.35; 'whatever': 0.35; 'returning': 0.35; 'pm,': 0.35; 'something': 0.35; 'really': 0.36; 'but': 0.36; 'modules': 0.36; 'should': 0.36; 'thank': 0.36; 'execute': 0.37; 'two': 0.37; 'being': 0.37; 'data': 0.37; 'mean': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'your': 0.60; 'lower': 0.61; 'first': 0.61; 'different': 0.63; 'here': 0.65; 'stuck': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'informations': 0.75; 'dali': 0.84; 'her,': 0.84; 'presumably': 0.84; 'received:74.208.4.194': 0.84; 'transmits': 0.84; 'understand,': 0.84; 'understood.': 0.84; 'habit': 0.91; 'anywhere,': 0.93; 'period.': 0.95 |
| Date | Mon, 24 Dec 2012 00:19:18 -0500 |
| From | Dave Angel <d@davea.name> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) |
| References | <37264cd5-8acd-416b-a808-50216f9fbfa0@googlegroups.com> <mailman.1220.1356260119.29569.python-list@python.org> <mailman.1225.1356296379.29569.python-list@python.org> <roy-52F25F.16151223122012@news.panix.com> <3f14f739-e660-4883-a940-c77a6092cb79@googlegroups.com> |
| In-Reply-To | <3f14f739-e660-4883-a940-c77a6092cb79@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V02:K0:d9Fnh0OULFBDThCkE6ysiBMYfd4M5hwuP+CRx03fgtJ hzuSYiWlAdvSCszcJNn82s2wGuETUQlBTRrYt/zix2mmg0YMsq d/H5iQsfXlbDM2/KB5MPnkfQl8OYUvhYXBIIkR+mDOu3iUWOUB fC+erejPh8fl6b8iMIcfwh6U8etOFOPkUN8uPOrEDSTpke8rnI lmLVBr28o4NFwqyBE1op80MDjXg5iNzaliySvaYVWJSzEotPAL k7SbFKVMDsA6OCx7YYUP5KiN9ULneSZtOXQmT1sv66qV7bAtRB HV4ruSyQ4asFW+37YhmJMM5TBB7+xiS8mF8of7Cqd4A5Okt4AS M4W8M/Y92LnUDsFp54Yg= |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | d@davea.name |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1240.1356326385.29569.python-list@python.org> (permalink) |
| Lines | 84 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1356326385 news.xs4all.nl 6890 [2001:888:2000:d::a6]:54964 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:35441 |
Show key headers only | View raw
On 12/23/2012 04:42 PM, prilisauer@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 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 could handle the part which is marked with Problemsection1 and Problemsection2
You're miles from being ready to worry about "the same time." Don't
start threading till you can get a simple multi-module program understood.
> I hope really found the right "wording". thank to all your help.
>
>
> main.py
For some reason you capitalize all those filenames, so you're stuck with
unpythonic module names. If you want your code readable, use lowercase
for module name, and Capitalized for class name.
> import HomeLog # LogHandler
> import HomeSocketServer # Threaded TCP Socket Server
> import HomeDatastore # SQLite DB
> import HomeDaliServer # Connects to USB Device
> import HomeScheduler # Advanced scheduler functions
>
>
> # Attach Loghandler
> Loghandler = HomeLog.Logging()
> # Attach SocketServer
> HomeSocketServer.HomeSocketServerStart()
>
> # Attach Scheduler
> HomeSched = HomeScheduler.HomeScheduler()
> HomeSched.SchedulerStart()
> HomeSched.SchedulerJobs()
>
> # Attach Datastore
> Datastore=HomeDatastore.HomeDBStore()
> Datastore=Datastore.Startup()
>
> #Attach Dali Driver
> Dali=HomeDaliServer.Startup()
> # This is a "Sample" that builds 2byte Cmd and transmits it on bus
> PowerOnLamp1=Dali.send(0,0,1,80)
>
> ###############################################################
> HomeDaliServer.py
import HomeDatastore
> ........
> def send (self,DaliAdress,RequestType,Request,RequestValue):
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.
> # Problemsection1:
> # Here it's getting Interesting
> # We're at the HomeDaliServer, and now I want to use QuerySqlite() in the file HomeDatastore.py
So call it:
firstarg = whatever * RequestType
secondarg = something different + RequestValue
result = HomeDatastore.QuerySqlite(firstarg, secondarg)
> ###############################################################
> HomeScheduler.py
Where are your import statements? No module automatically sees imports
that were done elsewhere. Import what you need in a module.
> # Problemsection2:
> # If new workerthread is started, Informations must be queried using QuerySlite() and also update data
I don't see any 'update data' function anywhere, but if you want to call
QuerySqlite, you need to call it:
thisresult = HomeDatastore.QuerySqlite(him, her, theother)
>
> ###############################################################
> HomeDatastore.py
> def QuerySqlite():
You presumably mean
def QuerySqlite(firstparam, secondparam):
since a function with no arguments is going to be stuck trying to use
globals, and that's not a good habit to get into.
> #doing something here..
#doing something with those parameters, and only those parameters
> # returning Data
>
> ###############################################################
>
--
DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 02:59 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-22 12:43 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:38 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-22 14:54 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 08:36 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 08:36 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:38 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:45 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Terry Reedy <tjreedy@udel.edu> - 2012-12-22 16:30 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 04:45 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 18:26 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 10:10 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 20:29 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-22 12:43 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-22 22:59 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 01:32 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Terry Reedy <tjreedy@udel.edu> - 2012-12-23 20:53 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Alexander Blinne <news@blinne.net> - 2012-12-24 14:10 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-22 17:03 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Cameron Simpson <cs@zip.com.au> - 2012-12-23 21:55 +1100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 12:59 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Peter Otten <__peter__@web.de> - 2012-12-23 22:14 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 12:59 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Roy Smith <roy@panix.com> - 2012-12-23 16:15 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 13:42 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) "Rhodri James" <rhodri@wildebst.demon.co.uk> - 2012-12-23 23:38 +0000
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-24 00:01 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Thomas Bach <thbach@students.uni-mainz.de> - 2012-12-24 06:18 +0100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 00:19 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-24 00:23 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Cameron Simpson <cs@zip.com.au> - 2012-12-24 21:32 +1100
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 10:48 -0500
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Ranting Rick <rantingrickjohnson@gmail.com> - 2012-12-24 21:10 -0800
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 04:55 -0800
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-25 16:04 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 11:47 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-24 18:09 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-24 00:23 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-25 13:44 +0000
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 06:41 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dave Angel <d@davea.name> - 2012-12-25 12:10 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 09:31 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-25 09:31 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 12:16 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-25 16:08 -0500
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 15:42 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Michael Torrie <torriem@gmail.com> - 2012-12-26 12:20 -0700
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Michael Torrie <torriem@gmail.com> - 2012-12-26 11:58 -0700
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 15:42 -0800
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) alex23 <wuwei23@gmail.com> - 2012-12-25 19:18 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 12:16 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-25 22:56 +0000
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-25 16:19 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-26 08:29 +0000
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Rick Johnson <rantingrickjohnson@gmail.com> - 2012-12-26 20:07 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-27 05:02 +0000
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Ranting Rick <rantingrickjohnson@gmail.com> - 2012-12-26 22:50 -0800
Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) Chris Angelico <rosuav@gmail.com> - 2012-12-27 23:58 +1100
Re: Require help migrating from Perl to Python 2.7 (namespaces) alex23 <wuwei23@gmail.com> - 2012-12-27 05:25 -0800
Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces) prilisauer@googlemail.com - 2012-12-23 01:36 -0800
csiph-web