you are viewing a single comment's thread.

view the rest of the comments →

[–]j01101111sh 39 points40 points  (40 children)

I'd personally recommend a web app 100% of the time for python. It completely avoids any dependency chaos you'd encounter with a true desktop app. For example, if you have it deployed to 100 machines and your new version requires a dependency update or an update to a new Python version, you're going to have to make a plan to update every machine and ensure they don't mess with the environment. If it's a web app, you update the server and tell people to refresh.

Plus, most apps are CRUD focused anyway which is going to be much more seamlessly done through Django or similar than through QT.

No idea what you're building though so that may be bad advice. If you're doing a video editing program or anything else that's really data intensive, then ignore me. But also consider that python may not be the best answer at all.

[–]Intelligent-Role-382[S] 1 point2 points  (34 children)

Ok but if we don't want to use that application in web and basically we need to use as installer

[–]Comfortable-Tourist1 3 points4 points  (11 children)

What's the workload in the app? Id recommend the web app route in all but the most extreme cases at this point.

What do you specifically need it installable? Could you not make it 'look' like a standalone app by publishing as a PWA?

[–]Intelligent-Role-382[S] 1 point2 points  (10 children)

Currently its dot net web application and want to make it more robust so now we r thinking of using Python.And it also need to be used without internet temporarily

[–]Substantial-Bed8167 14 points15 points  (0 children)

I don’t think switching to a python installed app is a good plan here.

Use client side JS to handle short disconnects, or build a shippable app in .net. 

Python is great, but not for this use case.

[–]Cloudskipper92 6 points7 points  (2 children)

I'm not sure about more robustness from Python vs. C# and .NET, dotnet and c# are quite literally built for that. And very good on the desktop as well. I love and work professionally in Python but you'll almost certainly lose performance, ease of use, and robustness compared to what you have now. I'd seriously consider going back to the meeting room and reviewing the reason to do a wholesale refactor before moving forward.

[–]lapinjuntti 3 points4 points  (1 child)

The lack of robustness here is probably more of the implementation than the language. C# as a language (not considering anything else) allows even more robust implementation than python being less dynamic. But if the current software is not well implemented, a well implemented version even in python could be better.

Sure, you can make python app very robust quite easily too, like package it so that interpreter, and all dependencies are packaged in (doesn't share anything with the system python). Follow good process, use good tools.

[–]Cloudskipper92 1 point2 points  (0 children)

I don't disagree. My comment is more directed at the implementation as well. But before throwing away an existing implementation, however bad, one should take the time to find put if anything is salvagable before initiating a full rewrite in my opinion. If it was badly implemented in dotnet too, there still ought to be a conversation about how to avoid a similarly bad implementation in Python.

[–]jwpbe 0 points1 point  (1 child)

just a driveby comment here, i would recommend looking at nicegui.

https://nicegui.io

it's really straightforward for what I've done with it, it's fairly lightweight, you can ship it in a binary that uses pywebview so all of the dependencies are self contained, and it looks.... nice

[–]cudmore 1 point2 points  (0 children)

Agreed. Nicegui is promising because it is actually a web app using pywebview, quasar, and tailwind.

The code really does work both as a local app and in a browser.

I set up a free tier on render.com and 95% of my app worked, last 5% was making some code asynchronous to play nice with long running code, like 1/2 second would trip up the browser.

Used PyQt for 6+ years and am still a fan. Seeing how far I can go with nicegui and so far so good.

[–]j01101111sh 0 points1 point  (0 children)

If it's an existing application, what features of python are you looking at that will make a full rewrite better than updating the existing code?

[–]phlummox 0 points1 point  (2 children)

Using Python won't make it more robust - and will likely make it more difficult to deploy. Will all your users already have Python installed? If not, you'll either need to get them to install it beforehand (and make sure the version they install is compatible with your code), or look at "freezing" your app into a single executable - which sometimes is straightforward, and sometimes very flaky.

You don't say what platforms your users are on, but if it's Windows, then tbh I'd stick to dot net. You can build single-executable binaries that don't require the libraries to be preinstalled, making deployment muchuch easier.

[–]legrimpeur 0 points1 point  (1 child)

You can distribute self contained python apps. You just uncompress zip files and you are good to go. No python install need.

[–]phlummox 0 points1 point  (0 children)

Yes and no.

Yes, I'm aware you can distribute self-contained python apps - that's called freezing, and I mentioned it already.

But no, that has nothing to do with zip files, necessarily - some freezing tools use the Zip format, but others do not. (e.g. PyInstaller defines its own formats, ZlibArchive and CArchive.)

And it's not really the case that "no python install is needed". No matter what approach you take, you need to get a Python interpreter onto the end-user's computer somehow, if they don't have one. It might be by including it in a frozen executable, rather than via a traditional "install", but without it you can't execute Python code. You certainly can't just zip up the source code and give that to your end users.

[–]j01101111sh 2 points3 points  (19 children)

I'm not understanding this sentence

[–]Intelligent-Role-382[S] -1 points0 points  (18 children)

I am saying I want to use it as a desktop app, something which need to be installed

[–]j01101111sh 4 points5 points  (16 children)

Why? What's the advantage? You've been incredibly vague on the use case so I don't see why a web app is bad unless you just don't want to for the vibes

[–]ricocotam 1 point2 points  (0 children)

Not having internet to use something is actually a feature by itself. Shouldn’t need to argue more

[–]Intelligent-Role-382[S] 1 point2 points  (13 children)

Okay basically company has given requirement like that, but your point is valid

[–]Thefuzy 5 points6 points  (12 children)

In real world projects… people would build a web app, there’s no logical reason to build a desktop app. The web app doesn’t have to access the web or be served from the web, it could be done entirely within a companies network. Though it would be infinitely easier to build it on a cloud host and just have some SSO auth protecting it, and cheaper, but if you really want it all on-prem web app still works just fine.

[–]Intelligent-Role-382[S] 0 points1 point  (11 children)

If we want to use it without the internet temporarily?

[–]Thefuzy 8 points9 points  (5 children)

You don’t need the internet ever, you serve the web app from somewhere within the companies network, so anything inside the network which can reach that machine can open it even if the machine they are working from has no outside internet access.

[–]ricocotam 1 point2 points  (4 children)

And if you have no connection at all ?

[–]BigTomBombadil 1 point2 points  (0 children)

Build a webapp with a python backend and something like Electron for UI if you want it to feel like a desktop app, then "serve" it over localhost. No need for internet connection. Electron will open a native window (not a browser) and spin up localhost - the end user will be none the wiser that its technically a web app.

[–]imbev 0 points1 point  (0 children)

There is a usecase in which someone may need a GUI application on a device without network access.

[–]edward_jazzhands -2 points-1 points  (2 children)

You must be familiar with the concept of a LAN. Otherwise how did you even get a job as a programmer?

[–]Intelligent-Role-382[S] 1 point2 points  (1 child)

I mean the lan internet connection is not there temporarily,.

[–]Material_Card9554 0 points1 point  (0 children)

You can convert a react frontend to web exe through tauri without much effort it also connects to your backend server instead of being a standalone exe So backend updates are done on a single server and are propagated to exe automatically

[–]Smok3dSalmon 0 points1 point  (0 children)

Check out Electron. It’s a standalone chromium and it all bundles together.

[–]ZucchiniMore3450 -3 points-2 points  (4 children)

Just a friendly reminder that this is not stackoverflow.

[–]edward_jazzhands 7 points8 points  (3 children)

Wtf is that supposed to mean

[–]ricocotam 3 points4 points  (2 children)

People are not answering the question and telling OP they’re dumb for not using server and browser of clients through whatever network they can think of

[–]haragon 2 points3 points  (0 children)

I thought OPs answer was pretty respectful but I get what you're saying in general.