here is my code: if I run it on my computer, everything works, but if I run it on pythonanywhere, I get this error: aiohttp on hosting: aiohttp on my PC: I am at a loss that it is not so? I am running both files using python3.8. I also tried other urls, they have the same problem Do I
Tag: python-3.x
tkinter – dock and undock frame with wm_manage and wm_forget
I found the following in the tk docs: The wm manage and wm forget commands may be used to perform undocking and docking of windows. So I tried wm_manage and wm_forget in this code: But it dosen’t worked out. So I readed more and there is no way I can missunderstand this: A toplevel widget may be used as a
Splitting list of strings based on a character in each string ( Python )
So i have a list of strings that looks like this : This is how the list is generated and made readable (“video” is a list of selenium webelements ) : What i want to do is SPLIT this list into two other lists based on ONE specific character in each element like so : My end goal is to
IndexError in Python while splitting an input file based on a pattern
The code tries to split the text data based on a separator but I keep getting an error And the output of the two files has to be the same number of lines but I got 94132 en_out.txt and 94304 mn_out.txt for two of the files which im not sure what’s going on. The code I used is The input
How do I install pip for python 3.8 on Ubuntu without changing any defaults?
I’m trying to install pip for Python 3.8 on an Ubuntu 18.04 LTS. I know this has been asked way too many times. But those questions do not concern keeping Ubuntu’s defaults specifically. And the answers on those questions either don’t work or go on to suggest something so drastic that it would break the system – e.g. change default
Python3 PyGame how to move an image?
I tried to use .blit but an issue occurs, here is a screenshot to explain my problem furthermore: The image appears to be smudged across the screen following my mouse code: Answer Fix the indentation in your given code, it puts all the important stuff outside the while loop. You can also add a function that redraws the window each
Azure ServiceBus using async/await in Python seems not to work
I’m trying to read messages from Azure ServiceBus Topics using async/await and then forward the content to another application via HTTP. My code is simple: I want to look for messages (forever) from various topics and when a message arrives send the POST. I import the aio package from azure which should work in an async way. After many attempts,
Fastest method: for value in DictA, find value in DictB and retrieve other DictB value?
For each item in dictA, I want to search for it in dictB, if dictB has it then I want to pull some other values from dictB and add it to dictA. An example that is working is here, however it is rather slow as I have 50,000+ items to search through and it will perform this similar function on
Finding index in nested list
I am trying to create a function that will take as input a nested list and an item, and return a list of indices. For example list = [0, 5, [6, 8, [7, 3, 6]], 9, 10] and item = 7 should return [2, 2, 0], since list[2][2][0] = 7 my code should work since I can print the desires
Printing wrong text in list in Python
This is My Code. When I am trying to add backslash in the list of strings with the following code. list = [‘\’ + item for item in res] This Will remove + From the list and add ‘\’ in the starting of the code. I am also tried with r’\’ But this is not worked for me. Please