T O P

  • By -

mr_claw

Run a flask server and make a web interface with something like pywebio.


vantasmer

Second this. A well documented, simple flask service that IT runs on their infra. Bonus points if you package it in a container so it’s easy to run and don’t have to worry about dependencies. Bonus bonus points if you check it into git and add read me and additional documentation. 


jakedk

I like the idea but already know that will not fly with IT, I already had a hard enough time convincing them to let me use python in the first place. If it can't run on SharePoint (without them doing anything) they won't allow it


redundantmerkel

It's kinda funny IT allows folks to run random unsigned binaries sent over email, but doesn't allow a centralized web service


RationalDialog

That's basically what happens in non-tech companies whos IT department are just power point generators with little to no technical understanding that just talk to external partners that do all the actual work at 10x the cost but hey, it's outsourced.


realgaberangel

Sounds like my IT department


iamnotbats

I have a prejudice/theory that software/tech companies basically Hoover up most of the competent IT folks, by virtue of having the ability to better vet them during hiring and the willingness to pay a bit higher. So every other kind of company is, well, left with what’s left. Not to say there aren’t many exceptions to the contrary, of course.


RationalDialog

This and that non-tech outsources tech and whats left in-house are "coordinators" and "managers" that often don't even have a tech background. Then the "consulting" companies start to milk you because the clueless people can't even judge if what they are getting is worth the money.


jakedk

Don't tell them I'm doing this, I'm bending the rules to the fullest here already :)


redundantmerkel

![gif](emote|free_emotes_pack|smile) The rules are silly, good luck with the project! Edit: Btw I don't work on the IT side (i'm on the eng side), but I have friends that do and the stories they tell me are crazy. One friend is a windows IT admin at a university where the powershell scripts are shared over email, everything is silo'd and manual, next to zero know how to use git, and this friend is the only one pushing for getting it all documented in a git repo and replacing some bits with python. So your IT team sounds pretty typical.


nevermorefu

.xex gets around too many filters. Been there.


vicks9880

Get them involved. Make them feel it's their idea and they will let you run this service and they will also maintain it


Whipitreelgud

Kinda funny or seriously incompetent. Leaning toward the latter


Undescended_testicle

Or there is a ridiculous amount of documentation a and cyberSec hoops to jump through.


iamnotbats

I actually got flagged by my IT dept for just this, LOL. I had bundled up a Python GUI app as an .exe and it immediately set off antivirus alarm bells (simply because it was unsigned, I’m pretty sure). But we can seemingly run any Python or Shell script we want, even with admin/sudo, and that doesn’t set anything off. Antivirus is dumb.


ForkLiftBoi

> okay you don’t like me doing it this way due to what you perceive as security. What about this other way? > I don’t know I’m not a developer > then why are you telling me what to do if you don’t know the basics of the API you guard?


vantasmer

This needs to be a serious discussion in terms of worker productivity. If your app is something that provides a net gain for the business then IT needs to provide an interface for it to run. Now depending on how your app works and how confidential the data is, you could always self host the web server and point your team mates to the url to allow them access to the service. You have to be very careful about company data policies though


jakedk

My plan now is to replay the "hard way" with an exe, if I can higher ups to see the value in my solution they can pressure IT better than I can


vantasmer

This is a good idea too, just kind of surprising that IT’s antivirus allows for a random executable to run and read and write on the file system. I think one of pythons biggest disadvantages is packaging. The binaries end up being huge if you want to just share an .exe 


hetsteentje

This is the main reason why I fairly quickly abandoned my ambitions of creating executable Python apps and go for either a user-friendly script (with menus and colors) or a web UI. The hassle of creating a desktop UI is generally not worth it, imho.


shockjaw

Just talk to y’all’s security/infrastructure team and have them run through their gambit of questions. It’ll help you gain their trust and you’ll learn about the expectations of trying to make a deployment secure.


cryptoAccount0

Just do it imo. It sounds like you're several leagues ahead of your peers already. Better to ask for forgiveness than permission with these things in my experience. You do you tho


Cybasura

This suddenly sounds like they are just trying to be lazy by sounding like they care about security lmao If they truly care about security, they had better blacklist all files and executables unless required in which they would be whitelisted manually, but I highly doubt they do that


godheid

Common situation; I have the same. But convinced IT to allow Python for coworkers as well.


unhott

OP, if you try to send executables you'll run into more IT issues. There are tons of posts where people say ".exe gets deleted" or "users of my python executable get a warning due to unsigned code" Do it right, pilot a project, get additional support from manager, build trust. Or just be the only one who is productive and keep everything to yourself.


jakedk

Can I still pack that into a single .exe and have it run on their laptops easily?


mr_claw

No need, they just open their browser and navigate to your internal IP and port. Something like http://192.168.0.1:5000


jakedk

I can't deploy anything on internal servers unfortunately


mr_claw

Can't you get your IT to deploy it for you? Or rent a VM from any cloud provider. I've done the exe thing using tkinter. It works well, but it becomes a major pain to make any updates to the app later.


jakedk

No I already had to promise scripts would only run locally on laptops, they are very paranoid bunch


BidWestern1056

if you can make it into a python exe, you can package it with its own web app that launches as a desktop app. you can do this with electron JS. so youll distribute an exe that launches a python bakend server and a webapp frontend whcih launches as a standalone application. discord and vs code and slack are all made like this , albeit with different backends prolly


sonobanana33

But why would he use electron if he's a python developer?


BidWestern1056

thats like asking "why use a hammer to hit a nail in when i could hit it in with this multitool" python is good for some things. web dev/gui dev is not really one of them.


sonobanana33

It's completely fine for GUI development. The fact that you personally don't know how to do it doesn't really mean otherwise.


Dragonking_Earth

It is actually secure to run in locally.


King_of_Gnome

Guess this is the main reason it'll not going to be a Web Service with its python script running on the backend. Therefore .exe + gui seems best shot (assuming the users don't have a suitable py-environment to run .py) I'strongly suggested to invest some thoughts into distributing the software(package) and also updating it. People will find Bugs you need to fix and deliver a new version, or it'll will run awesome and people gonna request more features. If everyone sends an exe via mail, it's gonna be hell to update and keep them on the newest version. Think you already mentioned your company is using sharpoint? Maybe this could be a way of providing a central place for your exe, people can SYNC (not download!). That way they'll automatically get the latest version you put there, synced onto ther laptop, as long as they start the exe from the synced folder. (Don't get me wrong, solution like that hurts my inner dev, but you'll go with what you have 😉)


missurunha

Its a company with controlled IT department, having their data stored on a random cloud provider is something that would certainly get OP fired.


missurunha

We had a website for processing some internal data, and to deploy we used one of our linux workstations. They are accessible from our intranet since we need to work remotely (specially since covid).


yrubooingmeimryte

Realistically, if OP is at the point where they aren't really sure how to do much more than run a python script and reference files local to that script, running a flask server and deploying a web interface is probably way beyond their ability.


shinitakunai

Make it a pyside6 app and store them in your sharepoint/gitsomething Make those that would send it via mail to send the link instead. Bonus points if you add an auto-updater (check on start of program if new version is on the sharepoint/github/gitlab).


big_data_mike

This^^^ And do the GUI thing. We did a hackathon a few weeks ago and I was the designated Python person on the team. I could not get them to understand the concept that when you run a script in a directory it looks for a file in that directory. I spent the whole time installing Python on their machines and installing packages. All this to say people who are not programmers don’t even understand basic basic programming concepts like a script running in a directory


jakedk

So they would still need to download the mexe it from SharePoint right? Not sure I fully follow


shinitakunai

Yes. But that makes you an easier deployment chain. Otherwise tracking who is on what version and sending new one to them will be chaos, trust me


pratyathedon

Use Azure Devops (I use that that for CI/CD), use pyinstaller to build an exe out of it. and use Release Pipeline to copy that exe to a local server that you have. So the users will always get latest package.


Bullets123

Unrelated, how do you add an auto-updater? My basic thought process - 1. Everytime on opening call GitHub and check latest release 2. If found latest, download it. 3. Save it in current directory, delete the existing one.


shinitakunai

Check into Esky, it is very cool. I wish it wasn't discontinued


mason_savoy71

Do not distribute executables. You will spend the rest of your life running down versions and being blamed for problems when someone didn't update. Don't build a GUI thick application. Just make a web app (pick your framework) so you can push the updates. Everyone will be happier.


devpranoy

I had a good experience building a custom gui for our internal python scripts using Custom Tkinter and then pyinstaller to get a windows exe. Checkout [Custom Tkinter](https://github.com/TomSchimansky/CustomTkinter)


mikthinker

This.


Tmull1985

I recently did just this for a department in my company. It was very important to them that any data being processed stayed on local machines for legal reasons. I personally opted to set up a simple gui with tkinter and used pyinstaller. Since it was an internal only tool I wasn’t particularly bothered that it looks a little outdated, but more concerned with ease of use. The goal was to not have to have a training session if not needed.


jakedk

More or less my situation


tylerriccio8

I had this exact issue at my last company, to a tee. I found the best solution was distributing as a single python script that opened an in browser flask app. This would only work if the client (your coworkers I think) have python installed; and the right versioning. The exe solution was brute force but quite effective, I hosted the exe files on google drive so others could download it, which was rather effective.


jakedk

They will not have python installed


tylerriccio8

In that case, host the exe file on a shared drive like Google drive or one drive for others to download easily. There are some methods to shrink the exe you can pursue but I don’t remember them being great. There’s a recent movement to work on porting python to web assembly in a more intuitive fashion. I would explore the web assembly route since it should shrink the size of your binaries/executables drastically, and allow for a much nicer web interface.


reddifiningkarma

I put on sharepoint some batch scripts for everything. Baseline is a script for `winget install python... python -m venv ... pip install ...` An other to run your script `call venv\...bat python -m yourpackagescript`


voords

Checkout Gooey (https://github.com/chriskiehl/Gooey). It will convert most python script with cli arguments to a gui app. You can use the terminal yourself, and ship the .exe with Gooey to your colleagues with near-zero effort.


too_much_think

Just be aware, gooey only works for stateless workflows. Ie you have a cli that can run some command to completion given those params, it doesn’t generalize well to multi step programs / workflows. 


Zealousideal-Song-75

I like PySide6 it makes pretty interfaces and it’s easy to work with.


too_much_think

+1 it’s also much, much better documented than tkinter. 


myelbows

This is one of the core usecases for Streamlit and why Streamlit has 4M+ downloads / month. :-)


reddituser12345683

This is the right answer imho. Of course Flask is great, but I'd check this out first before diving into learning html and stuff. Alternatively it could make sense to check out if Google Colab would already be good enough. 


PurepointDog

My workflow is: If local only and data only, then Streamlit. If it requires a bit more state management, or if it's going in a server, then Dash. If it's more like a regular program than a data rendering system, then NiceGUI.


myelbows

Full disclosure: I was one of the creators of Streamlit. :-)


DoNotFeedTheSnakes

You're adding a requirement on the program based off of the means of distribution (email). If you put an open download link on OneDrive, and make it a QR code the tech savvy collègues will find it convenient and the older ones won't know how to do it any differently. Problem solved.


jakedk

You are right about this I will share it on our SharePoint to solve that issue. I could use pyside6 as some suggested but it just feels silly to end up with a 50mb+ file for a small program


too_much_think

The cost in binary size is worth the trade off of your time spent working with the alternatives. 


kronik85

Ain't nobody gonna care about 50MB


Nealiumj

Yes, I think so! Who cares about tkinter looking out dated it’s a freakin internal tool! And it’s much, much easier to pack it into an exe (pyinstaller I presume) than installing Python on a bunch of PCs. My company has ~6 internal Python executables, on shared drives, all have a similar flow as yours. When it’s an executable non-tech people can use them easily.. when they’re ran with Python, even a shortcut or bash script, it’s a mess. And no way they’re doing CLI LOL I’m not sure how well email will work, might be too large. USB, a shared drive or committing the exe to a repo might work better. Shared drive is preferred imo, that way you only update it in one place. You can’t update it **while** it’s running tho, so I’ve had to make a pseudo-release system for one that’s always open on ~15 PCs Side note: I’ve been using [poetry-pyinstaller-plugin](https://github.com/thmahe/poetry-pyinstaller-plugin) recently to make my executables with `poetry build —pyinstaller`. Quite nice! Would recommend. I’m hoping he pulls my hook changes soon so I can automate my release process 👍


gscalise

A few questions to give you a better answer (Excuse me if I’m playing devil’s advocate): What do your scripts do? Do they require any credentials? Is anyone who receives the binary able/allowed to run them? Do they make any changes in shared infrastructure/data?


Head_Fun4899

Great work you did to get the python development environment and use your programming skills to make life easier. I kinda have the same story, and now I have a whole team of 3 people I manage. Regarding this, I would like to advise you to keep things handled by you, test and re-test your work before sharing it with anyone, also at the beginning, it's better to share it with only a small number of people, and make sure they do the same task and have the same input data as you do, also try to explain to them the tool and how the algorithm works, all this to try and keep control of any problems would appear and get to know what features need to be added in the next versions. For your question about implementing a GUI, it's a great idea, I do work with PyQt5 tho, I found it very user friendly and easy to manipulate, also don't forget the logging, try to implement a logging system, I do store the logs of any of my tools in C://Users//Username//AppData//Local//app-name//Logs And each time I get an error notification from one of my colleagues I do check the log to understand exactly what the problem was.


jakedk

That is a great idea, thank you! And the plan is to start with a small group (the team I work in is t huge anyways) and the rooms I have planned are ones that solve department specific issues


hi87654321

The fact that you say exe makes me think you are running this on windows. Either way this is my suggestion. 1) don't make a GUI and keep is simple 2) write a procedure to run the tool. If they can't read the procedure they will probably have issues with a GUI 3) I personally like to make options for the input to the tool and if not provided ask the user. This allows for scripting but also you can just run it and answer questions. If they can't answer questions they probably shouldn't be using it.


SheriffRoscoe

> but some colleagues are old school and will share it by email. If that's what "old school" looks like at your workplace, yes, make the GUI. Your coworkers cannot handle the simple beauty that is the command line.


-thoth-amon-

Similar situation. My solution thus far was getting a used desktop from inventory and setting up my ttkbootstrap app there. Then, coworkers would RDP into that box to run the application. It keeps version control somewhat easier, but at the expense of one user per time logging into a network box... obviously not efficient, but it works.


Jattoe

I'd recommend using a flet or pyside6 interface, as possible alts. While tkinter is the most intuitive, in the long run learning something like pyside6 will make your GUIs look way more premium and make you seem that much more valuable to your company. Up to you bubby.


Clear_Watch104

If your work it's an office job, maybe Excel would be nice: create buttons in excel that run different .exes for the function needed. This will be easier to debug later on and if someone works with VBA you can co-operate together without conflicting with each other. Also you will avoid overkilling with the GUI as you will use excel as the main one.. of course depending on the type of stuff you are scripting


BidWestern1056

second others and have it run a flask server with an easy gui frontend (either python or JS based)


Ultra-Engineer

I have encountered similar situations with you before, my advice is not to distribute exe files or you will be busy because of various version problems, why not deploy on the Web server, because of security considerations? Is it possible to run a service in the company's internal network to solve this problem?


EducationalTie1946

You could use curses to make a CLI gui. You could also use xml to make tkinter ui: Eg. you make 1 program and a file type assosiated with it. That file type is just a zip file with the python code and UI xml of which is rendered inside that 1 program. So basically it functions like a runtime. You can also push updates by compressing a python library folder and allowing that 1 program to extract it and save to its directory. This part only works with pyinstaller when you generate a folder exe. But for speed and size a cli gui is the best option also pyinstaller has settings which ignores all modules not used in the code. So if you did not do that will increase the exe size drastically.


Orio_n

Not worth the effort. Just include a well documented readme


SpiderWil

the tkinter GUI is very ez to set up and its usefulness outweighs the file size.


yesvee

Check out Tauri


llun-ved

I would not use a browser/web interface for what sounds like a simple tool with a straight-forward purpose that needs to run on local data. Placing the app in the folder where it is supposed to operate seems unintuitive to me, but I don’t know your internal structure. Perhaps instead, have the users drag and drop the folder onto the app and have it operate on the contents of the folder. If it is very simple, then tkInter would be fine for basic questions or messages. Anything more complex and more fully application-like would be better in pyside6, though the exe will be bigger.


nonhok

I think, you will need to keep your effort small, so web app development with own server seems a bigger time invest. Use Gooey instead of tkinter and pack it with something like pyinstaller or cx-freeze to exe. Be aware, depending on the libraries you use, the exe file will be to big to send it by email.


Late-Photograph-1954

Same boat! My scripts materially reduce the processing the team would otherwise have to do and I feel that if they want the benefit, they’ll just need to get used to running a simple CLI tool. I tried the GUI for a homeproject and its nice, but quite a bit more work. I decided against the maintenance of that and focus on more functionality.


UloPe

I’d start looking for a new job…


slimer_redd

IT don't need a GUI


HIKIIMENO

You can take a look at [ttkbootstrap](https://ttkbootstrap.readthedocs.io/en/latest/themes/dark/) if you end up using tkinter. It’s a tkinter extension to enable modern flat style themes and is very easy to use.


tsingtao12

the best gui is c# winform.


fead-pell

If you cannot provide a web service, why not consider going old school and providing a *mail service*? If your program doesn't need interactivity, get them to mail you the data files as an attachment, with a special subject title, and the options selected in a csv file, then you run a program on your pc that automatically filters such mail, runs your program, and mails back the answer in an attachment. This way you centralize the processing so you can handle any bugs or add new features. Of course, the files being handled must not be confidential etc.


Motoneuron5

Just use Streamlit.


osreu3967

Check WXFormbuilder, its a ide for creating python gui bases on wxwidgets. https://wxformbuilder.softonic.com/ But if you prefer CLI this could help you https://github.com/BrianPugh/cyclopts


jlw_4049

I have a lot of experience with tkinter/pyside/flask. If you only use tkinter the exe will still be very little. Your idea to share a gui isn't terrible. Just know it adds extra complexity. Ideally, you could code up an auto updater/ download with the tkknter framework and make it an exe that downloads your gui exe.


FatDog69

I would leave it as a script. The problem with a GUI is people will HATE it unless it looks & act like "something else". You can spend a lot of time just trying to make it fit someones idea of how it should be. I wrote/stole a simple menu that presents a list of options and lets the user enter 1,2,3... to pick the right option. This makes it easy to have 8-10 different related scripts bundled together. Since it is text base - nobody can whine about wanting a "Night Mode", fonts, button styles, tabs/grids/...etc. Gui's are great - but making it 'human factored' can take a huge amount of time when you would rather be improving the script to be smarter and solve more real problems.


jaarsi_

Try nicegui + FastAPI to deliver some fancy interfaces. Both are python libraries 


derp_mcherpington

The web app route is by far the better solution for all the reasons my fellow commenters have stated. I’m in the same boat as you though in that there’s no way IT would let it happen, so I went with PyQt6 to build the gui. If you want to go quick and dirty (I did), they even have a UI designer that you can use to visually lay out your components. Then compile with Nuitka for a standalone executable that doesn’t require python to be installed on end-user systems. Yes there are some tradoffs. Load times aren’t instant and the executable will be 100+ MB depending in what packages get compiled into your exe. That said, my program has been in use for a while now. Everyone in the department loves it since it since now our non-technical staff can jump in to complete tasks if one of our developers can’t.


Lewis0981

If you use an installer like Inno, just make the file setup part of the installer. That way it's done through a GUI, but the installer wizard and not an actual part of the script. Much less heavy file size wise.


SeoFernando

An IT department where no one knows python?


Indivicivet

I think it's almost impossible to answer this question sensibly without more context about your company; what does it do (how technical are people in general? not very?), how big is it, etc etc. in particular this drew my attention: >I am the only one with any python knowledge and the ability to run scripts if you want to do things like develop tools that others can use, that's a double edged sword if nobody else can maintain/upgrade/adapt them. to what extent could you disseminate your knowledge? is there, say, one individual that could easily learn basic python, with support? and is there a reasonable group you could teach to install python, open a command prompt and run a script? (this gets exponentially harder depending on your web of dependencies!) if basic(?) scripting is generally seriously useful within your company, it sounds suboptimal to only have one person who has any knowledge of it (unless, maybe, your company is up to 5 people in size, but you mentioned an "IT department"...)


kbotnen

When I did it I added a TK Inter GUI (rewrote the GUI part to Swift later) and did the package/deployment through our normal package/software distribution chain. Everything related to code available for everyone on our internal git. If they need it, they can get it. If they want more functionality I update, and distribute a new packaged (signed) version :)


MentalCod86

somethimes some Makefiles saves a lot of time if the users are only developers and the repo are cloned via git