kbberendsen commited on
Commit
fb11f75
1 Parent(s): 5a53c9e

another change to the cache dir

Browse files
Files changed (1) hide show
  1. app.py +25 -10
app.py CHANGED
@@ -8,16 +8,31 @@ import numpy as np
8
  import os
9
  from pathlib import Path
10
 
11
- try:
12
- script_dir = os.path.dirname(os.path.abspath(__file__))
13
- print(script_dir)
14
- cache_folder = 'cache'
15
- #cache_dir = os.path.join(script_dir, cache_folder)
16
- cache_dir =Path(__file__).parent / "cache"
17
- print(cache_dir)
18
- ff1.Cache.enable_cache(cache_dir)
19
- except:
20
- print('Cache error!!')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  app_ui = ui.page_fluid(
23
  ui.div(
 
8
  import os
9
  from pathlib import Path
10
 
11
+ # Get the current directory
12
+ current_directory = Path.cwd()
13
+
14
+ # Specify the folder name you want to open (change 'folder_name' to your desired folder)
15
+ folder_name = 'cache'
16
+
17
+ # Create a Path object for the folder
18
+ folder_path = current_directory / folder_name
19
+
20
+ # Check if the folder exists
21
+ if folder_path.is_dir():
22
+ # Open the folder in the default file explorer of the operating system
23
+ os.startfile(str(folder_path))
24
+ else:
25
+ print(f"The folder '{folder_name}' does not exist in the current directory.")
26
+
27
+
28
+ script_dir = os.path.dirname(os.path.abspath(__file__))
29
+ print(script_dir)
30
+ cache_folder = 'cache'
31
+ #cache_dir = os.path.join(script_dir, cache_folder)
32
+ cache_dir = Path(__file__).parent / "cache"
33
+ print(cache_dir)
34
+ ff1.Cache.enable_cache(folder_path)
35
+
36
 
37
  app_ui = ui.page_fluid(
38
  ui.div(