# Devs: Multi-File Python Projects

**URL:** <https://forum.makecode.com/t/devs-multi-file-python-projects/28386>\
**Category:** Help\
**Created:** [April 23, 2024, 2:06am UTC](https://forum.makecode.com/t/devs-multi-file-python-projects/28386 "2024-04-23T02:06:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [April 23, 2024, 2:06am UTC](https://forum.makecode.com/t/devs-multi-file-python-projects/28386/1 "2024-04-23T02:06:36Z")

</div>

@richard , @jwunderl , & other devs: I’m seeking assistance. 😃 Second of two threads.

In another thread[1], I was attempting to assist one of our forum members with Python and the project explorer. We can create multi-file projects in JavaScript just fine. Namespaces are possible but not required.

I’m curious on where we are with similar projects in Python.

I can see that some translation helpers have been added to attempt to support namespaces in Python. The following JavaScript code gets translated to the Python code below it by the editor.

```typescript
// JavaScript version
namespace game1 {
    export function start() {
        // Do stuff
    }
}

```

```python
# Python version
@namespace
class game1:
    def start():
        # Do stuff
        pass

```

I cannot quite get the Python namespace bit working, though I suspect it’s a work in progress. No worries. If I simply add Python code to a second file (named, say, **game1.py** ), though, the editor behaves differently from how it behaves with JavaScript.

In JavaScript, you can split code across multiple files and it works just fine. No alterations needed. Functions can be referenced across files without any additional decoration. Code that does not reside within functions runs as if it existed within an `on start` container in Blocks … even if that code is spread across multiple files.

In Python, it seems like, even without the `@namespace` and class decorations, the editor still creates an “implicit” namespace around code that resides outside of the **main.py** file. This is IntelliSense kicking in when I try to call the `Game1_Start()` function found in the **game1.py** file in my project.

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/716c5edaa2dbf16a558a36a8a4e05c21b3f8ea85.png)

Are namespaces required in multi-file Python projects? If so, are they ready to use, or are they a work in progress?

* * *

[1] [MakeCode Arcade Explorer Help](https://forum.makecode.com/t/makecode-arcade-explorer-help/28348)

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [April 23, 2024, 2:10am UTC](https://forum.makecode.com/t/devs-multi-file-python-projects/28386/2 "2024-04-23T02:10:53Z")

</div>

Some code, if you’d like. 😆 Can’t believe I forgot to include it!

> **[Game Choice Python](https://arcade.makecode.com/47859-85988-63129-18108)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [April 23, 2024, 7:29pm UTC](https://forum.makecode.com/t/devs-multi-file-python-projects/28386/3 "2024-04-23T19:29:12Z")

</div>

this would not surprise me… tbh, we don’t test the multi-file python scenario (I didn’t even know it worked at all) so it may be broken in unexpected ways.

---

<div class="post-metadata">

**Author:** ![Astronomicality22](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/astronomicality22/32/18365_2.png) [@Astronomicality22](https://forum.makecode.com/u/Astronomicality22)\
**Post date:** [April 23, 2024, 10:28pm UTC](https://forum.makecode.com/t/devs-multi-file-python-projects/28386/4 "2024-04-23T22:28:29Z")

</div>

I think this would be cool to have a way to use many files in python, like a file of a certain instance and another (entire segments, of course) and have it call a file at the end which links the code with an extra-efficient couple of instructions.
