pythonfutures.

تنفيذ العقود الآجلة لبيتثون
التحميل الان

pythonfutures. الترتيب والملخص

الإعلانات

  • Rating:
  • رخصة:
  • BSD License
  • السعر:
  • FREE
  • اسم الناشر:
  • Alex Gronholm
  • موقع ويب الناشر:
  • http://code.google.com/u/105081597892033910559/

pythonfutures. العلامات


pythonfutures. وصف

Pythonfuutures عبارة عن حزمة من العقود الآجلة على طراز Java ل Python.This Package موضحة في PEP-3148 وهي مدرجة في Python 3.2.See وثائق Python لوصف كامل. Sample Sample (Python 2.6) استيراد Futuresimport Urllib2urls = ['http: // www.foxnews.com/ '،' http://www.cnn.com/ '،' http://europe.wsj.com/ '،' http://www.bbbc.co.uk/ '،' http://some-made-Up-domain.com/'cldef load_url (url، مهلة): ارجع orllib2.urlopen (url، مهلة = مهلة) .Read () مع futures.threadpoolexecutor (max_workers = 5) كمنفذ : Futuree_to_url = DICT ((Executor.submit (load_url، url، 60)، URL) لعنوان URL في عناوين URL) للمستقبل في المستقبل .AS_Completed (Future_to_url): URL = Future_to_Url [Future.exception () ليس بلا: طباعة ' R تم إنشاء استثناء: s' (URL، Future.exception ()) آخر: طباعة " R الصفحة هي D بايت ' (URL، LEN (Future.Result.Result ()))


pythonfutures. برامج ذات صلة