conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Solid work, but how do I trigger a custom python script (w/ imports?)

Open OluAgunloye opened this issue 5 years ago • 7 comments

Thanks for this Daniel, will build some really cool stuff on it! In order to do that though, see subject: can we call our own custom scripts that may need their own Python package imports?

OluAgunloye avatar Mar 21 '20 22:03 OluAgunloye

@danielgerlag Thought I'd bump this, for a future reply. If this is not on the roadmap, what obstacles stop this from being a reality? Would like work on a branch that does this as a PR.

OluAgunloye avatar Sep 23 '20 23:09 OluAgunloye

You can currently import any system package. Are you looking to import 3rd party modules?

danielgerlag avatar Sep 24 '20 00:09 danielgerlag

You can currently import any system package. Are you looking to import 3rd party modules?

@danielgerlag Yes. Also, where can I find some documentation on how to do this, or how to import the system packages?

OluAgunloye avatar Sep 24 '20 01:09 OluAgunloye

I tried it like this

import datetime
result = str(datetime.datetime.now())

danielgerlag avatar Sep 24 '20 01:09 danielgerlag

I tried it like this

import datetime
result = str(datetime.datetime.now())

@danielgerlag You did this as a custom script then? You created your own step? Or how else would this be done?

OluAgunloye avatar Sep 24 '20 01:09 OluAgunloye

@danielgerlag Hey Daniel,

Still stuck on this part actually. The dateTime/Timespan still giving lots of issues.

OluAgunloye avatar Oct 05 '20 17:10 OluAgunloye

I tried it like this

import datetime
result = str(datetime.datetime.now())

@danielgerlag Hey Daniel, when you have time could use some more elaboration on this. Tried just using the built in System.Timespan() method to set an interval in any of your workflow steps that accepted an interval. The IronPython interpretation got in the way. I genuinely wish to know how you suggest we set the interval fields in these workflows, as accessing a datetime object through JSON is not flying!

OluAgunloye avatar Oct 26 '20 03:10 OluAgunloye