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 …
Tag: python-3.x
Its giving me a module not found error but its installed but if i run a different code it does not give a error
When I run this code it gives a module not found error for line 2 but it is installed on my computer. I know that because when i type pip list in the command prompt it is in the list However on the same computer if I run this code It works and does not give an error. But I
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 ̶…
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 call direct imports of libraries in the creation of a Python package
Background I’m trying to create a Python package with a semi-complicated structure. I have published a few packages before, and because they were simple, I put all the classes and functions necessary in __init__.py itself. For example, the file structure of one of my simple packages would be: A sample _…
Find a substring in cells across multiple columns in a Pandas dataframe
I have a large DataFrame with 50+ columns which I’m simplifying here below: I’m trying to find a) whether there are any instances of ‘—>’ in any of the cells across the DataFrame? b) if so where? (optional) So far I’ve tried 2 approaches this only works for strings not s…
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
how to do a subquery or filter in a condition met by a previous query correctly
Im using python, flask and sqlalchemy have the query below: Now let’s assume that i want to search for the condition Foo1.id != 2 but still make sure that i meet the condition of the query above, what would be the best way to achieve that (i am trying to learn how to do subquery or filter in another que…
ValueError: write() requires mode ‘w’, ‘x’, or ‘a’ in Python zipfile
I am trying to open a specific file in the archive and then write some content to it. I am using the zipfile.open() function to get access to the file: However, it gives me a warning about duplicate file called ‘hello.txt’. After that I get the following error: What am I doing wrong here? My full …