Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Noddy with submodules?

Reply
Thread Tools

Noddy with submodules?

 
 
Torsten Mohr
Guest
Posts: n/a
 
      09-07-2009
Hi,

i want to write a Python module that interfaces a DLL that we use in the
office to do some measurement.

So i'd like to write a python module in C (which i did before some times).

But i'm not sure how i can create a module in a way that i can later do:

import measurement
import measurement.adc
import measurement.adc.channels
import measurement.pwm

What do i need to do to create submodules within the initialisation code
of a python module written in C?

Maybe there is an example based on "noddy"?


Thanks for any hints,
Torsten.


 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      09-08-2009
En Mon, 07 Sep 2009 18:55:11 -0300, Torsten Mohr <(E-Mail Removed)>
escribió:

> So i'd like to write a python module in C (which i did before some
> times).
>
> But i'm not sure how i can create a module in a way that i can later do:
>
> import measurement
> import measurement.adc
> import measurement.adc.channels
> import measurement.pwm
>
> What do i need to do to create submodules within the initialisation code
> of a python module written in C?


I think it's easier to write a wrapper module in Python. See the xml.etree
package; the cElementTree.py Python module just contains "from
_elementtree import *" (_elementtree being a C extension)

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are you NODDY! Just Another Residents Fan Digital Photography 6 10-12-2006 10:34 AM
Looking for Noddy Hillen120 DVD Video 0 07-20-2004 10:09 PM
noddy example, writing C modules for python Torsten Mohr Python 3 06-02-2004 12:37 PM
Noddy question about standard vhdl libs GlennH VHDL 1 07-11-2003 03:01 PM



Advertisments