I just want to reformat everything so it's perfect. Is there anything like that in Python? What's the best?
Making a prettier GUI on Python program
automatic prettier for python code? (as in javascript) - Emacs Stack Exchange
Just made my first ever Python Web Tool. Help me make it prettier/faster please?
-
Wasn't that bad for me. How are you storing the distances? Sounds like you store all possible combinations (unless you've data for so many unique stars which can be significantly reduced. Also, use a db!
-
definitely use bootstrap
-
Some js working with the fields and a simple auto-completion algorithm could do it. Shouldn't be that hard! Update me here if you need more!
Terrible formatting with python
Do you have the LSP installed? Check with :Mason and if it's not do a :LSInstall the relative python LSP - I use prettier to format on save, not sure what python equivalent you can use, but you can check those with :PackerStatus see what's availabile
More on reddit.comVideos
If I disabled Prettier as the default formatter, it would not format on save anymore, but my Python would be formatted by autopep8 on save. With this in mind, the following solution worked for me to have both Prettier working for other languages and autopep8 for Python:
{
"workbench.iconTheme": "vscode-icons",
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"git.confirmSync": false,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"python.formatting.provider": "autopep8",
"explorer.confirmDelete": false,
"python.showStartPage": false,
"explorer.confirmDragAndDrop": false,
"python.linting.pylintArgs": ["--load-plugins=pylint_django"],
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[python]": {
"editor.defaultFormatter": "ms-python.python"
}
}
Let me know if somebody finds a better solution!
Meaningful config snippet from @round_circle's answer:
"[python]": {
"editor.defaultFormatter": "ms-python.python"
}
After adding it, autopep8 worked for python files.
» npm install prettier