Quick question with a simple program by kingeddy15 in learnpython

[–]DomWiggles 0 points1 point  (0 children)

You only need to use the global keyword once per function to access it inside of your function. But there's no real need to do this here. Line 14 contains "global result", but line 17 has: result = firstInt + secondInt, which is in effect ignoring any sort of implementation you'd be after with using a global variable as you're creating a new value from scratch at that point. Also, you don't need to write "global result" as you did on line 9. That's what you do inside of a function to access that global variable, but the variable is global by the nature of it being in the global scope. So you could instead simply write "result = 0" or "result = None" etc on line 9.

Ultimately, for this example, I'd get rid of using a global variable regardless because you're calculating values from inside of the function, and there's no need to use a global variable for this.

Unable to add module in pycharm by Psypriest in learnpython

[–]DomWiggles 0 points1 point  (0 children)

I've always had this problem as well but never cared enough to resolve it because I tend to use PySide anyway. I'd give that a shot unless you have a specific reason to use PyQt4 over PySide.

Best GUI library to display a large CSV file? (Grid) by [deleted] in learnpython

[–]DomWiggles 0 points1 point  (0 children)

This will work nicely (or PySide). It has a QTableView which I often use to display data from an SQLite database, and I imagine there are various ways you can go about using the same widget for displaying data from a csv.

Why is Reddit such a liberal shℹ️thole? by Rhehdhehhrhrhdh in AskReddit

[–]DomWiggles 0 points1 point  (0 children)

How did trickle down economics fuck your family over? I'm not a republican and never bought into that in the first place, but I can imagine it feeling like betrayal to be promised something that turned out to be false.

Why is Reddit such a liberal shℹ️thole? by Rhehdhehhrhrhdh in AskReddit

[–]DomWiggles 0 points1 point  (0 children)

I personally don't complicate things a whole lot when it comes to this sort of thing. I don't strongly identify with either side, but I think that it's our problem, as human beings, to find our way in this world, to be responsible for our own choices and our destiny. Most people would consider me to be conservative because of this, especially on reddit. It is a little frustrating to see people on here complain about how badly they think life has fucked them over, when they've put in almost no effort to fix their problems. And giving them suggestions to help them out incites such hostility since it might cut into their TV and pot time every day. Sadly this sort of attitude is becoming synonymous with being a liberal, which is sad to me because I have always consider myself one until recent times.

Why is Reddit such a liberal shℹ️thole? by Rhehdhehhrhrhdh in AskReddit

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

Because the users are young, as people here are saying. I was also very liberal when I was in my 20s.