{"id":18851,"date":"2022-03-01T16:55:07","date_gmt":"2022-03-01T08:55:07","guid":{"rendered":"https:\/\/hongtronics.com\/?p=18851"},"modified":"2023-04-06T13:08:45","modified_gmt":"2023-04-06T05:08:45","slug":"recpi-python","status":"publish","type":"post","link":"https:\/\/hongtronics.com\/en\/recpi-python\/","title":{"rendered":"\u3010\u5de5\u696d\u6a39\u8393\u6d3e\u3011\u5982\u4f55\u4f7f\u7528 Python\u7de8\u7a0b"},"content":{"rendered":"<p class=\"has-normal-font-size\">\u5de5\u696d\u7d1a\u6a39\u8393\u6d3e\u53ef\u505a\u70ba\u5de5\u63a7\u6a5f\u4f7f\u7528\uff0c\u578b\u865f\u548c\u529f\u80fd\u9f4a\u5168\uff0c\u9664\u63a7\u5236\u5668\u6838\u5fc3\u5916\uff0c\u9084\u5305\u62ec\u5404\u985e\u5de5\u696d\u5354\u5b9a\u7db2\u95dc\u4ee5\u53caIO\u64f4\u5c55\u6a21\u584a\u7b49\u3002<\/p>\n\n\n\n<p class=\"has-normal-font-size\">\u5de5\u696d\u7d1a\u6a39\u8393\u6d3e\u5177\u6709\u9ad8\u5ea6\u5de5\u696d\u9069\u7528\u6027\uff0c\u5de5\u4f5c\u6eab\u5ea6\u7bc4\u570d\u9054\u5230-40 ~55 \u00b0C&nbsp;\uff0c\u975c\u96fb\u4fdd\u8b77\u9054\u52304 kV \/ 8 kV&nbsp;\uff0c\u4e14\u6d6a\u6e67\/\u7206\u88c2\u6e2c\u8a66\u4ee5\u53caEMI\u6e2c\u8a66\u90fd\u9054\u5230\u4e86EN61131-2\u548cIEC 61000-6-2\u6a19\u6e96\u7684\u8981\u6c42\u3002\u652f\u63f4Node-RED\u3001Python\u3001\u6216\u7d14C\u7b49\u591a\u7a2e\u7de8\u7a0b\u8a9e\u8a00\uff1b\u652f\u63f4\u901a\u7528\u7684\u5de5\u696d\u7269\u806f\u7db2\uff08IIoT&nbsp;\uff09\u5354\u8b70\uff0c\u5982MQTT\u548cOPC UA\uff1b\u542b\u5169\u500b\u4ee5\u592a\u7db2\u63a5\u53e3\uff0c\u5176\u4e2d\u4e00\u500b\u53ef\u4ee5\u900f\u904eModbus TCP\u5354\u8b70\u9023\u63a5\u5de5\u696d\u73fe\u5834\u7db2\u8def\uff0c\u53e6\u4e00\u500b\u53ef\u4ee5\u9023\u63a5\u4e0a\u7d1a\u7684IT\u7cfb\u7d71\u6216\u662f\u96f2\u7aef\u670d\u52d9\u5668\u3002&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"has-normal-font-size\">\u672c\u6587\u4ee5RevPi Core\u70ba\u4f8b\uff0c\u5206\u4eab\u5982\u4f55\u4f7f\u7528\u5de5\u696d\u6a39\u8393\u6d3e\u9032\u884cPython \u7de8\u7a0b: <\/p>\n\n\n\n<h2 class=\"has-luminous-vivid-amber-background-color has-background wp-block-heading\">Python\u7de8\u7a0b<\/h2>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u9996\u5148\u767b\u9304\u5230RevPi Core\u3002<\/li><li>\u5728\u547d\u4ee4\u884c\u8f38\u5165\u300epython\u300f\u547d\u4ee4\uff0c\u5c31\u9032\u5165\u4e86Python Shell\u754c\u9762\u3002<\/li><\/ul>\n\n\n\n<p class=\"has-normal-font-size\">\u5728\u986f\u793a\u7684\u8a0a\u606f\u4e2d\u53ef\u4ee5\u770b\u5230\u7576\u524d\u4f7f\u7528\u7684Python\u7248\u672c\uff0c\u9700\u8981\u660e\u78ba\u7576\u524d\u4f7f\u7528\u7684\u662fPython2\u9084\u662fPython3\u3002\u4f8b\u5982\u4e0b\u5716\u4e2d\u986f\u793a\u4f7f\u7528\u7684\u70baPython 2.7.9\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"665\" height=\"119\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-12.png\" alt=\"\" class=\"wp-image-18852\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-12.png 665w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-12-300x54.png 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-12-600x107.png 600w\" sizes=\"(max-width: 665px) 100vw, 665px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-normal-font-size\">\u7576\u60f3\u8981\u9000\u51faPython Shell\u754c\u9762\u6642\uff0c\u53ef\u4ee5\u6309Ctrl+D\u9000\u51fa\u6216\u8005\u5728Python Shell\u754c\u9762\u8f38\u5165exit\uff08\uff09\u3002<\/p>\n\n\n\n<p class=\"has-normal-font-size\">\u4e0b\u9762\u4ee5Hello World\uff01\u7a0b\u5e8f\u8209\u4f8b\u4ecb\u7d39\u3002<\/p>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u8f38\u5165\u300enano helloworld.py\u300f\u547d\u4ee4\uff0c\u4f7f\u7528nano\u7de8\u8f2f\u5668\u65b0\u5efa\u4e00\u500b\u540d\u70bahelloworld.py\u7684\u6587\u4ef6\u3002<\/li><li>\u5728nano\u7de8\u8f2f\u5668\u88e1\u8f38\u5165\u300eprint \u201cHello World!\u201d\u300f\u8a9e\u53e5\u3002<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-13.png\" alt=\"\" class=\"wp-image-18853\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-13.png 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-13-300x188.png 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-13-600x377.png 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u6309Ctrl+x\u4f86\u4fdd\u5b58\u6587\u4ef6\u4e26\u9000\u51fanano\u7de8\u8f2f\u5668\u3002<\/li><\/ul>\n\n\n\n<p class=\"has-normal-font-size\">\u4f7f\u7528ls\u547d\u4ee4\u53ef\u4ee5\u770b\u5230\u65b0\u5efa\u7684helloworld.py\u6587\u4ef6\u3002\u7576\u4f7f\u7528ls \u2013l\u6216\u8005ll\u547d\u4ee4\u67e5\u770b\u6642\uff0c\u767c\u73fe\u5b83\u9084\u4e0d\u662f\u4e00\u500b\u53ef\u57f7\u884c\u6587\u4ef6\u3002\u9019\u6642\u5982\u679c\u8f38\u5165\u57f7\u884c\u547d\u4ee4\uff0c\u6703\u986f\u793a\u201cPermission denied\u201d\u5831\u932f\u8a0a\u606f\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-34.jpg\" alt=\"\" class=\"wp-image-18854\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-34.jpg 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-34-300x188.jpg 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-34-600x377.jpg 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-normal-font-size\">\u63a5\u4e0b\u4f86\u6211\u5011\u9700\u8981\u8b93\u6587\u4ef6\u8b8a\u6210\u53ef\u57f7\u884c\u6587\u4ef6\u3002<\/p>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u8f38\u5165\u300echmod +x helloworld.py\u300f\u547d\u4ee4\u3002<\/li><\/ul>\n\n\n\n<p class=\"has-normal-font-size\">\u518d\u6b21\u4f7f\u7528ls \u2013l\u547d\u4ee4\u67e5\u770b\u6642\u767c\u73fe\u6587\u4ef6\u8b8a\u70ba\u53ef\u57f7\u884c\u6587\u4ef6\u4e86\u3002\u7136\u5f8c\u8f38\u5165\u300e.\/helloworld.py\u300f\u57f7\u884c\u6587\u4ef6\u3002\u7cfb\u7d71\u9084\u662f\u986f\u793a\u4e86\u932f\u8aa4\u8a0a\u606f\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-35.jpg\" alt=\"\" class=\"wp-image-18855\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-35.jpg 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-35-300x188.jpg 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-35-600x377.jpg 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<p class=\"has-normal-font-size\">\u7531\u65bcPython\u662f\u4e00\u7a2e\u89e3\u91cb\u5668\u8a9e\u8a00\uff0c\u6211\u5011\u5fc5\u9808\u6307\u5b9a\u7a0b\u5e8f\u61c9\u8a72\u4f7f\u7528\u54ea\u500b\u89e3\u91cb\u5668\u3002\u4f7f\u7528\u300ewhichpython\u300f\u547d\u4ee4\u53ef\u4ee5\u627e\u5230 python\u89e3\u91cb\u5668\u6240\u5728\u7684\u4f4d\u7f6e\u70ba\/usr\/bin\/python\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-36.jpg\" alt=\"\" class=\"wp-image-18856\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-36.jpg 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-36-300x188.jpg 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-36-600x377.jpg 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u518d\u6b21\u8f38\u5165\u201cnano helloworld.py\u201d\u547d\u4ee4\u6253\u958bnano\u7de8\u8f2f\u5668\u3002<\/li><li>\u5728\u9996\u884c\u8f38\u5165Shebang\u7b26\u865f#!+\/usr\/bin\/python\u6307\u660e\u4f7f\u7528\u7684\u89e3\u91cb\u5668\u3002<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-37.jpg\" alt=\"\" class=\"wp-image-18857\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-37.jpg 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-37-300x188.jpg 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-37-600x377.jpg 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"has-normal-font-size wp-block-list\"><li>\u6309Ctrl+x\u4fdd\u5b58\u4e26\u9000\u51fa\u3002<\/li><li>\u518d\u6b21\u8f38\u5165\u201c.\/helloworld.py\u201d\u547d\u4ee4\u5c31\u53ef\u4ee5\u57f7\u884c\u6587\u4ef6\uff0c\u5728\u8996\u7a97\u4e0a\u8f38\u51faHello World!\u3002<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"424\" src=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-38.jpg\" alt=\"\" class=\"wp-image-18858\" srcset=\"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-38.jpg 675w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-38-300x188.jpg 300w, https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/640-38-600x377.jpg 600w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/figure><\/div>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"has-text-align-center wp-block-heading\"> <a href=\"https:\/\/hongtronics.com\/en\/category\/revpi-case-study\/\" title=\"\u3010\u66f4\u591a\u5de5\u696d\u6a39\u8393\u6d3e\u6848\u4f8b\u6587\u7ae0\u3011\">\u3010\u66f4\u591a\u5de5\u696d\u6a39\u8393\u6d3e\u6848\u4f8b\u6587\u7ae0\u3011<\/a> <\/h2>","protected":false},"excerpt":{"rendered":"<p>\u5de5\u696d\u7d1a\u6a39\u8393\u6d3e\u53ef\u505a\u70ba\u5de5\u63a7\u6a5f\u4f7f\u7528\uff0c\u578b\u865f\u548c\u529f\u80fd\u9f4a\u5168\uff0c\u9664\u63a7\u5236\u5668\u6838\u5fc3\u5916\uff0c\u9084\u5305\u62ec\u5404\u985e\u5de5\u696d\u5354\u5b9a\u7db2\u95dc\u4ee5\u53caIO\u64f4\u5c55\u6a21\u584a\u7b49\u3002 \u5de5\u696d [&hellip;]<\/p>","protected":false},"author":29,"featured_media":18860,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"minimal","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","iawp_total_views":76,"ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[1824],"tags":[1339],"table_tags":[],"class_list":["post-18851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iiot","tag-1339","entry","has-media","owp-thumbs-layout-horizontal","owp-btn-normal","owp-tabs-layout-horizontal","has-no-thumbnails","has-product-nav"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/hongtronics.com\/wp-content\/uploads\/2022\/03\/\u5408\u8f2f5.png","_links":{"self":[{"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/posts\/18851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/comments?post=18851"}],"version-history":[{"count":4,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/posts\/18851\/revisions"}],"predecessor-version":[{"id":18999,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/posts\/18851\/revisions\/18999"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/media\/18860"}],"wp:attachment":[{"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/media?parent=18851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/categories?post=18851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/tags?post=18851"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/hongtronics.com\/en\/wp-json\/wp\/v2\/table_tags?post=18851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}