Python Forum
add Escape charcters in string
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
add Escape charcters in string
#3
And two more solutions:
  1. Make it a raw string by prepending "r". In raw strings a backlslash will not be interpreted.
    cmd = r"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe"
  2. Use forward slashes instead of backslashes. Python will understand this.
Reply


Messages In This Thread
add Escape charcters in string - by GrahamL - Jan-20-2022, 10:45 AM
RE: add Escape charcters in string - by ThiefOfTime - Jan-20-2022, 10:59 AM
RE: add Escape charcters in string - by ibreeden - Jan-20-2022, 11:58 AM
RE: add Escape charcters in string - by GrahamL - Jan-20-2022, 01:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Warning - ' invalid escape sequence '\s'' tester_V 4 36,437 Aug-08-2024, 04:58 PM
Last Post: tester_V
  use of escape character in re.sub and find WJSwan 1 1,677 Feb-16-2023, 05:19 PM
Last Post: Larz60+
  Escape indentation Frankduc 11 5,281 Jan-31-2022, 02:41 PM
Last Post: Frankduc
  Escape Single quotation between each content tag usman 3 3,810 May-02-2021, 03:32 PM
Last Post: snippsat
  DIY Escape Room for fun StannemanPython 1 4,348 Feb-17-2021, 10:53 PM
Last Post: maurom82
  How to escape OrderedDict as an argument? Mark17 2 2,797 Dec-23-2020, 06:47 PM
Last Post: Mark17
  Trying to cycle through a list of charcters pooky2483 12 6,815 Sep-28-2020, 06:55 AM
Last Post: pooky2483
  Remove escape characters / Unicode characters from string DreamingInsanity 5 22,757 May-15-2020, 01:37 PM
Last Post: snippsat
  help for escape sequences NewPi 1 2,745 Dec-11-2019, 11:22 PM
Last Post: ichabod801
  escape single quote deep_logic 1 2,389 Sep-10-2019, 08:05 PM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

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