{"id":957,"date":"2021-07-09T08:03:01","date_gmt":"2021-07-09T08:03:01","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=957"},"modified":"2021-07-09T08:03:02","modified_gmt":"2021-07-09T08:03:02","slug":"modul-shelve","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/modul-shelve\/","title":{"rendered":"\u041c\u043e\u0434\u0443\u043b\u044c shelve"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 Python \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c &#8211;&nbsp;<strong>shelve<\/strong>. \u041e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u043e\u043c. \u0417\u0430\u0442\u0435\u043c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c shelve \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043b\u044e\u0447\u0438 \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0434\u0443\u043b\u044c shelve \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e&nbsp;<strong>open()<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>open<\/code><code>(\u043f\u0443\u0442\u044c_\u043a_\u0444\u0430\u0439\u043b\u0443[, flag<\/code><code>=<\/code><code>\"c\"<\/code><code>[, protocol<\/code><code>=<\/code><code>None<\/code><code>[, writeback<\/code><code>=<\/code><code>False<\/code><code>]]])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0413\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 flag \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>c<\/strong>: \u0444\u0430\u0439\u043b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e). \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f.<\/li><li><strong>r<\/strong>: \u0444\u0430\u0439\u043b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f.<\/li><li><strong>w<\/strong>: \u0444\u0430\u0439\u043b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438.<\/li><li><strong>n<\/strong>: \u0444\u0430\u0439\u043b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f. \u0415\u0441\u043b\u0438 \u043e\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u043e\u043d \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0444\u0430\u0439\u043b\u0443 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>close()<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>import<\/code> <code>shelved =<\/code> <code>shelve.open(filename)<\/code><br><br><code>d.close()<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041b\u0438\u0431\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430&nbsp;<strong>with<\/strong>. \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432 \u0444\u0430\u0439\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<\/td><td><code>import<\/code> <code>shelve<\/code><br><br>\u00a0<code>FILENAME =<\/code> <code>\"states2\"<\/code><br><br><code>with shelve.open(FILENAME) as states:<\/code><br><code>states[\"London\"] =<\/code> <code>\"Great Britain\"<\/code><br><code>states[\"Paris\"] =<\/code> <code>\"France\"<\/code><br><code>states[\"Berlin\"] =<\/code> <code>\"Germany\"<\/code><br><code>states[\"Madrid\"] =<\/code> <code>\"Spain\"<\/code>\u00a0<br><code>with shelve.open(FILENAME) as states:<\/code><br><code>print(states[\"London\"])<\/code><br><code>print(states[\"Madrid\"])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>states[<\/code><code>\"London\"<\/code><code>] <\/code><code>=<\/code> <code>\"Great Britain\"<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0410 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>print<\/code><code>(states[<\/code><code>\"London\"<\/code><code>])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0435\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0438 \u0447\u0442\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u043a\u043b\u044e\u0447 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430&nbsp;<strong>in<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br><code>key =<\/code> <code>\"Brussels\"<\/code><br><code>if<\/code> <code>key in<\/code> <code>states:<\/code><br><code>print(states[key])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>get()<\/strong>. \u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 &#8211; \u043a\u043b\u044e\u0447, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8211; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br><code>state =<\/code> <code>states.get(\"Brussels\", \"Undefined\")<\/code><br><code>print(state)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0446\u0438\u043a\u043b for, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br><code>for<\/code> <code>key in<\/code> <code>states:<\/code><br><code>print(key,\" - \", states[key])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434&nbsp;<strong>keys()<\/strong>&nbsp;\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430, \u0430 \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>values()<\/strong>&nbsp;&#8211; \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<\/td><td><code>with shelve.open(FILENAME) as states:<\/code>\u00a0<br><code>for<\/code> <code>city in<\/code> <code>states.keys():<\/code><br><code>print(city, end=\" \")\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # London Paris Berlin Madrid <\/code><br><code>print()<\/code><br><code>for<\/code> <code>country in<\/code> <code>states.values():<\/code><br><code>print(country, end=\" \")\u00a0\u00a0\u00a0\u00a0<\/code><br><code> # Great Britain France Germany Spain<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>items()<\/strong>&nbsp;\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u0440\u0442\u0435\u0436 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043b\u044e\u0447 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br>\u00a0<code>for<\/code> <code>state in<\/code> <code>states.items():<\/code><br><br><code>print(state)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">(\"London\", \"Great Britain\")\n(\"Paris\", \"France\")\n(\"Berlin\", \"Germany\")\n(\"Madrid\", \"Spain\")\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 &#8211; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u044e\u0447:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<\/td><td><code>import<\/code> <code>shelve<\/code>\u00a0<br><br><code>FILENAME =<\/code> <code>\"states2\"<\/code><br><br><code>with shelve.open(FILENAME) as states:<\/code><br><code>states[\"London\"] =<\/code> <code>\"Great Britain\"<\/code><br><code>states[\"Paris\"] =<\/code> <code>\"France\"<\/code><br><code>states[\"Berlin\"] =<\/code> <code>\"Germany\"<\/code><br><code>states[\"Madrid\"] =<\/code> <code>\"Spain\"<\/code>\u00a0<br><code>with shelve.open(FILENAME) as states:<\/code>\u00a0<br><code>states[\"London\"] =<\/code> <code>\"United Kingdom\"<\/code><br><code>states[\"Brussels\"] =<\/code> <code>\"Belgium\"<\/code><br><br><code>for<\/code> <code>key in<\/code> <code>states:<\/code><br><code>print(key, \" - \", states[key])<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e&nbsp;<strong>pop()<\/strong>, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043a\u043b\u044e\u0447 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>34<br><\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br><br>\u00a0<code>state =<\/code> <code>states.pop(\"London\", \"NotFound\")<\/code><br><code>print(state)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440&nbsp;<strong>del<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br>\u00a0<code>del<\/code> <code>states[\"Madrid\"]\u00a0\u00a0<\/code><br><code>\u00a0 # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043a\u043b\u044e\u0447\u043e\u043c Madrid<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434&nbsp;<strong>clear()<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<br>2<br>3<\/td><td><code>with shelve.open(FILENAME) as states:<\/code><br><br>\u00a0<code>states.clear()<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0432 Python \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c &#8211;&nbsp;shelve. \u041e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0444\u0430\u0439\u043b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[76],"tags":[],"class_list":["post-957","page","type-page","status-publish","hentry","category-rukovodstvo-po-yazyku-programmirovaniya-python"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=957"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/957\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}