# ¿como importar modulos .py locales y funciones a el archivo .html?

**URL:** <https://forum.anaconda.com/t/como-importar-modulos-py-locales-y-funciones-a-el-archivo-html/22111>\
**Category:** PyScript\
**Created:** [May 17, 2022, 8:24pm UTC](https://forum.anaconda.com/t/como-importar-modulos-py-locales-y-funciones-a-el-archivo-html/22111 "2022-05-17T20:24:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamartinz](https://avatars.discourse-cdn.com/v4/letter/t/0075a9/32.png) [@tamartinz](https://forum.anaconda.com/u/tamartinz)\
**Post date:** [May 17, 2022, 8:24pm UTC](https://forum.anaconda.com/t/como-importar-modulos-py-locales-y-funciones-a-el-archivo-html/22111/1 "2022-05-17T20:24:57Z")

</div>

hola buenas tardes requiero ayuda,estoy tratando de importar unos modulos que tengo dentro de la misma carpeta del index.html y aun no he podido por favor si alguien me puede dar un ejemplo claro de como hacerlo:  
ejemplo:  
carpeta local:  
-index.htm  
-prueba.py  
-def a().

---

<div class="post-metadata">

**Author:** ![neil](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/neil/32/1303_2.png) [@neil](https://forum.anaconda.com/u/neil)\
**Post date:** [May 28, 2022, 12:25pm UTC](https://forum.anaconda.com/t/como-importar-modulos-py-locales-y-funciones-a-el-archivo-html/22111/2 "2022-05-28T12:25:09Z")

</div>

Hola @tamartinz - I hope I’ve understood your question correctly: you want a simple example importing a module in the same folder as your index.html file.

If so, then I think the example from the **Getting Started** page should help, in the section **Local Modules** :

> <https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md#local-modules>

Also you will need to serve the files with a server. Anything local will do, such as running this from the same folder as your code/HTML:

```
`python3 -m http.server 8000`

```

Hope that helps!
