Python Forum
how to test if an object came from os.walk()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to test if an object came from os.walk()
#4
so, i'd have to get the generator to yield one or more results and see if they look OK. maybe just one, so i can still modify it if i need to. then i would look to see if i get a 3-tuple with (string,list,list). the simplest way to do this is probably apply that check each time and raise TypeError if it is not.

i am writing a generator to fully flatten the tree. i have many use cases for flat trees. i will probably have a number of callbacks to apply caller tests (i hope a generator lets me do that).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
RE: how to test if an object came from os.walk() - by Skaperen - Jan-10-2018, 03:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Smile Python & MSGraph - Learning to Walk ITMan020324 2 435 Feb-04-2024, 04:37 PM
Last Post: ITMan020324
  EasySNMP Walk/BulkWalk pylance 3 2,114 Nov-29-2021, 12:00 PM
Last Post: pylance
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 3,192 Jul-03-2021, 10:07 AM
Last Post: Anldra12
  How to sort os.walk list? Denial 6 11,652 Oct-10-2020, 05:28 AM
Last Post: Denial
  os.walk question DPaul 2 2,358 May-31-2020, 02:08 PM
Last Post: DPaul
  os.walk(Path("path_string")) giving error Kumarkv 4 3,901 May-10-2020, 08:46 AM
Last Post: snippsat
  How to write test cases for a init function by Unit test in python? binhduonggttn 2 3,149 Feb-24-2020, 12:06 PM
Last Post: Larz60+
  How to write test cases by Unit test for database configuration file? binhduonggttn 0 2,579 Feb-18-2020, 08:03 AM
Last Post: binhduonggttn
  os.walk does not see files that are in the folder kiton 1 3,051 Jan-21-2020, 07:26 PM
Last Post: micseydel
  print notifcation when enter new directory os.walk() evilcode1 3 2,640 Jun-20-2019, 08:19 PM
Last Post: evilcode1

Forum Jump:

User Panel Messages

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