Python Forum
Changing to new Python formatting example
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing to new Python formatting example
#4
use f-string. they're more readable, and I'm pretty sure a bit more performant (but don't quote me on that).

UNLESS you are in the logger library. In this case, use the old style.

import logging
logger = logging.getLogger('arb')
logger.debug("use old style s% here", your_str_var)
Reply


Messages In This Thread
RE: Changing to new Python formatting example - by yaythomas - Sep-22-2020, 07:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Virtual Env changing mysql connection string in python Fredesetes 0 380 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  python-docx: preserve formatting when printing lines Tmagpy 4 2,110 Jul-09-2022, 01:15 AM
Last Post: Tmagpy
  Changing a string value to a numerical value using python code and a lamda function Led_Zeppelin 6 1,617 Jul-05-2022, 11:29 PM
Last Post: deanhystad
  changing Python files to .exe alok 2 2,247 Jul-20-2021, 02:49 PM
Last Post: alok
  Changing Index of 2 List in python giddyhead 0 1,680 Mar-05-2021, 05:45 PM
Last Post: giddyhead
  Automating to run python script 100 times by changing parameters pmt 1 2,610 Dec-29-2020, 10:31 AM
Last Post: andydoc
  changing animation speed using buttons in python microwave 1 2,122 Jun-24-2020, 05:21 PM
Last Post: GOTO10
  Problem after changing Python directory Souila7 1 2,165 Jan-25-2020, 05:06 PM
Last Post: ThiefOfTime
  changing the process command line arguments in python Skaperen 3 3,022 Aug-19-2019, 02:40 PM
Last Post: wavic
  Changing Python Versions in Ubuntu 16.04 ErnestTBass 2 3,140 Jan-10-2019, 05:45 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020