string

Regex string parsing: pattern starts with ; but can end with [;,)%&@]

Regex string parsing: pattern starts with ; but can end with [;,)%&@] Question: I am attempting to parse strings using Regex. The strings look like: Stack;O&verflow;i%s;the;best! I want to parse it to: Stack&verflow%sbest! So when we see a ; remove everything up until we see one of the following characters: [;,)%&@] (or replace with empty …

Total answers: 1

What is the fastest and simplest way to remove "" from a string

What is the fastest and simplest way to remove "" from a string Question: when im parsing a lot of data with python and it can happen that some parts of the data contains strings/chars with , this can lead to problems when working with the data so my goal is minimize errors by removing …

Total answers: 1

Why does Python's rstrip remove more characters than expected?

Why does Python's rstrip remove more characters than expected? Question: According to the docs the function will strip that sequence of chars from the right side of the string. The expression ‘https://odinultra.ai/api’.rstrip(‘/api’) should result in the string ‘https://odinultra.ai’. Instead here is what we get in Python 3: >>> ‘https://odinultra.ai/api’.rstrip(‘/api’) ‘https://odinultra.’ Asked By: Corneliu Maftuleac || …

Total answers: 1

Python comparison problem for wordle type game

Python comparison problem for wordle type game Question: I am making a wordle game in python. For that i need to compare the wordle word(mentioned as random_word in the code) to the input by user. The problem is i am unable to devise a method to handle repititions of letters in any word. Here is …

Total answers: 3

Why is the first string variable from my function being printed out of line?

Why is the first string variable from my function being printed out of line? Question: I’m just a newbie in python and programming in general. And i made this simple hospital python script which prints out a specific patient’s information. The code works just fine. But for some reason the final output gives me some …

Total answers: 1

Python selenium string formatting in web element

Python selenium string formatting in web element Question: How do I iterate over multiple div web elements? I want to collect EPA Registration numbers (ex: 12455-61, 12455-61-3240) using a for loop, but I get error that the web element cannot be located using string formatting. Here’s the HTML: <div class="product"> <div class="mainSection"><p><span class="reportLabel">EPA Registration #:</span> …

Total answers: 2

Python: How to convert string of an encoded Unicode variable to a binary variable

Python: How to convert string of an encoded Unicode variable to a binary variable Question: I am building an app to transliterate Myanmar (Burmese) text to International Phonetic Alphabet. I have found that it’s easier to manipulate combining Unicode characters in my dictionaries as binary variables like this b’xe1x80xadxe1x80xafxe1x80x84′: ‘áɪŋ̃’, #’ိုင’ because otherwise they glue …

Total answers: 1