I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2.2 KiB

Python

Python is an interpreted high-level general-purpose programming language1.

Setup

Ensure python31 is installed on the system, and the lsp and dap modules have been loaded before loading this module.

RUN apt install -y python3 python3-pip

Install the language server

Install the pyls2 language server.

RUN pip3 install --user "python-lsp-server[all]"

Config

Add support for python31, including dap and lsp integration. The built-in Emacs mode python-mode3 handles the rest of the integration.

(use-package python-mode
  :hook (python-mode . lsp-deferred)
  :config (require 'dap-python)
          (add-to-list 'org-src-lang-modes '("python" . python))
          (add-to-list 'org-structure-template-alist '("py" . "src python"))
          (org-babel-do-load-languages 'org-babel-load-languages '((python . t)))
  :custom (python-shell-interpreter "python3") ;; Required if "python" is not python 3.
          (org-babel-python-command "python3") ;; Same as above.
          (dap-python-executable "python3")    ;; Same as above.
          (lsp-pyls-server-command "pylsp")
          (dap-python-debugger 'debugpy))

Code symbols

Programming buffers can be made prettier with pretty-mode4, this is complimentary to prettify-symbols-mode5, a built-in package containing similar (but lacking) functionality.

(use-package pretty-mode
  :hook (python-mode . turn-on-pretty-mode))

Footnotes