Is there a way I can reopen a withdrawn window? I know it is impossible with the destroy function, but I would imagine it would be possible to do so after using the the withdraw function. I created a root1 loop and a root2 loop which opens after the root1 is closed. I have a back button on the second
Tag: python
AWS SageMaker Jupyter Notebook: Images not Showing
I’m currently trying to display some images using AWS SageMaker making use of its Jupyter Notebook app. However, all I’m trying to do is show the loaded images. I have written a function to do this but all I’m left with is the images index and image name on calling the function. The function…
How to make tables with X amount of booleans with all possible values?
How do i iterate through all possible X boolean values? i.e i have 2 booleans, how do i make a table with all truths and falses? like: A 0 0 1 1 B 0 1 0 1 Answer Try to iterate over the 2 ** number of variables integers. The following example for 4 variables: will produce the following:
find_element(By.CLASS_NAME…) InvalidSelectorException
I need to navigate to the object with special class, that changes every page refresh So i decided to use bs to find the element class, that works, but selenium raises an exception about invalid selector. class is existing, i can find it in page source. There are some spaces at the beginning and at the ending …
How to assign variables to worker Thread in Python PyQt5?
I have designed a GUI program using pyqt5. I have a main thread and a worker thread. When the GUI starts, i get some inputs from user such as age, name, … and i want to process the inputs in worker. For example How can i send the inputs which i get using self.ui.firstname.text() to the worker? in other …
Getting number of childs of an element with no ID with beatifulsoup
So basically I’m trying to scrape a webpage with Python and I’m getting stucked at finding the number of childs of one element in a list using BeautifulSoup, the HTML of the list follows this: In my case I want to get the number of tr inside tag tbody, but since it has no id, I found no way to
I’m trying to replace/convert all the A’s and B’s in a particular column to 1 and O in a csv file
This is the error i’m getting This is what i have tried repl = {‘Y’:’1′, ‘N’:’0′} prices_dataframe[‘col_state’] = prices_dataframe[‘col_state’].replace(repl, regex=True) Answer The replace() method is unique to strings, and at some …
how do I (filter and) save many ROIs taken from a larger picture individually to picture files?
I followed this discussion: How extract pictures from an big image in python made mine, this is the output link https://imgur.com/a/GK8747f and .py script below I did frame them up, then how to save each one/qr code Answer I did frame them up, then how to save each one/qr code If you want to save the contents…
How do i convert a modified list of The Alphabet into a number?
i want to convert the sentence from variable (salam) into numbers. The conversion table is like a modified alphabet just like in (char2). My expected output is a 3×3 matrix, inside is the converted number from(salam) using (char2) and the output is here is the image for clarity Answer The problem is from…
Regular Expression: match word in a blank of a sentence
I have the following line: I _ foo and _ I want to match anything (case insensitive) that matches the text and has a words that replace the underscores e. g. So in this case I want to get the whole sentences back: [“I want foo and bar”, “I implemented foo and foo”, “i use Foo and…