# Imported class from another tab doesn't work

**URL:** <https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135>\
**Category:** Processing.py\
**Created:** [June 24, 2020, 7:41pm UTC](https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135 "2020-06-24T19:41:58Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [June 24, 2020, 8:09pm UTC](https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135/2 "2020-06-24T20:09:02Z")

</div>

> [@Tahsin](#):
>
> I’m getting the error: NameError: global name ‘v’ is not defined

I believe you’ve got instead NameError: global name ‘voronoi’ is not defined, right?

> [@Tahsin](#):
>
> `from voronoi_class import *`

Should be instead: `from voronoi_class import voronoi`

> [@Tahsin](#):
>
> ```auto
> global v
> 
> def setup():
> 
> ```

Keyword `global` should go inside a function instead:

> **[Globals \\ Language (API)](https://py.processing.org/reference/globals.html)**
>
> Python Mode for Processing extends the Processing Development Environment with the Python programming language.

```auto
def setup():

    # ...

    global v
    v = voronoi(100, w, h)
    println(v.r)

```

> [@Tahsin](#):
>
> `class voronoi:`

It’s customary for class names to be “CamelCase” instead: `class Voronoi:`

---

_[View the full topic](https://discourse.processing.org/t/imported-class-from-another-tab-doesnt-work/22135)._
