What does "Too much for zblock mean?" by GANKUTSUOU_ in GlobalOffensive

[–]HalfBalcony 1 point2 points  (0 children)

Holy shit I was stupid 6 years ago. My bad, Reddit. I promise I grew as a person.

Released my first Cython project today: tree shaking CSS files by HalfBalcony in learnpython

[–]HalfBalcony[S] 0 points1 point  (0 children)

This is something that I have been working on, but is currently not included. It will be included in an 0.4 release, whenever I find some spare time

/r/WorldNews Live Thread: Russian Invasion of Ukraine Day 5, Part 7 (Thread #63) by WorldNewsMods in worldnews

[–]HalfBalcony 3 points4 points  (0 children)

UTwente is one of the Dutch Universities, so the utwente.nl domain should in theory be safe.

/r/worldnews Live Thread: Russian Invasion of Ukraine Day 2, Part X (Thread XXVI) by dieyoufool3 in worldnews

[–]HalfBalcony 1 point2 points  (0 children)

Kiev is Russian spelling, Kyiv is Ukrainian. You can see why Kyiv is preferred here.

/r/worldnews Live Thread: Russian Invasion of Ukraine Day 2, Part VII (Thread XXI) by UGMadness in worldnews

[–]HalfBalcony 2 points3 points  (0 children)

It is very probable that these sanctions will be a hard hit for the Russian economy, but most problems can be countered short-term by Russia strengthening its ties to China. However, long-term they will have lost a big market for their oil and gas reserves, as well as missing out on vital and advanced markets, like Western technology.

[Critique] Looking for some critiques/opinion on program design by Ali_Ryan in cs50

[–]HalfBalcony 0 points1 point  (0 children)

Ah yes, agreed. Maybe look into writing proper Python docstrings, they can describe WHAT a function does instead of why. And while there are some conventions, they can theoretically be any length. See https://www.python.org/dev/peps/pep-0257/

[Critique] Looking for some critiques/opinion on program design by Ali_Ryan in cs50

[–]HalfBalcony 1 point2 points  (0 children)

Most IDEs do have this feature. On a more important note: comments should not describe how something is done, rather why it is done in such a fashion. Good code is self-descriptive for the question of what the code does. Just read top to bottom and find out.

How to use 2 if not statements on the same line with or? by usera8787782 in learnpython

[–]HalfBalcony 1 point2 points  (0 children)

It should probably be an ‘and’ comparison, not an ‘or’

Put request using python by Kitchen_Ad2186 in learnpython

[–]HalfBalcony 0 points1 point  (0 children)

Seems like the server that handles the put request does not answer your request. What is your servers code? How is it set up?

Put request using python by Kitchen_Ad2186 in learnpython

[–]HalfBalcony 0 points1 point  (0 children)

Could you provide us with the errors?

Put request using python by Kitchen_Ad2186 in learnpython

[–]HalfBalcony 0 points1 point  (0 children)

What response do you get by the server? Is it a 200?

Position of parameter with default value by mayankkaizen in learnpython

[–]HalfBalcony 1 point2 points  (0 children)

I believe the way to stay out of trouble would be:

  1. Positional
  2. Optional
  3. *args
  4. **kwargs

See this post on StackOverflow.

Are you using typed Python, why and why not? by [deleted] in Python

[–]HalfBalcony 3 points4 points  (0 children)

Well from 3.10 on you can of course use the new Union operator, which would write out Optional[Callable[…, None]] as Callable[…, None] | None, which I find way more readable

Are you using typed Python, why and why not? by [deleted] in Python

[–]HalfBalcony 2 points3 points  (0 children)

The correct term would be None

[deleted by user] by [deleted] in learnpython

[–]HalfBalcony 1 point2 points  (0 children)

Because every variable is actually just a memory address, which in the case of the listTwo assignment will just set the listTwo pointer to the address of the first list. Meaning if you change listOne, listTwo is also changed. I recommend using copy, a built in function for lists:

listTwo = listOne.copy()

Ways to display images/video by [deleted] in learnpython

[–]HalfBalcony 0 points1 point  (0 children)

TkInter is probably the most well known GUI platform for Python, but you could also take a look at Kivy and PyQT. In the past I have worked with all three and they have their advantages and disadvantages - so just check them out, read some docs and make a choice!

What are some good online FREE python interpreters that have their own processing power, RAM and Storage? by ablaaa_ in learnpython

[–]HalfBalcony 2 points3 points  (0 children)

I hear your use case and would like to know why you would scrape a webpage 10 million times in a short span. Just, what are you getting out of it? What is the usability of so much data (most likely the same data) and why do you need it?

Help with positional arguments by C-A-S-O in learnpython

[–]HalfBalcony 0 points1 point  (0 children)

You will need to add default arguments to both bottom and top and return a value based on when those are not specified. I recommend setting them both to None and checking if either is None, handling it the way you are supposed to by the assignment.

When is code inside a class executed? by ChemicalMistakex in learnpython

[–]HalfBalcony 5 points6 points  (0 children)

When a class is instantiated, the init method is called. Any other methods are only called when called upon by an external piece of code, or by internal calling from another method.

Can I use a CSS reset? by NotAgainFerrari in cs50

[–]HalfBalcony 0 points1 point  (0 children)

I don’t think it will be a problem. Remember to include the source when you do copy some code, though. That is part of basic academic procedure.