Posts by user199858 • 83 points
6 posts
-
0
votes1
answer40
viewsA: How not to kill a subprocess opened by another python file?
Apparently this is a problem in Windows. When a Signal is given to kill the script, that Signal is passed to the subprocess, which is the meu_program. One way to solve this is to include…
-
0
votes1
answer40
viewsQ: How not to kill a subprocess opened by another python file?
I would like from a script in python to run a program I developed in python as well. However I would like to terminate my script but not the program I opened by it. I’m opening my program for a…
-
4
votes1
answer514
viewsQ: How to write a __init__ file in Python 3?
I created a directory with 3 modules. As below: operacoes __init__.py soma.py media.py In my file __init__.py I have the following code: from media import * The module soma.py is used within the…
-
1
votes1
answer178
viewsQ: How to indent a yaml file using regular expression?
PROD ="IND" LOCATION ="NY" LOLO ="abc" yaml_content = """ MAIN : PROD : {} LOCATION : {} EXTRA : LOLO : {} """.format(PROD, LOCATION, LOLO) yaml_content = re.sub("\n\s", "\n", yaml_content.strip())…
-
1
votes1
answer90
viewsQ: How to read the contents of a "Generator Object" from the load_all method for yaml file?
I need to maintain a function that returns me a Generator Object from a yaml file. In another function I want to access the yaml file data. import ruamel.yaml def load(): yaml =…
-
2
votes1
answer529
viewsQ: How to add a new dictionary inside another dictionary?
ini={"MAIN":{}} ini['MAIN']['Nome']="Jaque" print ini Print output: {'MAIN': {'Nome': 'Jaque'}} How to put a new dictionary into what already exists? I want to have it: {'MAIN': {'Nome': 'Jaque'}…