DWShells:Python and Tmux: Difference between revisions
Created page with "<!-- Page title: DWShells:Python_and_Tmux -->'''Run Python and persistent sessions''' Use approved Python environments and reconnect to portal-managed tmux sessions. '''Last verified:''' 6 October 2026, against the current customer panel and service rules. Your effective dashboard permissions and assigned values take precedence over examples. ← Documentation hub · [https://shells.darkworld.network/guides/python-and-sessions/ Visual websit..." |
m Protected "DWShells:Python and Tmux" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) [cascading] |
||
(No difference)
| |||
Latest revision as of 01:23, 6 October 2026
Run Python and persistent sessions
Use approved Python environments and reconnect to portal-managed tmux sessions.
Last verified: 6 October 2026, against the current customer panel and service rules. Your effective dashboard permissions and assigned values take precedence over examples.
← Documentation hub · Visual website guide
Two ways to manage work
| Step | What it means |
|---|---|
| 01 · Python app | Environment → uploaded script → managed Run script. |
| 02 · Persistent terminal | Session → attach in Shell Access → detach and return. |
Check your plan
Before you continue: Python and development permissions vary by plan. Use only approved workloads. All programs share the shell’s resource limits. A persistent session does not override Keep, account expiry, process limits or service restarts.
A Python environment
- Create an environment. Open Python in Packages, choose an environment name and use Create environment.
- Upload a script. Select a UTF-8 .py file. The current portal upload limit is 64 KiB. Use Upload script, then select the uploaded script or its returned path.
- Install required dependencies. Enter the packages your script actually needs and use Install dependencies. Inspect the result before running the script.
- Run and inspect. Select the correct environment and script path relative to your home, then use Run script. Check View logs. Stop an unused application before changing or deleting its environment.
A simple first script
Save as hello.py locally, upload it and use it to check that your environment works:
print("Hello from my DWShells Python environment")
This script prints one line and exits normally. A finished process is expected, not a failed always-on app. Deleting an unused environment keeps uploaded scripts, but you should still save independent copies.
Persistent terminal work
- Create a session. In the appropriate Packages session manager, choose a session name and use Create session. Available IRC clients are shown by the panel.
- Attach in Shell Access. Use Copy attach command and run the exact command in your browser terminal or SSH connection. Portal-managed sessions use a dedicated tmux socket.
- Detach and return. Press Ctrl+B, release, then D to detach from tmux. Reconnect later and run the same attach command. Closing the session is different from detaching and terminates that session’s work.
Example attach command
For a portal-managed session named ircsession:
tmux -S ~/.dwshell-tmux.sock attach -t ircsession
Use the name and command copied from your panel. A plain tmux attach can look for a different socket and miss the portal-managed session.
Troubleshooting
| What you see | What to do |
|---|---|
| Python is unavailable | Check your plan and ask staff if your intended work needs additional permission. |
| Module not found | Install the dependency in the selected environment and inspect its installation output. |
| Script exits immediately | Read logs. A short script may have completed normally. |
| No tmux session found | Check selected shell, session name and the dedicated socket in the copied command. |
Environment, script and process
| Item | Meaning |
|---|---|
| Environment | The selected Python environment and its installed dependencies |
| Script | A uploaded source file; choose its path relative to your home |
| Process | The currently running invocation; a short script can exit normally |
Choose the same environment for dependency installation and script execution. Avoid pasting secrets into script source that you intend to share.
Detach, exit and close
Detach leaves the tmux session available for reattachment. Exit ends the program or shell you are using. Close session terminates that managed session's work. Persistent sessions still depend on account status, Keep, resource limits and host availability; they are not an uptime guarantee.
Rules and support
This guide describes how to use the service; it does not replace Signup and Rules. Join #DWShells on irc.darkworld.chat using TLS port 6697 for help. Use the customer portal for your actual status and connection details. Never share credentials or recovery links.