Crash using python, subprocess and pickfolder
- Dominant language
- Perl
- Stars
- 3.9k
- Forks
- 213
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
I have this python script:
```python
import subprocess
import rich
from rich.console import Console
from rich.markdown import Markdown
from rich import print
import os
from time import sleep
def ashell_environment(console):
"""
Relly on pickFolder in ashell to create the environment
:param console: rich console
:return vault_path, blog_path
"""
vault = ""
blog = ""
console.print("Please provide your [u bold]obsidian vault[/] path: ")
cmd = "pickFolder"
sleep(5) # The user needs to read the message !
subprocess.Popen(cmd, stdout=subprocess.PIPE)
# Now, the os.getcwd() change for the pickedFolder
vault = os.getcwd()
subprocess.Popen(cmd, stdout=subprocess.PIPE)
console.print("Please provide the [u bold]blog[/] repository path: ")
sleep(5) # The user needs to read the message !
subprocess.Popen(cmd, stdout=subprocess.PIPE)
blog = os.getcwd()
# return to default environment
cmd = "cd"
subprocess.Popen(cmd, stdout=subprocess.PIPE)
return vault, blog
console = Console()
vault, blog=ashell_environment(console)
print(vault, blog)
```
The script crash at the moment where pickFolder open.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.