Skip to content

How to create .ts files for Qt Linguist with PySide6?

I have a python project written with PySide2 and now I want to migrate to PySide6. I used Qt Linguist to translate UI and created .ts files with help of this command: pylupdate5 utility from PyQt5 package (but it worked fine for my project with PySide2). Now I plan to get rid of PySide2 and PyQt5 packages. So…

How to split a string without using .split()?

I have a function that takes a parameter string and a ‘target’, where the target is a substring of the string. I need to output the index of these substrings within the string. I am not allowed to use the split function, so how else would I split up the string? Ex: if string is “we dont need…

How to put a text label next to a matplotlib.pyplot.arrow?

I can manually add a label next to an arrow in Matplotlib 3.4.3. by estimating its location. Output: I wonder if there is a builtin way to add the label to an arrow and align its label accordingly? if no what is the easiest approach? Answer Maybe a bit easier to read using axes.annotate but somewhat equivalen…

Cant load spacy en_core_web_trf

As the self guide says, I’ve installed it with (conda environment) I have spacy-transformers already installed. But when I simply do: It shows me this error: More info about the error: Answer Are you sure you did install spacy-transformers? After installing spacy? I am using pip: pip install spacy-trans…

Trouble With SQL Query in Python

Hello I’m getting an error: near “join”: syntax error. Is there an obvious issue with this that I’m not picking up on? I’ve changed names in the query but I’ve gone over and checked for spelling errors already. Answer In SQL, the order of clauses is SELECT, FROM, JOIN, WHER…