holzschu / holzschu/a-shell

Crash using python, subprocess and pickfolder

Open
#387 1 comment 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.