Skip to content

Latest commit

 

History

History

session-04

Session 04

Blackboard sessions

Extra Resources

Creating a PyCharm Template for Python

  • Open Pycharm professional
  • Press CTRL+ALT+S to open the settings
  • Locate the "Editor" Option within the settings
  • Now expand this option and locate "File and Code Templates"
  • In the right ride, locate the "Python Script" option and click once
  • In the blank mini editor add:
# --------------------------------------------------------
#
# ADD PROGRAM TITLE HERE
#
# ADD SUMMARY OF PROGRAM HERE
#
# Folder:    ${DIR_PATH}
# Filename:  ${FILE_NAME}
# Author:    Adrian Gould <Adrian.Gould@nmtafe.wa.edu.au>
# Version:   0.0
# 
# --------------------------------------------------------
  • Click APPLY
  • Click OK

Next time you create a Python file the file will start with code similar to:

# --------------------------------------------------------
#
# ADD PROGRAM TITLE HERE
#
# ADD SUMMARY OF PROGRAM HERE
#
# Folder:    session-04
# Filename:  demo_input_try_v2.py
# Author:    Adrian Gould <Adrian.Gould@nmtafe.wa.edu.au>
# Version:   0.0
# 
# --------------------------------------------------------

Practice

All practice exercises are not assessed, but are there to enhance your learning.

Remember that it is better to try and work out the solution, and not succeed than it is to simply use Google, Bing, or AI to find a solution and copy the code.

Refer to the following ScreenCraft HelpDesk article to learn how to enable PyCharm to add the standard header code automatically to each Python file it creates.

Problem 1

Filename: ...