Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
escape single quote
#1
Hi all,
I'm trying to do a simple chdir in IDLE, 2.7.5.

os.chdir(r'\\hilltop3\users$\LongRandy\My Documents\HOW-TO\'S)
I keep getting, "The system cannot find the path specified: "\\\\hilltop3\\users$\\LongRandy\\My Documents\\HOW-TO\\'s"

I did use the "\" single backslash just to try it and it does work if I'm just printing something.

Not sure what I'm getting wrong.

Any help is appreciated.
"Human history becomes more and more a race between education and catastrophe." - H. G. Wells (1866-1946)
Reply


Messages In This Thread
escape single quote - by deep_logic - Sep-10-2019, 06:30 PM
RE: escape single quote - by SheeppOSU - Sep-10-2019, 08:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Warning - ' invalid escape sequence '\s'' tester_V 4 37,221 Aug-08-2024, 04:58 PM
Last Post: tester_V
  use of escape character in re.sub and find WJSwan 1 1,691 Feb-16-2023, 05:19 PM
Last Post: Larz60+
  python sql query single quote in a string mg24 1 2,339 Nov-18-2022, 08:01 PM
Last Post: deanhystad
  Escape indentation Frankduc 11 5,340 Jan-31-2022, 02:41 PM
Last Post: Frankduc
  add Escape charcters in string GrahamL 3 2,057 Jan-20-2022, 01:15 PM
Last Post: GrahamL
  Escape Single quotation between each content tag usman 3 3,879 May-02-2021, 03:32 PM
Last Post: snippsat
  DIY Escape Room for fun StannemanPython 1 4,418 Feb-17-2021, 10:53 PM
Last Post: maurom82
  How to escape OrderedDict as an argument? Mark17 2 2,820 Dec-23-2020, 06:47 PM
Last Post: Mark17
  How to double quote filenames (spaces)? Winfried 2 4,720 Jan-25-2020, 09:39 PM
Last Post: Winfried
  help for escape sequences NewPi 1 2,768 Dec-11-2019, 11:22 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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