Skip to content

Tag: python-3.x

Function returns only first element of the list

I am trying to get every element from python list returned as a string, but it returns only the first element of the list, not continuing the loop. Main Code (prishot.py) Test code to run the above (test.py) After running the test.py it gives me only the first sentence in the list s in prishot.py: Screenshot …

How to close all the processes one by one in a program that operates with multiprocessing by means of an ‘if’ validation found in one of them process?

I need that when the variable text is equal to “Close your program” the 3 active processes(p1,p2,p3) are closed. I have tried to do something like this: But it is not working for me, and I would need a better code that allows me to close them one by one in that code block if text is equal to &#822…

play as many sounds as loop count in python

I want the alarm.play() function to repeat for the number of loops and ring 10 times as in the example, but it just keeps ringing once every time I try or change it. How can I fix this? And does it make more sense to use for instead of while ? Answer just stop the alarm at the end of

How to split words into different columns in dataframe?

I am new to coding , recently started learning to code. Currently I am stuck in the process to split a column. Please help me I have this dataframe and I want to split it into Really appreciate for taking your time and answering to my problem. PS: this is just an example of option symbol which is combination …

How to make odoo progress bar use decimal?

So I am learning odoo right now, and I want to make the progress bar that use decimal to determine it’s percentage. so for example if I input a 0.5, the progress bar will show 50%, so I don’t have to input 50 to get 50%. I tried using options like below PY XML but the output is either 0/1