abidlabs HF Staff commited on
Commit
af29b69
·
1 Parent(s): 6e3fda8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,13 +7,13 @@ def generate_random_string(length=100):
7
  """Generate a random string of fixed length."""
8
  return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(length))
9
 
10
- def create_random_text_files(directory, num_files=10, file_length=1000):
11
  """Create specified number of random text files with random content."""
12
  if not os.path.exists(directory):
13
  os.makedirs(directory)
14
 
15
  for i in range(num_files):
16
- file_name = os.path.join(directory="/data", f'random_file_{i}.txt')
17
  with open(file_name, 'w') as f:
18
  for _ in range(file_length):
19
  f.write(generate_random_string() + '\n')
 
7
  """Generate a random string of fixed length."""
8
  return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(length))
9
 
10
+ def create_random_text_files(directory="/data", num_files=10, file_length=1000):
11
  """Create specified number of random text files with random content."""
12
  if not os.path.exists(directory):
13
  os.makedirs(directory)
14
 
15
  for i in range(num_files):
16
+ file_name = os.path.join(directory, f'random_file_{i}.txt')
17
  with open(file_name, 'w') as f:
18
  for _ in range(file_length):
19
  f.write(generate_random_string() + '\n')