0.1.136
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| [metadata] | [metadata] | ||||||
| # replace with your username: | # replace with your username: | ||||||
| name = guan | name = guan | ||||||
| version = 0.1.135 | version = 0.1.136 | ||||||
| author = guanjihuan | author = guanjihuan | ||||||
| author_email = guanjihuan@163.com | author_email = guanjihuan@163.com | ||||||
| description = An open source python package | description = An open source python package | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| Metadata-Version: 2.1 | Metadata-Version: 2.1 | ||||||
| Name: guan | Name: guan | ||||||
| Version: 0.1.135 | Version: 0.1.136 | ||||||
| Summary: An open source python package | Summary: An open source python package | ||||||
| Home-page: https://py.guanjihuan.com | Home-page: https://py.guanjihuan.com | ||||||
| Author: guanjihuan | Author: guanjihuan | ||||||
|   | |||||||
| @@ -73,13 +73,13 @@ def run(function_name, *args, **kwargs): | |||||||
|     import time |     import time | ||||||
|     import guan |     import guan | ||||||
|     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: |     with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as client_socket: | ||||||
|         client_socket.connect(('socket.guanjihuan.com', 12345)) |         client_socket.connect(('run.guanjihuan.com', 12345)) | ||||||
|         function_source = guan.get_source(function_name) |         function_source = guan.get_source(function_name) | ||||||
|         split_text_list = guan.split_text(function_source, width=100) |         split_text_list = guan.split_text(function_source, width=100) | ||||||
|         message_times = len(split_text_list) |         message_times = len(split_text_list) | ||||||
|         if message_times == 1 or message_times == 0: |         if message_times == 1 or message_times == 0: | ||||||
|             message = { |             message = { | ||||||
|                 'server': "run", |                 'server': "run.guanjihuan.com", | ||||||
|                 'function_name': function_name.__name__, |                 'function_name': function_name.__name__, | ||||||
|                 'function_source': function_source, |                 'function_source': function_source, | ||||||
|                 'args': str(args), |                 'args': str(args), | ||||||
| @@ -104,6 +104,7 @@ def run(function_name, *args, **kwargs): | |||||||
|                 send_message = json.dumps(message) |                 send_message = json.dumps(message) | ||||||
|                 client_socket.send(send_message.encode()) |                 client_socket.send(send_message.encode()) | ||||||
|                 time.sleep(0.15) |                 time.sleep(0.15) | ||||||
|  |         print('\nguan.run: 云端服务器正在计算,请等待返回结果。\n') | ||||||
|         return_data = '' |         return_data = '' | ||||||
|         print_data = '' |         print_data = '' | ||||||
|         while True: |         while True: | ||||||
| @@ -122,6 +123,9 @@ def run(function_name, *args, **kwargs): | |||||||
|             print('--- Start Print ---\n') |             print('--- Start Print ---\n') | ||||||
|             print(print_data) |             print(print_data) | ||||||
|             print('--- End Print ---\n') |             print('--- End Print ---\n') | ||||||
|  |             print('guan.run: 云端服务器计算结束,以上是打印结果。\n') | ||||||
|  |         else: | ||||||
|  |             print('guan.run: 云端服务器计算结束。\n') | ||||||
|         return_data = pickle.loads(base64.b64decode(return_data)) |         return_data = pickle.loads(base64.b64decode(return_data)) | ||||||
|         client_socket.close() |         client_socket.close() | ||||||
|     return return_data |     return return_data | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user