Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4161

[BUG] ScriptEditor executes Python code while editing

$
0
0

The Rhino Script Editor IDE unexpectedly executes Python code while editing.
If a variable is named imported_data and you type a "." (dot), the IDE executes a previously imported module

Steps to Reproduce:

  1. Create a file with the following code, e.g.:
# testrun.py
import rhinoscriptsyntax as rs

def testprint():
    line_1 = "THIS IS STRANGE"
    line_2 = "UNUSUAL"
    line_3 = "BEHAVIOR"
    message_text = line_1 + "\n" + line_2 + "\n" + line_3
    rs.MessageBox(message_text)
  1. Save this file as “testrun.py”.
  2. Create a new file and save as e.g. “test2.py”.
  3. Insert the following code:
# test2.py
import testrun
from importlib import reload
reload(testrun)

imported_data = testrun.testprint()
  1. Execute this code.
  2. Try adding a dot (.) after imported_data on a new line.

Expected Behavior:

  • Nothing, just the dot.

Actual Behavior:

  • The IDE executes the function (testrun.testprint())

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4161

Latest Images

Trending Articles



Latest Images