假设我有一本字典:
d = {3: 'three', 2: 'two', 1: 'one'}
Run Code Online (Sandbox Code Playgroud)
我想重新排列此字典的顺序,以便该字典为:
d = {1: 'one', 2: 'two', 3: 'three'}
Run Code Online (Sandbox Code Playgroud)
我在想类似reverse()列表功能的东西,但是没有用。预先感谢您的回答!
我正在尝试使用Kivy虚拟机上的Buildozer将简单的Python程序构建为APK。每次跑步buildozer android debug,都会出现以下错误
pid 2134:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/usr/local/lib/python2.7/dist-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_127:
RAN: /home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform /build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/kivy/Desktop/Projects/Kivy_Test/.buildozer/android/platform/build /build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, …Run Code Online (Sandbox Code Playgroud)