JSONArray jsonarray = jsonObj.getJSONArray("data");
for (int i = 0; i < jsonarray.length(); i++) {
JSONObject innerJsonObject= jsonarray.getJSONObject(i);
String skills = innerJsonObject.getString("skills");
String platforms = innerJsonObject.getString("platforms");
}
代码如上所示,输出如下:
from concurrent.futures import ProcessPoolExecutor
import threading
import os
def task():
print('Task: in thread', threading.current_thread())
print('Task: in process', os.getpid())
def taskDone(fn):
print('Callback: in thread', threading.current_thread())
print('Callback: in process', os.getpid())
def main():
print('Main: in thread', threading.current_thread())
print('Main: in process', os.getpid())
with ProcessPoolExecutor(max_workers=3) as executor:
future = executor.submit(task)
future.add_done_callback(taskDone)
if __name__ == '__main__':
main()
问题:
欢迎对这两个问题中的任何一个问题进行回答和讨论。