Skip to content

Tag: python

Install packages in a certain order with Poetry

Is there a way to set the .toml file up so you will have the dependencies installed in a certain order with Poetry? Imagine I have the following .toml: How can I make sure wxPython always is installed first? Answer There is no way to tell Poetry to install packages in a certain order. The reason for this is, …

regex whole string match between numbers

I want to extract a whole word from a sentence. Thanks to this answer, I can get whole words in cases like: where symbols next to the word don’t bother. However if there’s a number it doesn’t find the word. How should I modify the expression to match cases where there’s a number next t…

How to append items in dictionary nested list?

I have a file with two columns of data, for example: I want to obtain a dictionary with first column as the key and the second column as values, something like the following: Answer You haven’t specified full details of the content of your file. I am assuming you don’t have any column names. With …

Looping through HTML & following links

I am writing a code that is supposed to open a url, identify the 3rd link and repeat this process 3 times (each time with the new url). I wrote a loop (below), but it seems to each time sart over with the original url. Can someone help me fix my code? Answer You need to define the empty list