471,354 Members | 1,632 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Find This Module

I'm looking at the source for the module sre_compile.py and it does
this import:

import _sre

But I can't find a file related to _sre anywhere. Where is it? And
more generally, how does one find the location of a built in module?

Thanks,

Greg

Jul 4 '07 #1
2 942
On Wed, 04 Jul 2007 20:00:07 +0000, gr********@gmail.com wrote:
I'm looking at the source for the module sre_compile.py and it does
this import:

import _sre

But I can't find a file related to _sre anywhere. Where is it? And
more generally, how does one find the location of a built in module?
It's built into the interpreter executable.

In [85]: import _sre

In [86]: _sre
Out[86]: <module '_sre' (built-in)>

Ciao,
Marc 'BlackJack' Rintsch
Jul 4 '07 #2
gr********@gmail.com wrote:
I'm looking at the source for the module sre_compile.py and it does
this import:

import _sre

But I can't find a file related to _sre anywhere. Where is it?
If you want the source code, have a look at

http://svn.python.org/view/python/tr...47&view=markup
And more generally, how does one find the location of a built in module?
For the source of modules written in C, built in or not, you have to look in
the source distribution.

Peter
Jul 5 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Andreas Neudecker | last post: by
2 posts views Thread by Mark D. Richter | last post: by
6 posts views Thread by bobueland | last post: by
reply views Thread by bblais | last post: by
3 posts views Thread by David T. Ashley | last post: by
3 posts views Thread by Lance Hoffmeyer | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.