小编Kyl*_*Ace的帖子

Android 11 不会在外部存储上创建应用程序目录

最近,我将智能手机更新到了 Android 11,我注意到我的一个应用程序在创建外部存储目录时崩溃了。我已阅读 Android 11 文档,现在是Starting in Android 11, apps cannot create their own app-specific directory on external storage. 很奇怪,因为当我打开 Android/data 目录时,有很多应用程序文件夹,所以有可能这样做,或者可能有应用程序在更新之前创建的文件夹?

storage android android-11

8
推荐指数
2
解决办法
1万
查看次数

从另一个函数调用函数并继续(不要等待完成)python

我读了很多关于多处理、线程的文章,但我仍然对简单的事情有疑问。我有2个功能。我想一个接一个地调用并移动一个(这个被调用的函数不能减慢我的速度)。

例子

def main():
    print("my operations")
    Thread(target=child(), args=()).start()
    print("rest operations")


def child():
    #here are some operations that takes 3 seconds
    print("background operations")
Run Code Online (Sandbox Code Playgroud)

关键是子函数的操作不能减慢我的速度。我想调用该函数并继续。所以我想要这样的输出:

my operations
rest operations
background operations
Run Code Online (Sandbox Code Playgroud)

但这样做Thread(target=child(), args=()).start()看起来像

my operations
Run Code Online (Sandbox Code Playgroud)
#then call child function wait 3 seconds
Run Code Online (Sandbox Code Playgroud)
background operations
rest operations
Run Code Online (Sandbox Code Playgroud)

有没有办法做我想做的事?

python background function multiprocessing

2
推荐指数
1
解决办法
2388
查看次数