Book a Demo

Author Topic: How should I run a python script, directly on EA with the help of javascript?  (Read 2400 times)

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Hello all,

I have a python code that needs to run on EA, (the code works outside EA and all is fine) I thought maybe using Javascript in scripting tool that EA provides is the answer, as it's been awhile since I have used JavaScript (without HTML for that matter) any code templates I can use?

thank you

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Python will run entirely outside EA. Use Win32 to either create an EA instance or to connect to a running one (I usually use the latter).

q.

ArshiaZare

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Python will run entirely outside EA. Use Win32 to either create an EA instance or to connect to a running one (I usually use the latter).

q.

thank you for your reply, yes my python code uses win32 and runs the needed functions all fine, I wanted to know if there is a way to have this added as a script in EA so the members of my team can also add it in there so there is no need to run it outside for convinience, my idea was to use javascript to access the python code, if there is nothing notable i can do (nothing thats not too much of a hassle) then i geuss I'll continue running it outside, no problem  :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13471
  • Karma: +571/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
should be possible using shell.run or something like that.

Here a reference to a solution using VBScript, but usually you can achieve the same thing using javascript

https://stackoverflow.com/questions/6732543/running-python-script-using-wshshell-run-in-vbs-does-not-generate-output-file

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
I had an add-in to run Python. Was fairly easy to code (basically stating from Geert's 10 minute tutorial).

q.