# Python functionality in Dynamo

**URL:** <https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824>\
**Category:** Developers\
**Tags:** python, dynamo\
**Created:** [June 12, 2024, 7:58am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824 "2024-06-12T07:58:59Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 7:58am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/1 "2024-06-12T07:58:59Z")

</div>

Bit of a gripe, or maybe there’s a function I’m unaware of (I hope)…

In Dynamo I have a perfectly fine looking bit of code:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/6/b666a84f543d10f7c5ee186c850f1a43a523ea35.png)

However, I get an indent error, which I get a lot…

I constantly have Visual Studio open which instantly shows me where the issue is:

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/0/6037cb7fd78bec04a435e9a0e99ba2a5dc52dc07.png)

And in VS I can really easily shift +tab…

Any chance this functionality can be added to the Python window in Dynamo?

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:09am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/2 "2024-06-12T08:09:02Z")

</div>

Please submit this as an Idea to the roadmap, I think it would be a good idea to make the Python node in to a better “IDE”  
[Roadmap - Dynamo BIM](https://dynamobim.org/roadmap/)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:11am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/3 "2024-06-12T08:11:32Z")

</div>

How do you submit an idea, that link takes me to the roadmap and shows me what they’re doing / not doing. I couldn’t see anywhere to submit.

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:14am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/4 "2024-06-12T08:14:25Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/c/fc2cae193083f5ee2248ebb4d65a4e023a322b21.png)

Don’t you have the button in the upper right corner?

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:16am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/5 "2024-06-12T08:16:38Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/0/60c71fc3d56ed09372c821bafa4cc2d96e4aaf3d.png)

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:20am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/6 "2024-06-12T08:20:20Z")

</div>

Do you know if there is any special demands to be able to Submit ideas to the roadmap?@zachri.jensen @jacob.small

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:21am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/7 "2024-06-12T08:21:42Z")

</div>

Tbh it’s probably my browser… I get a lot of vanishing stuff.  
👻

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:22am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/8 "2024-06-12T08:22:44Z")

</div>

I can fix the submitting to the road map if you want me to.

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:25am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/9 "2024-06-12T08:25:45Z")

</div>

Thanks, my usual work around worked:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/d/1dde4c41e89fef157ec6551d23e1147fd7426a5d.png)

I think it’s got something to do with my cache… but further than that I have no clue why it does this.

I have loads of issues with wikipedia.

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:26am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/10 "2024-06-12T08:26:57Z")

</div>

I submitted it

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:27am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/11 "2024-06-12T08:27:10Z")

</div>

Me too 😃

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 12, 2024, 8:29am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/12 "2024-06-12T08:29:33Z")

</div>

> [@Alien](#):
>
> I think it’s got something to do with my cache… but further than that I have no clue why it does this.

It is your cache. Clear it out and you should be fine. Stop trying to eat the cookies to prevent the issue from recurring; they aren’t tasty anyway.

Switching on the 'show white space" in your Python preferences makes finding these pretty easy, though not as easy as VS as Dynamo’s editor doesn’t check the code until it attempts to execute (otherwise it’d have to periodically call the functions you’re building which would eventually crash Revit/Civil/Dynamo).

---

<div class="post-metadata">

**Author:** ![patrick.ericson](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/patrick.ericson/32/121411_2.png) [@patrick.ericson](https://forum.dynamobim.com/u/patrick.ericson)\
**Post date:** [June 12, 2024, 8:38am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/13 "2024-06-12T08:38:35Z")

</div>

> [@jacob.small](#):
>
> Stop trying to eat the cookies to prevent the issue from recurring; they aren’t tasty anyway

😃

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [June 12, 2024, 8:42am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/14 "2024-06-12T08:42:17Z")

</div>

I cleared my cache last week and I regretted it… All my lovely cookies gone and I had to dredge my memory for passwords…

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [June 12, 2024, 9:49am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/15 "2024-06-12T09:49:54Z")

</div>

Hi,  
it has a feature that was recently added

> <https://github.com/DynamoDS/Dynamo/pull/15179>
>
> \### Purpose
> 
> PR to address https://jira.autodesk.com/browse/DYN-6794 & https:/…/github.com/DynamoDS/Dynamo/issues/15033 .
> Added button in the Python script editor to convert tab indentations from legacy Python code to space indentations.
> Includes test.
> 
> !\[DYN-6794-fix\](https://github.com/ivaylo-matov/Dynamo/assets/48355182/744e4589-0621-4984-907e-bbfff9c79c0e)
> 
> \### Declarations
> 
> Check these if you believe they are true
> 
> \- \[\] The codebase is in a better state after this PR
> \- \[\] Is documented according to the \[standards\](https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards)
> \- \[\] The level of testing this PR includes is appropriate
> \- \[\] User facing strings, if any, are extracted into \`\*.resx\` files
> \- \[\] All tests pass using the self-service CI.
> \- \[\] Snapshot of UI changes, if any.
> \- \[\] Changes to the API follow \[Semantic Versioning\](https://github.com/DynamoDS/Dynamo/wiki/Dynamo-Versions) and are documented in the \[API Changes\](https://github.com/DynamoDS/Dynamo/wiki/API-Changes) document.
> \- \[\] This PR modifies some build requirements and the readme is updated
> \- \[\] This PR contains no files larger than 50 MB
> 
> \### Release Notes
> 
> Added button in Python to convert tab indentations to space indentations so that users can run legacy code.
> Icon for the convert button is a place holder.
> 
> PS: Tried a few options where we suppress the conversion to spaces in PythonIndentationStrategy but ultimately they all lead to problems beyond just pasting code with tab indentations. Preserving the current strategy and converting legacy code to the modern convention seem a better solution.
> 
> \### Reviewers
> 
> @dnenov
> @reddyashish
> 
> \### FYIs
> 
> @Amoursol

---

<div class="post-metadata">

**Author:** ![haganjake2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/haganjake2/32/119069_2.png) [@haganjake2](https://forum.dynamobim.com/u/haganjake2)\
**Post date:** [June 12, 2024, 10:34am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/16 "2024-06-12T10:34:40Z")

</div>

Use this comment as an “I hate being forced to use spaces” button.

(Hate from space bar losers incoming in 3,2,1…)

😅

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 12, 2024, 11:38am UTC](https://forum.dynamobim.com/t/python-functionality-in-dynamo/101824/17 "2024-06-12T11:38:29Z")

</div>

> [@haganjake2](#):
>
> Use this comment as an “I hate being forced to use spaces” button.

Count me in.

- 4x the file size for formatting
- Increased compiler time
- Increased memory consumption
- Increased accessibility for people using screen readers (some of which are limited to 12 characters, and white spaces count)

The only ‘benefit’ I have seen for spaces is that they ensure consistency across environments - a space in notepad is the same dimension as a space in VisualStudio as a space in the Dynamo Python Ecitor is the same as a web page… but even that isn’t true as people can (and will) adjust kerning and font selection, so… yeah.

I would be happy if the ‘paste’ command forced tabs to become spaces, but until then I’ll point out that [we aren’t being as welcoming as we could](https://dev.to/alexandersandberg/why-we-should-default-to-tabs-instead-of-spaces-for-an-accessible-first-environment-101f#:~:text=The%20one%20real%20reason%20to%20use%20tabs%20over%20spaces&text=By%20using%20tabs%20in%20our,we%20can%20not%20ignore%20that.) to all any time the topic comes up.
