# Adding python code to discourse replies

**URL:** <https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520>\
**Category:** Site Feedback\
**Tags:** windows, discourse\
**Created:** [September 8, 2026, 8:50pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520 "2026-09-08T20:50:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [September 8, 2026, 8:50pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520/1 "2026-09-08T20:50:58Z")

</div>

Hello colleagues,

For the last few years, it was possible to type python code in discourse.mcneel replies like this:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/c/5/4c5e1290d6ab000d8dd5391382b1c5dcdf70087d.png)

But it seems something changed recently.  
Because upper syntax does not work anymore, and discourse automatically makes “Preformated text”, out of upper text:

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/f/1/7f1400cf7c20b5681e842209ec917277f17bbc65.png)

Does anyone know, how can we add python code to a discourse reply?

Thank you very much for the help.

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/772741_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [September 8, 2026, 9:47pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520/2 "2026-09-08T21:47:47Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/c/7/1c7b19a2c5bd454ba01064daa15b6fca142cb49e.png)

```python
def hello_world():
    print("Hello from Python!")

```

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [September 8, 2026, 10:02pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520/3 "2026-09-08T22:02:30Z")

</div>

Thank you Dale. For some reason, it does not work on my side anymore.  
I immediately get the “Preformated text”.

---

<div class="post-metadata">

**Author:** ![jeremy5](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jeremy5/32/773943_2.png) [@jeremy5](https://discourse.mcneel.com/u/jeremy5)\
**Post date:** [September 8, 2026, 10:03pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520/4 "2026-09-08T22:03:13Z")

</div>

I think you must have toggled into Rick Text Editor mode like this:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/9/d/d9ddce0a8696ae05dd139731f9ed3594b2408f03.png)

You can get back to the standard editor by clicking where marked, taking you back to:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/a/f/e/afe6961d1af8c8dc0678ef73d5f04c617652cafb.png)

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [September 8, 2026, 10:35pm UTC](https://discourse.mcneel.com/t/adding-python-code-to-discourse-replies/222520/5 "2026-09-08T22:35:20Z")

</div>

Hi @jeremy5 ,

It worked perfectly!  
Thank you very much for the help!

```python
def Addition(a, b):
    c = a + b
    return c

```
