Python Forum
[split] Single slash syntax in file path
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Single slash syntax in file path
#2
Your code is without indentation.
This is wrong,escape character will give errror.
s="C:\Users\alex.ogata\Desktop\test001"
For file path in Windows always use:
>>> s = r"C:\Users\alex.ogata\Desktop\test001"
>>> s
'C:\\Users\\alex.ogata\\Desktop\\test001'
>>> # or 
>>> s = "C:/Users/alex.ogata/Desktop/test001"
>>> s
'C:/Users/alex.ogata/Desktop/test001'
>>> # or 
>>> s = "C:\\Users\\alex.ogata\\Desktop\\test001"
>>> s
'C:\\Users\\alex.ogata\\Desktop\\test001'
Reply


Messages In This Thread
RE: [split] Single slash syntax in file path - by snippsat - Aug-09-2017, 02:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to "tee" (=split) output to screen and into file? pstein 6 1,488 Jun-24-2023, 08:00 AM
Last Post: Gribouillis
  File path by adding various variables Mishal0488 2 1,114 Apr-28-2023, 07:17 PM
Last Post: deanhystad
  Split pdf in pypdf based upon file regex standenman 1 2,183 Feb-03-2023, 12:01 PM
Last Post: SpongeB0B
  Script File Failure-Path Error? jerryf 13 3,593 Nov-30-2022, 09:58 AM
Last Post: jerryf
  python Multithreading on single file mg24 3 1,821 Nov-05-2022, 01:33 PM
Last Post: snippsat
  Create multiple/single csv file for each sql records mg24 6 1,493 Sep-29-2022, 08:06 AM
Last Post: buran
  How to split the input taken from user into a single character? mHosseinDS86 3 1,239 Aug-17-2022, 12:43 PM
Last Post: Pedroski55
  change backslash into slash in a path paul18fr 7 2,554 Jul-21-2022, 04:26 PM
Last Post: deanhystad
  How to split file by same values from column from imported CSV file? Paqqno 5 2,885 Mar-24-2022, 05:25 PM
Last Post: Paqqno
  [split] Results of this program in an excel file eisamabodian 1 1,625 Feb-11-2022, 03:18 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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