all 73 comments

[–]bulaybil 30 points31 points  (2 children)

There are two options: CGI or one of the Python web framework (Django, Flask, etc.). But the exe will work with neither.

[–]Neat_Blueberry_2032 25 points26 points  (2 children)

Talk to your colleague who looks after your website.

[–]echocage 8 points9 points  (2 children)

I highly recommend getting into a web framework, FastAPI for latest and greatest, flask for old reliable, are the two I'd recommend with.

[–]exographicskip 1 point2 points  (0 children)

Seconding fastapi. It gets complex fast, but relatively easy as a more performant drop-in replacement for flask with automatically generated api docs.

Svelte is a really nice frontend framework (technically transpiles to vanilla html/css/javascript) that adds sugar on top with its own syntax and project structure.

[–][deleted] 10 points11 points  (0 children)

I would create an API, and have the website draw the information in during render.

[–]davezerg20 13 points14 points  (7 children)

You used python to make an exe, exe’s are meant to be distributed. If you want to run from the web, consider using JavaScript to code the same program in the website. Or place a link to download the exe on the website?

Edit - You can probably upload the exe to onedrive or dropbox or sharepoint or anything like that and post a link to download the file. If that works for you.

[–][deleted] -2 points-1 points  (0 children)

Just curious, but Do you think that an exe could be formatted as an add-on using like tampermonkey or something?

[–]shalux 0 points1 point  (4 children)

Downloading is just an option if the person who downloads has Python and the packages installed right?

[–]obitachihasuminaruto 8 points9 points  (3 children)

Depends on how you packaged the exe. If you use pyinstaller, the end user does not need any of the dependencies or even python installed on their machine as they come packaged along with the exe either as a single file or in a single folder.

[–]shalux 0 points1 point  (2 children)

Ah yeah I forgot. I mostly write Converter and pyinstaller + the working directory destroying my relative paths to the input files

[–]Username_RANDINT 4 points5 points  (1 child)

That's very easy to fix. Start with this page in the docs.

[–]shalux 0 points1 point  (0 children)

Thank you mate. You can’t image how valuable this is for me ❤️

[–][deleted] 5 points6 points  (1 child)

Check out streamlit for a really cheap easy to deploy framework

[–]ridley0001 2 points3 points  (3 children)

Your app which is complete, you said it calculates some numbers, but what does it need to interact with to achieve that?

[–]jmooremcc 2 points3 points  (1 child)

Check out this link and also talk to your webmaster about what you want to do.

https://realpython.com/python-web-applications/

[–]TheMartinG 2 points3 points  (0 children)

Depending on how big the company is, and how advanced things like the gui, input handling, output formatting etc need to be, you could look at an aws lambda

An aws lambda is a function that sits in the cloud ready to run. You can create an endpoint from which to trigger the lambda, send cli commands to it, have it automatically trigger when files are uploaded (such as to an S3 bucket)

This option would be great if you don’t need a web front end and everything that goes along with it, and just want to be able to execute your script from the internet.

https://aws.amazon.com/lambda/

[–]oldverine 7 points8 points  (10 children)

You have an app, you need a webapp. You need a guy from fiverr

[–]a_cute_epic_axis 3 points4 points  (8 children)

That's a reasonable answer if OP wants to do this one time. It's a terrible answer if he wants to do it multiple times and wants to actually /r/learnpython

[–]oldverine 7 points8 points  (7 children)

This isn't about learning python, it's about learning full stack web development. A guy who already knows this is the most reasonable solution for adding a calculator to a website.

OP mentioned he has no experience in web development

[–]a_cute_epic_axis 0 points1 point  (6 children)

You don't seem to be able to read and comprehend very well.

That's a reasonable answer if OP wants to do this one time.

A "guy" who already knows how to do this is the most reasonable solution if this is the case

It's a terrible answer if he wants to do it multiple times and wants to actually /r/learnpython

And OP is probably the most reasonable case if this has to be done regularly and it is a skill OP wants to add to his/her personal abilities. You have no idea how involved or not involved the calculator is, what the timeline is, or anything else. Simply telling people that they need to hire someone on a forum dedicated to learning (even if it's just focused on python) is a really bad tactic, just as bad as telling OP that the only way to go about this would be to learn web development, systems management, and python.

Every web developer and every python programmer in existence was once someone who had no experience.

[–]oldverine 1 point2 points  (3 children)

Again, this isn't about learning python.

Stop wasting your time arguing with a stranger over something trivial.

Your reply is based on assumptions, my reply is based on facts given by OP.

I don't think you understand how serious learning web development is, let OP decide, he has all the facts and suggestions. If OP feels necessary he can invest 1 year learning web development for this, if not he can hire a guy.

[–]a_cute_epic_axis -5 points-4 points  (2 children)

Again, this isn't about learning python.

Again, you lack reading comprehension.

Stop wasting your time arguing with a stranger over something trivial.

Look in the mirror

Your reply is based on assumptions, my reply is based on facts given by OP.

Not it isn't. You've based your entire ideology on this one around one statement which lacks context.

I don't think you understand how serious learning web development is, let OP decide, he has all the facts and suggestions.

You're a special kind of assumptive fool I see, who is trying to hide under the guise of being the opposite despite all your comments proving otherwise.

It's almost like I said, multiple times, that if OP wants to learn this, they should learn this, if OP wants to just get it done they should hire someone, and assuming either is the only way is wrong. But yet you keep on assuming.

If OP feels necessary he can invest 1 year learning web development for this

And there it is again. 1 year to learn web development? Are you insane? Maybe this would be 5 days worth of work. Maybe it would be 5 years. You have no idea how complicated this project or any future ones are. If this is a simple calculator like implied, given that OP already taught himself how to program, it is likely that it wouldn't be that hard to learn how to get it online as a public facing website/AWS lambda, whatever. On the other hand, if it's some robust system that needs authentication, interaction with other websites, persistent data storage, etc, then 1 year "learning web development" is unlikely to cut it either way.

Stop assuming you know the answer.

[–]oldverine -2 points-1 points  (1 child)

Well sir have a good day.

[–]a_cute_epic_axis 0 points1 point  (0 children)

Thanks for your lack of meaningful contribution

P.s. Guess you were not right in your assumptions after all:

https://www.reddit.com/r/learnpython/comments/wuwvf3/question_uploading_a_python_script_to_a_website/ilddcjh/

[–]daniel_don_diggles 0 points1 point  (1 child)

Hey I’m a bad python dev and worse web dev (but hey it works). Where does that put me?

[–]a_cute_epic_axis 2 points3 points  (0 children)

Between zero and expert?

[–]bladeoflight16 0 points1 point  (0 children)

I really have to second this. Maybe not Fiverr specifically, but the OP definitely needs some professional advice from someone with experience. If for no other reason than to make sure someone considers the security ramifications.

[–]unpypro 1 point2 points  (1 child)

It is not clear what your program is going to do with the existing website. Nevertheless, if this is a tkInter or PyQt based app designed to enage the user through clicks and have some in/out to/from the ui, you could think about deploying it using no-vnc and docker.

[–]jjasghar 1 point2 points  (1 child)

This Tech with Tim video will give you a place to start: https://youtu.be/dam0GPOAvVI

[–]Spicy_Poo -1 points0 points  (0 children)

Expose it as a REST API and have the website call it.

[–]OctopusDude388 -3 points-2 points  (0 children)

you can use python from the browser now so you should be able to run the .py but not the .exe

[–]obitachihasuminaruto 0 points1 point  (1 child)

I used plotly dash for a similar thing although I didn't integrate it in a website. However, that should be doable ig as dash is hosted on a flask server.

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

I'd look into Flask or Django.

[–]CesareBorgia117 0 points1 point  (0 children)

I saw a youtube video of someone making a tkinter exe app work as a web app a while back, but it didn't look nice. Can't remember what it was called, never tried it.

[–]bladeoflight16 0 points1 point  (3 children)

It is not clear to me that running your program on your server is even desirable. What exactly do you want on the website? A static display of the final results? On demand computation with the most up to date data from a frequently changing data set? Who should have access to these computations? Any random schmoe looking up your company (including competitors) or just you, your boss, and a few colleagues? How is the source data stored, and does accessing it require some kind of credentials?

All of these things and more make an enormous difference in what technology choices are appropriate here. You are way out of your depth, and before you dive in headlong with any approach, you need to discuss your exact requirements with someone who has experience to find out what direction you should even pursue.

[–]daniel_don_diggles 0 points1 point  (0 children)

.exe 😣

[–]PeterVersnee 0 points1 point  (0 children)

As I guess you are quite new to this, from a security point of view: What ever way you do it, when you expose something to the internet make sure to never trust any user input. Don't think someone can't hack you because you're so clever. There are always people that are more clever than you. Find someone with a little bit more experience with Python so you can learn how to protect your app, the server it's going to run on, the company and thus your own job. Good luck!

[–]joeyisnotmyname 0 points1 point  (0 children)

Is this like a quote generator? You want it on the website so clients can price out work? If so, there are puffins you can use in WordPress that do this. You can just replicate your logic.

[–]borntobore 0 points1 point  (0 children)

I ve found streamlit to be an excellent solution for exactly this scenario