# Python To Snap

**URL:** <https://forum.snap.berkeley.edu/t/python-to-snap/13057>\
**Category:** Snap! Editor\
**Created:** [January 23, 2023, 6:54am UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057 "2023-01-23T06:54:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![masakim](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/m/779978/32.png) [@masakim](https://forum.snap.berkeley.edu/u/masakim)\
**Post date:** [January 23, 2023, 6:54am UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057/1 "2023-01-23T06:54:20Z")

</div>

Hello, i need help on how I could convert this into a custom snap block.

def run():  
sum = 0  
for i in range(11):  
sum += i  
print(sum)

run()

---

<div class="post-metadata">

**Author:** ![d4s\_over\_dt4](https://forum.snap.berkeley.edu/letter_avatar_proxy/v4/letter/d/a4c791/32.png) [@d4s\_over\_dt4](https://forum.snap.berkeley.edu/u/d4s_over_dt4)\
**Post date:** [January 23, 2023, 6:57am UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057/2 "2023-01-23T06:57:18Z")

</div>

![untitled script pic (32)](https://cdn.forum.snap.berkeley.edu/original/3X/b/9/b9f1bb5dc2bba42714b297f02f901933c201b068.png)

---

<div class="post-metadata">

**Author:** ![ego-lay\_atman-bay](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/ego-lay_atman-bay/32/1395_2.png) [@ego-lay\_atman-bay](https://forum.snap.berkeley.edu/u/ego-lay_atman-bay)\
**Post date:** [January 23, 2023, 7:42am UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057/3 "2023-01-23T07:42:42Z")

</div>

You can create a custom block (function) by clicking the + sign at the top right corner of the blocks palette. Another way is by clicking "Make a block" at the bottom of the blocks palette. Once you give the block a name, and choose it's shape, click ok. You will get a new scripting area. Once there, you can create the script like this.

 ![image](https://cdn.forum.snap.berkeley.edu/original/3X/e/9/e988f6be7aed3dfd6e445bf2f644acef210e9879.png)

Of course from the looks of this script, it looks like it should be a reporter (round block), like this.

 ![image](https://cdn.forum.snap.berkeley.edu/original/3X/a/f/af63b79093c874959b6488d0628326bfc2d538bb.png)

---

<div class="post-metadata">

**Author:** ![alessandrito123](https://forum.snap.berkeley.edu/user_avatar/forum.snap.berkeley.edu/alessandrito123/32/8372_2.png) [@alessandrito123](https://forum.snap.berkeley.edu/u/alessandrito123)\
**Post date:** [January 23, 2023, 3:05pm UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057/4 "2023-01-23T15:05:27Z")

</div>

> [@d4s\_over\_dt4](#):
>
> ![untitled script pic (32)](https://cdn.forum.snap.berkeley.edu/original/3X/b/9/b9f1bb5dc2bba42714b297f02f901933c201b068.png)

@d4s_over_dt4 Wow, you are explaining the best data, good guy, the top block that is in your picture is a new feature that the developer Jens implemented to create custom blocks faster, WOW, you really impressed me. 🤩

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.snap.berkeley.edu/original/2X/d/dc8cfa4b1c99bd810b188b58c718084d8f47e271.svg) [@system](https://forum.snap.berkeley.edu/u/system)\
**Post date:** [February 23, 2023, 12:56am UTC](https://forum.snap.berkeley.edu/t/python-to-snap/13057/6 "2023-02-23T00:56:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
