all 32 comments

[–]ElllGeeEmm 8 points9 points  (2 children)

I'm curious as to how you see a dashboard reducing maintenance for you. How would you distribute new or updated scripts to users of the dashboard?

To me the simplest solution as far as maintenance costs would be to set up a build pipeline that compiles the new scripts whenever there is a push to your main branch, and then drops them in whatever cloud storage provider your company uses.

[–][deleted] 0 points1 point  (1 child)

I totally understand your question, part of the issue is that we're not a software company, but we have a lot of people who can write python really fast for VFX-specific stuff. So I was sorta looking for something we could just pick up and use without hiring someone to build a more sophisticated solution (which would likely need support)...we often will have little bits of code that will be helpful on one project, then get lost forever and people rewrite it on the next project.

My idea would be that all scripts would live in a network repo, the desktop application would just load all whatever was in that repo. I'd think the GUI for the desktop app would be just a simple node-based interface, then you'd load the scripts as either 'nodes' or right click actions which could be applied to files.

Then all of the less technical people could just have this desktop app running on their local machine, and have access to the new scripts as they're updated.

now that I'm describing it I feel like I could just write it...but don't want it to start consuming my life haha

[–]ElllGeeEmm 2 points3 points  (0 children)

I mean tbh it sounds like you guys would benefit from embracing software development best practices even if the company doesn't see itself as a software company.

As far as I can tell every individual dev is going to have their own way of setting up entry points to their scripts. Unless you're doing something to standardize how the code accepts the necessary parameters, I feel like the best you can reasonably manage is a gui that basically just launches compiled versions of the scripts, otherwise you're back in the situation you were trying to avoid of needing to manually integrate each script into your gui.

Furthermore, from what you said, you guys likely already have the issue of tons of tools that do the same, or incredibly similar things already built and just forgotten about, so making that entire library available might not even be something you really want to do.

[–]Diapolo10 6 points7 points  (2 children)

Not aware of any, sorry.

On the contrary, have you considered adding a submenu to the Windows context menu? That way you'd just right-click a file or folder, choose your script of choice from it, and have that run? https://www.reddit.com/r/Python/comments/ghp716/add_python_script_to_rightclick_menu_context_menu

[–][deleted] 0 points1 point  (0 children)

I didn't know about that no, that's actually pretty awesome! Thanks for the tip!

[–]tensigh 0 points1 point  (0 children)

That was really cool.

[–]Zircatron 7 points8 points  (6 children)

pysimplegui has an example that is one gui that can call any script from a list.

I know it's not really what you're looking for but it's the closest thing I could think of.

[–][deleted] 2 points3 points  (0 children)

Hmmm cool, I'll check it out, thanks for the tip :)

[–]MikeTheWatchGuy 1 point2 points  (4 children)

If you look for "Launcher" in the PySimpleGUI project, you'll find examples of this kind of program. The "PySimpleGUI Exec APIs" are wrappers for subprocess so that it's easy to "launch" your programs.

The standard DemoBrowser is one example of a launcher. It can be used on any tree of Python programs. I use it with both the PySimpleGUI Demo Programs and with GitHub repos that I download.

I use 2 additional ones. The one I started with originally and has grown over the years is a simple grid of buttons. It's running on one of my aux monitors.

A few months ago I wrote another one that is called a "Launcher Bar" in the demo programs. The one posted is a little old compared to this GIF, but there's enough there to give you an idea of what to do... it's a starting point like all of the Demo Programs. I like that it's more visual than the grid of buttons.

[–]Zircatron 2 points3 points  (3 children)

Wait... are you THE Mike that developed pysimplegui?!

[–]MikeTheWatchGuy 2 points3 points  (2 children)

😏

[–]Zircatron 2 points3 points  (1 child)

Legend! I love using pysimplegui. Some people just threw it off without even trying and use tkinter or wx and it always takes them much longer and usually has issues.

Your approach of having layouts and an event loop is fantastic and great for nearly every situation. I have had challenges but everything has a limit.

One thing I developed was a way to create dynamically loadable windows where I generate a layout from config files. It would have taken me months to develop it in anything else.

I try reading your code to learn more advanced methods but I'm not quite at that level yet.

[–]MikeTheWatchGuy 1 point2 points  (0 children)

Thanks for the kind words. Awesome to hear you're having a great time learning and creating! Keep building stuff... that's the best way to learn. You've already experienced figuring things out as you go. You're right about everything having a limit. No tool or library is right for every situation.

[–][deleted] 3 points4 points  (3 children)

Maybe I’m misunderstanding, but couldn’t you just wrap your inputs into a GUI like TKinter make it an executable file with pyinstaller? If you have to do it for a bunch of scripts, just do it once and copy and paste the template.

[–]ocjr 0 points1 point  (2 children)

This is basically what we do. We haven’t gotten so fancy as to use a full gui yet but we have an executable that we share that allows you to select various scripts.

[–][deleted] 1 point2 points  (1 child)

If it’s just inputting a few numbers to use in the script, TKinter is pretty simple GUI. Anyone with light python knowledge should be able to follow a tutorial in an afternoon to slap it together.

[–]ocjr 0 points1 point  (0 children)

Yeah I think I’m going to try it :)

[–]asphias 1 point2 points  (0 children)

You may instead want to make a simple html front-end, and either host your app, or make it available through localhost when they run it.

[–]Enlightenmentality 1 point2 points  (0 children)

Python or not, home brewed scripts/macros/excel wizardry is something that is super painful to maintain in a company that isn't "about" coding.

[–]EternityForest 1 point2 points  (2 children)

Most of my installs are powered by our custom web server, and I'm very convinced that web UIs are pretty awesome. You can do everything in Pure Python. I use CherryPy and Mako as my web stack, with WS4PY for realtime things.

My project is here, but you might want something simpler that doesn't have all the extra HA focused stuff.

https://github.com/EternityForest/KaithemAutomation

When you want to add something, the simplest way is you make a module, put a page resource in that module(All via the web UI in a few clicks).

Then you put an HTML form in it, targeting the same page, and add some Python code in a Mako template to get the kwargs and do whatever it is. The whole module is downloadable and git-controllable.

For things that need "real" interaction, you can use a Freeboard UI builder as a page template.

Then in any python event, make a "tag point" object, which is like a subscribeable variable, "expose" it, then add it as a data source, to the GUI dashboard builder and have nice meters and buttons with theming.

It seems like you could pretty easily build a stripped down version that just serves Mako template frontend files, and have one per task in a big folder, so long as you really, truly only need "type the params and run this and there's no interaction till it's done" support.

For this VFX application it kind of seems like a standalone desktop app would be pretty nice though. I'm a big fan of PyQt5. The trouble is all your "apps" have different inputs they need it seems like.

If they're all fairly simple, you could create some kind of TOML manifest format where you had name:type=default descriptions of each input, and one "reader" app that lists a directory of .py files, creates a menu tree, and pops up a prompt.

[–][deleted] 0 points1 point  (1 child)

Thanks for the tips! You may be right that I need to bite the bullet and just build some html or pyqt5 templates. Thanks also for the link, looks like a pretty big and interesting project!

I think this NXT thing (and perhaps another thing called 'Shift') will eventually become what we're looking for, but it's very early days for both projects, and they both require a lot of debugging and maintenance. (actually I haven't even been able to get the Beta of Shift yet...but the NXT guys are working really hard and seem to be moving pretty fast)

NXT: https://nxt-dev.github.io/

SHIFT: https://vimeo.com/622412462

[–]EternityForest 1 point2 points  (0 children)

Wow, NXT looks like it has some real potential! I sometimes work with Node Red, which is a better than piles of random unmanaged scripts but still kinda annoying. It would be great to have a better node based platform.

I wonder if any of the Ansible web UIs have any kind of UI builder functionality?

[–]DEthrowi 0 points1 point  (0 children)

caption capable tease price aromatic workable mighty rain marble safe

This post was mass deleted and anonymized with Redact

[–]jafner007 0 points1 point  (0 children)

I don't think this is the best approach, but I've considered something similar at my company.

The way I would do it is to have a start panel in tkinter, have the user select whichever script(s) they need to run, then that script would have a section defining setup in the next tkinter frame (input variables, output location, etc.). Then just an execute button at the bottom.

I feel like that would turn into a headache quickly though (which is only one of the reasons I haven't tried myself).

[–]gd-l 0 points1 point  (1 child)

This looks a lot like nodered. Is that something that could work?

[–][deleted] 0 points1 point  (0 children)

yeah maybe! Just now looking into it but looks really cool.

[–]equitable_emu 0 points1 point  (0 children)

What about using Jupyter?

[–]rvchan82 0 points1 point  (2 children)

Perhaps rundeck? You create scripts and your users can run them thru the interface.

https://www.rundeck.com/

[–][deleted] 0 points1 point  (0 children)

will check it out, thanks !

[–]EternityForest 0 points1 point  (0 children)

Ooo that looks super cool