{"id":17300,"date":"2022-07-06T19:54:51","date_gmt":"2022-07-06T10:54:51","guid":{"rendered":"https:\/\/www.ekbt.work\/?p=17300"},"modified":"2024-05-16T18:40:47","modified_gmt":"2024-05-16T09:40:47","slug":"ubuntu%e3%81%a7python","status":"publish","type":"post","link":"https:\/\/ekbt.info\/?p=17300","title":{"rendered":"Ubuntu\u3067Python"},"content":{"rendered":"<p>Ubuntu\u6a5f\u3001\u4ea4\u63db\u3057\u305fHDD\u3082\u9806\u8abf\u306b\u7a3c\u50cd\u3002\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3082\u7c97\u65b9\u7d42\u308f\u3063\u305f\u306e\u3067\u3001Windows\u5074\u3067\u3084\u3063\u3066\u3044\u305fpython\u3092Ubuntu\u6a5f\u306b\u79fb\u3057\u3066\u3084\u3063\u3066\u307f\u305f\u3002<\/p>\n<p>CUI\u30d9\u30fc\u30b9\u306e\u3084\u3064\u306f\u3001\u7c21\u5358\u306b\u52d5\u304f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17301 size-full\" src=\"https:\/\/www.ekbt.info\/wp-content\/uploads\/2022\/07\/Screenshot-from-2022-06-22-18-42-16.png\" alt=\"\" width=\"942\" height=\"624\" \/><br \/>\n\u3057\u304b\u3057\u3001\u30b0\u30e9\u30d5\u3092\u66f8\u304b\u305b\u308b\u3082\u306e\u306f\u3069\u3046\u3082\u30e9\u30a4\u30d6\u30e9\u30ea\u30fc\u304c\u306f\u3044\u3063\u3066\u3044\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001\u8ffd\u52a0\u3067\u3044\u308c\u305f\u3002<\/p>\n<p>~$ sudo apt install python3-matplotlib<\/p>\n<p>\u3059\u308b\u3068\u3001\u898b\u4e8b\u306bUbuntu\u6a5f\u3067\u3082python\u306e\u30c6\u30b9\u30c8\u304c\u52d5\u3044\u305f\u3002\u30b0\u30e9\u30d5\u3092\u66f8\u304fmatplotlib\u3082\u52d5\u304f\u3002<\/p>\n<p>\u2015\u2015\u2015\u3000\u30b3\u30fc\u30c9\u3000\uff0d\uff0d\uff0d<\/p>\n<p>import numpy as np<br \/>\nimport matplotlib.pyplot as plt<\/p>\n<p>x = np.arange(-5, 5, 0.1)<br \/>\ny = np.sin(x*2) + np.sin(x*11)\/5 + np.sin(x*21)\/8 + np.sin(x\/3)\/2 + np.sin(x*3)\/3 + np.sin(x*13)\/10<\/p>\n<p>plt.plot(x,y)<br \/>\nplt.show()<\/p>\n<p>\u2015\u2015\u2015\u3000\uff0d\uff0d\uff0d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17302 size-full\" src=\"https:\/\/www.ekbt.info\/wp-content\/uploads\/2022\/07\/python-ubuntu_2022-06-20_16-38-46.jpg\" alt=\"\" width=\"994\" height=\"842\" \/><\/p>\n<p>GUI\u3092\u8868\u793a\u3059\u308btkinter\u3082\u5165\u3063\u3066\u304d\u305f\u3082\u3088\u3046\u3002<\/p>\n<p>\u2015\u2015\u2015\u3000\u30b3\u30fc\u30c9\u3000\uff0d\uff0d\uff0d<\/p>\n<p>import tkinter as tk<br \/>\nimport tkinter.ttk as ttk<\/p>\n<p># root\u30e1\u30a4\u30f3\u30a6\u30a3\u30f3\u30c9\u30a6\u306e\u8a2d\u5b9a<br \/>\nroot = tk.Tk()<br \/>\nroot.title(&#8220;Frame&#8221;)<br \/>\nroot.geometry(&#8220;300&#215;200&#8221;)<\/p>\n<p>frame = tk.Frame(root, pady=10, padx=10)<br \/>\nframe.pack()<\/p>\n<p>label = tk.Label(frame, text=&#8217;\u3053\u308c\u306f\u30e9\u30d9\u30eb&#8217;)<br \/>\nentry = tk.Entry(frame)<br \/>\nbutton = tk.Button(frame, text=&#8217;\u3053\u308c\u306f\u30dc\u30bf\u30f3&#8217;)<\/p>\n<p>label.pack()<br \/>\nentry.pack()<br \/>\nbutton.pack()<\/p>\n<p>root.mainloop()<\/p>\n<p>\u2015\u2015\u2015\u3000\uff0d\uff0d\uff0d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-17303 size-full\" src=\"https:\/\/www.ekbt.info\/wp-content\/uploads\/2022\/07\/python-ubuntu_2022-06-20_16-42-37.jpg\" alt=\"\" width=\"994\" height=\"842\" \/><\/p>\n<p>\u3053\u308c\u306f\u3072\u3087\u3063\u3068\u3057\u3066\u3059\u3054\u3044\u3053\u3068\u3067\u306f\u3002??<br \/>\n\u3060\u3063\u3066Windows\u3067\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u304cUbuntu\u6a5f\uff08Linux\uff09\u3067\u3082\u52d5\u304f\u3002\u3055\u3089\u306b\u306f\u304a\u305d\u3089\u304fMac\u3067\u3082\u3002??<\/p>\n<p>#Ubuntu #Linux #Windows #Mac #Python #tkinter #matplotlib<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu\u6a5f\u3001\u4ea4\u63db\u3057\u305fHDD\u3082\u9806\u8abf\u306b\u7a3c\u50cd\u3002\u30c7\u30fc\u30bf\u306e\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3082\u7c97\u65b9\u7d42\u308f\u3063\u305f\u306e\u3067\u3001Windows\u5074\u3067\u3084\u3063\u3066\u3044\u305fpython\u3092Ubuntu\u6a5f\u306b\u79fb\u3057\u3066\u3084\u3063\u3066\u307f\u305f\u3002 CUI\u30d9\u30fc\u30b9\u306e\u3084\u3064\u306f\u3001\u7c21\u5358\u306b\u52d5\u304f\u3002 \u3057\u304b\u3057\u3001\u30b0\u30e9\u30d5\u3092\u66f8\u304b\u305b &hellip; <a href=\"https:\/\/ekbt.info\/?p=17300\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Ubuntu\u3067Python&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":18385,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[139,8],"tags":[98,99,288,7,9,102,154,11],"class_list":["post-17300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-python","tag-linux","tag-mac","tag-matplotlib","tag-python","tag-tkinter","tag-ubuntu","tag-ubuntu-22-04lts","tag-windows"],"_links":{"self":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts\/17300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17300"}],"version-history":[{"count":3,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts\/17300\/revisions"}],"predecessor-version":[{"id":18569,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/posts\/17300\/revisions\/18569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=\/wp\/v2\/media\/18385"}],"wp:attachment":[{"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekbt.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}