Browse Source

0609 PathUpdate

rita 2 years ago
parent
commit
57dcd2e858
1 changed files with 8 additions and 1 deletions
  1. 8 1
      manage.py

+ 8 - 1
manage.py

@@ -409,7 +409,14 @@ def add_server_views():
         # # print("D['command']: ", D['command'])
         # sl(3)
         # shutil.rmtree('C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/newSH', onerror=remove_readonly)
-        with open('C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/Item.txt') as f:
+        # with open('C:/Users/USER/Rita/operating/sixthproject/BBend-Test-JWT/Item.txt') as f:
+        #     D['item_name'] = f.read().split('\n')
+        #     for item in D['item_name']:
+        #         # L.append('.'.join(item.split('.')[1:]))         # 拿掉 '.'.join 的話會變成 [['python3', '8'], ['python3-pip'],
+        #         L.append(item)
+        current_path = os.path.dirname(__file__)
+        # print("current_path: ", current_path)
+        with open(current_path + '/Item.txt') as f:
             D['item_name'] = f.read().split('\n')
             for item in D['item_name']:
                 # L.append('.'.join(item.split('.')[1:]))         # 拿掉 '.'.join 的話會變成 [['python3', '8'], ['python3-pip'],