Click here to Skip to main content
15,892,059 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Python for Web site development? Pin
Marc Clifton19-Nov-21 2:38
mvaMarc Clifton19-Nov-21 2:38 
GeneralRe: Python for Web site development? Pin
Davyd McColl18-Nov-21 20:17
Davyd McColl18-Nov-21 20:17 
GeneralRe: Python for Web site development? Pin
Peter Adam18-Nov-21 21:07
professionalPeter Adam18-Nov-21 21:07 
GeneralRe: Python for Web site development? Pin
Davyd McColl19-Nov-21 2:47
Davyd McColl19-Nov-21 2:47 
GeneralRe: Python for Web site development? Pin
Peter Adam19-Nov-21 6:41
professionalPeter Adam19-Nov-21 6:41 
GeneralRe: Python for Web site development? Pin
Davyd McColl17-Jan-22 21:10
Davyd McColl17-Jan-22 21:10 
GeneralRe: Python for Web site development? Pin
Peter Adam17-Jan-22 21:59
professionalPeter Adam17-Jan-22 21:59 
GeneralRe: Python for Web site development? Pin
Davyd McColl17-Jan-22 23:45
Davyd McColl17-Jan-22 23:45 
Peter Adam wrote:
Yes, syntax is awful.

Plenty of people who are super-stuck on "whitespace matters" have this opinion - I used to until I realised that it doesn't have to and the structure of python makes all python code look very similar - no brace wars, the requirement for self on class methods makes the way all OO methods work suddenly very clear. But to each their own - whatever language you could bring up as beautiful, I guarantee I can pick it apart too.

Peter Adam wrote:
"base class library" is more awful.
Especially for cross-platform development.

I don't follow here (especially in the context of a web app) - I've found Python to be very good for exactly that - cross-platform dev.

Peter Adam wrote:
Don't trust me, just check the solutions for handling a key press without hanging while a key pressed.

Stuff I'm finding for CLI tools is pretty-much how one would do it in many other languages (https://www.delftstack.com/howto/python/python-detect-keypress/) - if you're talking about blocking in some GUI framework, you'll have to be more precise because that's up to the framework (eg Qt), not python.

Peter Adam wrote:
Don't trust me, just check the solutions for handling a key press without hanging while a key pressed.
Or executing an external command, and waiting for the result - now with bonus timeout from the blue!

If you're using os.system, you're delegating to the underlying libc implementation - not python's fault if it times out - rather use subprocess as documented in many places.

Peter Adam wrote:
Oh, and don't forget that deleting a non-existing file is an exception! Except when 3.6+ you unlink a non-link, because it 1) deletes the file 2) there is an argument for not throwing an exception for non-existing files Smile | :)

This is pretty-much standard behavior in many programming languages - even though the final result is the same (the file isn't there after the call), it may be important to know that. Easy fix: test first, delete if present.

I don't see the point in responding to your last comment - it brings nothing useful to the discussion and merely exposes that you're aiming to hate on Python (and, probably any other tool that isn't exactly how you'd expect it to be) irrespective of the good points. It's like hating a screwdriver for not being a spanner.

Python is great for a large array of applications, not least of which is machine learning. Python is one of the two languages I suggest to new programmers to learn (either that or JavaScript - the former because it teaches good patterns and the latter because it's even more ubiquitous). It really sounds to me like you didn't try to get into the "pythonic" way of doing things - rather trying to make Python be whatever you expected of it. This is a common error many programmers make when trying to use any framework or language - and your response that Python is broken because it doesn't conform to your expectations is the typical response of the poor craftsman blaming his tools.

I really hope that you take the time to stop hating on it and rather love it for what it can do. No tool is perfect - Python included - it's best to use tools for the tasks they are good at and accept when they are not good at it. Python is good for myriad things, including the OP's question about web development, but, like any programming language, you'll get the most out of it if you're not trying to hammer it into the shape of the language you last used, but instead use it to learn new ways to do things - that you can take back to the bread-and-butter language you use as a daily driver.
------------------------------------------------
If you say that getting the money
is the most important thing
You will spend your life
completely wasting your time
You will be doing things
you don't like doing
In order to go on living
That is, to go on doing things
you don't like doing

Which is stupid.

GeneralRe: Python for Web site development? Pin
Peter Adam18-Jan-22 0:53
professionalPeter Adam18-Jan-22 0:53 
GeneralRe: Python for Web site development? Pin
Slow Eddie19-Nov-21 1:41
professionalSlow Eddie19-Nov-21 1:41 
GeneralRe: Python for Web site development? Pin
Davyd McColl19-Nov-21 2:30
Davyd McColl19-Nov-21 2:30 
GeneralRe: Python for Web site development? Pin
Mike Winiberg18-Nov-21 20:56
professionalMike Winiberg18-Nov-21 20:56 
GeneralRe: Python for Web site development? Pin
Slow Eddie19-Nov-21 1:37
professionalSlow Eddie19-Nov-21 1:37 
GeneralRe: Python for Web site development? Pin
Wizard of Sleeves18-Nov-21 21:13
Wizard of Sleeves18-Nov-21 21:13 
GeneralRe: Python for Web site development? Pin
Slow Eddie19-Nov-21 1:48
professionalSlow Eddie19-Nov-21 1:48 
GeneralRe: Python for Web site development? Pin
Richard MacCutchan18-Nov-21 21:44
mveRichard MacCutchan18-Nov-21 21:44 
GeneralRe: Python for Web site development? Pin
Slow Eddie19-Nov-21 1:51
professionalSlow Eddie19-Nov-21 1:51 
GeneralRe: Python for Web site development? Pin
Stuart Dootson19-Nov-21 3:19
professionalStuart Dootson19-Nov-21 3:19 
GeneralRe: Python for Web site development? Pin
Slow Eddie19-Nov-21 5:45
professionalSlow Eddie19-Nov-21 5:45 
GeneralBMW Smart Car Pin
Mike Hankey18-Nov-21 6:27
mveMike Hankey18-Nov-21 6:27 
GeneralRe: BMW Smart Car Pin
Richard MacCutchan18-Nov-21 6:48
mveRichard MacCutchan18-Nov-21 6:48 
GeneralRe: BMW Smart Car Pin
MarkTJohnson18-Nov-21 6:58
professionalMarkTJohnson18-Nov-21 6:58 
GeneralRe: BMW Smart Car Pin
RickZeeland18-Nov-21 8:15
mveRickZeeland18-Nov-21 8:15 
GeneralRe: BMW Smart Car Pin
OriginalGriff18-Nov-21 8:57
mveOriginalGriff18-Nov-21 8:57 
GeneralRe: BMW Smart Car Pin
Mike Hankey18-Nov-21 9:01
mveMike Hankey18-Nov-21 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.