-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsole_launcher.ps1
More file actions
32 lines (24 loc) · 1.07 KB
/
Copy pathconsole_launcher.ps1
File metadata and controls
32 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$Host.UI.RawUI.BackgroundColor = "DarkBlue"
$Host.UI.RawUI.ForegroundColor = "White"
Clear-Host
Write-Host "Spooling event horizons..."
$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$consoleScript = Join-Path $scriptRoot "modules\console.py"
# Set the console output encoding to UTF-8 to support emojis
$OutputEncoding = [System.Text.Encoding]::UTF8
# Set the PYTHONIOENCODING environment variable to utf-8
$env:PYTHONIOENCODING = "utf-8"
# Use system Python for environment debugging.
$pythonExe = "python"
$pythonDisplay = $pythonExe
try {
if (-not ($pythonExe -like "*\*")) {
$resolved = (Get-Command $pythonExe -ErrorAction Stop).Source
if ($resolved) { $pythonDisplay = $resolved }
} elseif (Test-Path $pythonExe) {
$pythonDisplay = (Resolve-Path $pythonExe).Path
}
} catch { }
Write-Host "[console] Python: $pythonDisplay"
# Run the Python script in launcher mode (full interactive startup), passing along all arguments
& $pythonExe $consoleScript prompt_toolkit:true startup_banner:true startup_sync:true startup_sound:true $args