我试图在没有 def 的情况下做到这一点,这是我真的不知道该怎么做的代码我也试图正确地给出缩进
但是当我运行它时,它会抛出错误无效语法
import ray
ray.init()
@ray.remote
try:
Func1()
except:
pass
ray.get([func1.remote()])
def func1():
for i in range (99999):
print("h")```
The error is invalid syntax at try:
This is the code that worked for me
try:
do_something()
except:
pass