Python Forum
Looking for a "custom" script editor
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Looking for a "custom" script editor
#1
I started with python in a 3D-application (Autodesk Maya), and I fell in love with its script editor. It looks like this:
[Image: Editor-Maya.png]

It executes code when the right return-key is pressed. If no text is selected, it will execute all of the code. Else if something is selected, it will execute the selected code.


The reason I can't just continue using the 3D-application to work with python in is that it only works with python 2.7. I'm in the process of moving towards python 3.7, so I need an alternative. All of the standard editors feels "clunky" to me, and I don't really need anything other than simple input/output in my editor.


Here's what I'm looking for (in chronological order):
  1. Always executes selected code only (if no selection, everything is executed)
  2. Option to specify hotkey (for executing code)
  3. Clean design, I don't need (or want) anything other than editor & output
  4. Portable

It's basically just a slick wrapper, is there anything like this out there? I'm sure there is, but I haven't been able to find one. Any tips would be greatly appreciated :)
Reply
#2
Quote:The reason I can't just continue using the 3D-application to work with python in is that it only works with python 2.7.
Why cant you just point that editor that you have been using to use python3.7? All editors have a method to change which python interpreter you are executing. Some are drop down menus, while others are config files you have to manually change.

What IDE's have you used? Which ones do you feel are clunky?

Have you tried PyCharm?
   

I feel like all the big IDE's would have this feature.

Also every IDE out there allows for custom hotkeys. In pycharm File -> Settings -> KeyMap
Recommended Tutorials:
Reply
#3
(Jul-20-2019, 08:27 PM)metulburr Wrote: Why cant you just point that editor that you have been using to use python3.7?
The editor is just a sub-part of a 3D-application, its script editor is "hardcoded" pointing to it's own version of python 2.7, sadly.

(Jul-20-2019, 08:27 PM)metulburr Wrote: What IDE's have you used? Which ones do you feel are clunky?
My main IDE is Sublime Text, I write in this, but when testing and prototyping stuff I do it in the editor that I mentioned (in the 3D-app), as it's just way faster to test my code line for line some times. I wouldn't mind using Sublime for this, but I still haven't found a good way of executing highlighted text only. I did try the BuildParts plugin, it executes highlighted code, but it doesn't keep history. I would like to run one line (myVar=(3+3)), and then running (print(myVar)) in another execution (while still keeping the data declared in the previous execution).

Clunky might not be the best way to describe them, it might just be me that are clunky Confused I don't know, it just overwhelms me a bit having to create custom "build systems" just to run code, still haven't figured out how I can execute python code without working in a saved document. Like I said though, if you know of a good way of executing highlighted words/lines in sublime, I would very much appreciate that :)
Reply
#4
There are Autodesk Maya extensions for VSCode, see
https://marketplace.visualstudio.com/ite...f.mayacode
https://marketplace.visualstudio.com/ite...y.mayaport
http://iwonderwhatjoeisworkingon.blogspo...-code.html
https://forums.autodesk.com/t5/maya-prog...-p/8835843
more...
See on this forum for installation of VSCode: https://python-forum.io/Thread-VS-Code-from-start
Reply
#5
I dont know i dont use sublime text. I didnt really like it.

(Jul-20-2019, 10:44 PM)NewBeginnings Wrote: it just overwhelms me a bit having to create custom "build systems" just to run code
I am not sure what you mean by custom "build systems" to run code? You install python3.7 on your system, and point whatever IDE/Editor you use to to its interpreter. I would bet that there is a way to modify where that editor points to, but i dont have it so i cant play with it to try. IF you can find where their python interpeter resides, you might be able to replace it with python3.x, or a config file to change the path to the interpreter.

(Jul-20-2019, 10:44 PM)NewBeginnings Wrote: still haven't figured out how I can execute python code without working in a saved document.
The only way i know how to work with python without saving on hard disk, is web. Stuff like this.

(Jul-20-2019, 10:44 PM)NewBeginnings Wrote: if you know of a good way of executing highlighted words/lines
What you are talking about is called selective execution. Maybe google that for IDE's that cover that.
Recommended Tutorials:
Reply
#6
I've put together an example video to better illustrate what I want: https://streamable.com/13fu7

[Image: examplesublime-min.gif]
Reply
#7
I know what you want. You have already explained it. And the video confirms it.
I am not sure which IDE's have selective execution as i dont use it, so i never kept tabs on which ones have that option over the years. I do know PyCharm does as i tried it after this thread. Explained here. It might not be an identical IDE compared to what you are used to, but it does the same thing. And the community edition is free.

If you dont like PyCharm, my suggestion would be to install various IDE's and look for selective execution options in it. Google the IDE and see which ones have it. Googling myself, this comes up as some other otpions. Note: You dont need a python IDE, any IDE can run python even if its for c/c++/java, etc. So dont restrict yourself by googling it as python IDE like this person did.
Recommended Tutorials:
Reply
#8
VS Code has this
https://code.visualstudio.com/docs/pytho...ello-world Wrote:Select one or more lines, then press Shift+Enter or right-click and select Run Selection/Line in Python Terminal. This command is convenient for testing just a part of a file.
Reply
#9
(Jul-21-2019, 12:32 PM)metulburr Wrote: I do know PyCharm does as i tried it after this thread. Explained here.
You're right, sorry. I'll check out PyCharm and VS Code, thanks everyone Smile
Reply
#10
Dont bypas this as well. You guys posted at the same time, so you might of missed it.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Music Notation editor; how to build the editor? direction to go? philipbergwerf 1 1,652 Jan-01-2022, 04:56 PM
Last Post: Larz60+
  python script file not opening in IDLE editor srm 2 4,338 Jun-23-2019, 08:45 AM
Last Post: Larz60+
  script editor abrew132 4 4,322 Apr-20-2017, 08:34 PM
Last Post: Josh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020