PyCharm Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 2: Line 2:
* [[PyCharm#Subjects|PyCharm]]
* [[PyCharm#Subjects|PyCharm]]
=Overview=
=Overview=
=First-Time Configuration=
=Create a Simple, Standalone Project=
=Create a Simple, Standalone Project=
File → New Project → Location: the project root. If the directory does not exist, it will be created. This is the project that will host the entry point and the [[Python_Virtual_Environment#Overview|virtual environment]] directory.
File → New Project → Location: the project root. If the directory does not exist, it will be created. This is the project that will host the entry point and the [[Python_Virtual_Environment#Overview|virtual environment]] directory.
=Create a PyCharm Project in top of a Manually-Created Project=
{{Internal|hPython_Project_Layout#Set_the_PyCharm_Project|Python Project Layout | Set the PyCharm Project}}


Python Interpreter: New Virtual environment.
Python Interpreter: New Virtual environment.
Line 14: Line 11:
New environment using Virtualenv.
New environment using Virtualenv.


Location: "venv" inside the project directory.  
Location: "venv" inside the project directory.


Create <code>main.py</code> welcome script.
=Create a PyCharm Project in top of a Manually-Created Project=
 
{{Internal|Python_Project_Layout#Set_the_PyCharm_Project|Python Project Layout &#124; Set the PyCharm Project}}
Also see: {{Internal| Python_Project_Layout#Setting_a_Manual_Project|Creating a python project manually}}


=Shortcuts=
=Shortcuts=
Line 27: Line 23:
Shift Shift
Shift Shift


=Indent Code in Block=
=<span id='Indent_Code_in_Block'></span>Indent or Outdent Code in Block=
{{External|https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html}}
Select the block then Ctrl + Option (Alt) + I. This will indent or outdent as necessary.
 
Another way to indent/outdent an entire block is to collapse the block then edit the indentation of the resulting line.
 
=Debugging Configuration=
==Configure Type Rendering==
{{External|https://www.jetbrains.com/help/pycharm/customizing-views.html}}
 
Preferences → Build, Execution, Deployment → Debugger → Python Type Renderers → +
 
Renderer name: Default
 
Apply renderer to objects of type: object or builtins.object <font color=darkkhaki>did not work.</font>


Select the block then Ctrl + Option (Alt) + I
When rendering a node: Use the following expression: <code>str(self)</code>.
=Change Font Size Dynamically=
{{Internal|IntelliJ Change Font Size|IntelliJ Change Font Size}}

Latest revision as of 18:12, 7 August 2023

Internal

Overview

First-Time Configuration

Create a Simple, Standalone Project

File → New Project → Location: the project root. If the directory does not exist, it will be created. This is the project that will host the entry point and the virtual environment directory.

Python Interpreter: New Virtual environment.

New environment using Virtualenv.

Location: "venv" inside the project directory.

Create a PyCharm Project in top of a Manually-Created Project

Python Project Layout | Set the PyCharm Project

Shortcuts

Run the program: Control ⌃ + R

Search Everywhere

Shift Shift

Indent or Outdent Code in Block

https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html

Select the block then Ctrl + Option (Alt) + I. This will indent or outdent as necessary.

Another way to indent/outdent an entire block is to collapse the block then edit the indentation of the resulting line.

Debugging Configuration

Configure Type Rendering

https://www.jetbrains.com/help/pycharm/customizing-views.html

Preferences → Build, Execution, Deployment → Debugger → Python Type Renderers → +

Renderer name: Default

Apply renderer to objects of type: object or builtins.object did not work.

When rendering a node: Use the following expression: str(self).

Change Font Size Dynamically

IntelliJ Change Font Size