Skip to content

Tag: python

Different sound playing modules not working

I created a program for my little sister to learn math and now want to add sound. So looked up on how to add sound to my program and found the winsound module. I wrote this code: But for some reason it only plays the default windows sound. (Bliiiiiingg) The file victory.wav is located in the same folder as th…

Shorten Selenium-Wire Option

I would like to improve the following case by shorting it. I’ve come this far You could say that I should just remove the n decision, but I can’t because I need seleniumwire_options later. Answer You can shorten it by factoring out common parts, like this:

Output of split is not what I was expecting

I’m just learning python, and I’m having some problems reading a .txt file that I created. My objective: I have a txt file with a list of strings. I’m trying to read, process it and save every letter into a new list. example2.txt file: [one, two, THREE, one, two, ten, eight,cat, dog, bird, f…