Python Forum
os.listdir(path) and non-string as input
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
os.listdir(path) and non-string as input
#3
Hi Gribouillis,

Thank you so much for your input!

I see, thanks for the hint.
I thought I can just leave the other two out if I only want the "dir". OK.
Now I am here:

TypeError: listdir: path should be string, bytes, os.PathLike or None, not list

Similar error.

dirs is not a string. How can I convert it to a string?

I tried os.listdir(str(path)) but I think I need the absolute path...I think
Reply


Messages In This Thread
RE: os.listdir(path) and non-string as input - by metalray - Aug-14-2018, 03:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using string input for boolean tronic72 3 743 Nov-01-2023, 07:48 AM
Last Post: Gribouillis
Sad How to split a String from Text Input into 40 char chunks? lastyle 7 1,199 Aug-01-2023, 09:36 AM
Last Post: Pedroski55
  -i option changes sys.path (removes leading empty string '') markanth 6 2,033 Aug-26-2022, 09:27 PM
Last Post: markanth
Big Grin General programming question (input string)[ jamie_01 2 1,639 Jan-08-2022, 12:59 AM
Last Post: BashBedlam
  Convert string to path using Python 2.7 tester_V 10 6,556 Nov-20-2021, 02:20 PM
Last Post: snippsat
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,239 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Creating new column with a input string drunkenneo 2 2,286 Apr-14-2021, 08:10 AM
Last Post: drunkenneo
  Python win32api keybd_event: How do I input a string of characters? JaneTan 3 3,877 Oct-19-2020, 04:16 AM
Last Post: deanhystad
  listdir on IP Adress OEMS1 3 2,930 Jul-19-2020, 06:01 PM
Last Post: bowlofred
  String to File Path creedX 4 3,332 Apr-06-2020, 07:29 PM
Last Post: creedX

Forum Jump:

User Panel Messages

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