You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
This repository is a lightweight template for a reproducible Python development environment using Docker and VS Code Dev Containers. It is pre-configured to optionally leverage an NVIDIA GPU when available, so you can work on data science, ML, or general Python projects without polluting your host system.
6
6
7
+
**New Feature**: This environment now includes a browser-accessible desktop GUI, allowing you to run graphical Python applications (like matplotlib, tkinter, PyQt, etc.) directly in your browser without needing X11 forwarding or VNC clients.
8
+
7
9
## Prerequisite
8
10
9
11
Before using this repository, you need to have the following installed on your system:
@@ -12,6 +14,14 @@ Before using this repository, you need to have the following installed on your s
12
14
- VSCode with Dev Container extension installed
13
15
- Alternative: Remote Repositories extension of VSCode
14
16
17
+
## Key Features
18
+
19
+
***Browser-Based GUI**: Access a full Linux desktop environment directly in your browser for running GUI applications
20
+
***No Port Collisions**: Dynamic port mapping allows multiple instances without conflicts
21
+
***NVIDIA GPU Support**: Pre-configured for GPU acceleration when available
22
+
***Python Version Management**: Easy switching between Python versions using mise
23
+
***Isolated Environment**: All dependencies are containerized, keeping your host system clean
24
+
15
25
## How to use
16
26
17
27
To use this repository, follow the steps below:
@@ -33,3 +43,72 @@ What py-init does
33
43
- Creates/updates a local mise.toml in the current directory.
34
44
- Uses mise to select the requested Python version.
35
45
- Configures the local virtualenv path to .venv and enables automatic creation.
46
+
47
+
## Browser GUI Desktop
48
+
49
+
This development environment includes a browser-accessible desktop GUI for running graphical Python applications.
50
+
51
+
### Accessing the Desktop
52
+
53
+
When you open the container in VS Code:
54
+
55
+
1.**Automatic Access**: VS Code will automatically forward port 6080 and open the desktop in your browser
56
+
2.**Manual Access**:
57
+
- Look at the **PORTS** tab in VS Code's bottom panel
58
+
- Find port **6080** labeled **"Desktop GUI"**
59
+
- Click the **globe icon** (🌐) to open it in your browser
60
+
61
+
### Using GUI Applications
62
+
63
+
The browser desktop allows you to run any graphical Python application:
64
+
65
+
**Example: Matplotlib**
66
+
```python
67
+
import matplotlib.pyplot as plt
68
+
import numpy as np
69
+
70
+
x = np.linspace(0, 10, 100)
71
+
y = np.sin(x)
72
+
73
+
plt.figure(figsize=(10, 6))
74
+
plt.plot(x, y)
75
+
plt.title('Sine Wave')
76
+
plt.xlabel('X')
77
+
plt.ylabel('Y')
78
+
plt.grid(True)
79
+
plt.show()
80
+
```
81
+
82
+
**Example: Tkinter**
83
+
```python
84
+
import tkinter as tk
85
+
86
+
root = tk.Tk()
87
+
root.title("Hello Python GUI")
88
+
root.geometry("300x200")
89
+
90
+
label = tk.Label(root, text="Hello from Python!", font=("Arial", 16))
0 commit comments