text

How to iteratively retrieve the right information from beautiful soup elements?

How to iteratively retrieve the right information from beautiful soup elements? Question: I try to retrieve information from EZB press releases. To do so I use BeautifulSoup. Since the structure (HTML) of the press releases is changing over time, it is difficult to retrieve the date of the press releases with a single selector. Hence …

Total answers: 2

Splitting a string into new lines based on specific number of characters

Splitting a string into new lines based on specific number of characters Question: I would need to split a string in new lines based on the number of characters included in a list: num_char=[14,12,7] # the list is actually longer: this is just an example text = "Hello everyone how are you? R u ok?" …

Total answers: 3

How to center an image in the tkinter Text widget?

How to center an image in the tkinter Text widget? Question: A button on the main application opens a help file that is a text file imported from the file system. Before the text I want to display an image. This code places the image properly before the text BUT I can’t center it. Here’s …

Total answers: 1

Convert lines of values in text file to a CSV

Convert lines of values in text file to a CSV Question: Here is my data from a text file: foo no 3.61 9.51 bar -26 67 2.35 0.50 70 baz dxo 6 2.37 quez -9.07 51 udx 9.66 9.66 scz -8 pdu hk 0.50 -5.34 -13 0.50 ytrs bl 1.27 -63 -0.66 xle 29 1.27 …

Total answers: 2

How to remove certain words from text while keeping punctuation marks

How to remove certain words from text while keeping punctuation marks Question: I have the following code that removes Bangla words from given text. It can remove listed words from text successfully, but it fails to remove a word with punctuation. For example, here, from input text "বিশ্বের তথা দূষিত না বায়ুর না, শহরের না।", …

Total answers: 2

Working with text file in python – copy vertical text and paste it horizontally

Working with text file in python – copy vertical text and paste it horizontally Question: How to copy vertical text and paste it horizontally as csv. input_text_file = """ Statement 1 some text some text some text some text some text some text some text Statement 2 some text some text some text some text …

Total answers: 1