import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import Application, Form, Label form = Form(Text="フォームタイトル 日本語どうよ?") label = Label(Text="ラベルの文字列設定 日本語どうよ?") form.Controls.Add(label) Application.Run(form)
PythonプログラマがIronPythonを始める場合、.NET経験者なことはほとんどないと思うので簡単なサンプルを用意してみました。 データベースはMySqlとしました。ADO.NETのドライバーはここから。ADO.NETが初めての方は、アプリケーションとデータの仲介役 : DataAdapterを5分ほどご覧ください。(^^; import clr clr.AddReferenceByPartialName ('System.Data') clr.AddReferenceToFile ('MySql.Data.dll') from System.Data import * from MySql.Data.MySqlClient import * connstr = 'User Id=%s;Password=%s;Database=%s' % ('user', 'pass', 'db'
IronPythonとはPython言語の一実装である。その大きな特色の一つとして、.NET Framework上で動作する点がある。本稿では、このIronPythonについて簡単な紹介と、2007年4月に出たバージョン1.1の追加機能の紹介を行う。 IronPythonとは、どのようなものか? どんなことが可能なのか? 以下に列挙する。 1. スクリプト言語である C#やJava言語では、書いたソースコードを動かすためにコンパイルという作業が必要である。一方、IronPythonはスクリプト言語であるため、書いた端から逐次実行させることが可能である(内部では、IL言語に解釈されて実行されている)。 2. .NET Frameworkのライブラリを呼び出せる .NET Frameworkの大量のライブラリを、そのまま呼び出すことが可能である。他にも、COM(ActiveX)の呼び
先のネタで、IronPythonApiReference.chm があるよ。って紹介したのですが、これを元に、Visual Studio 2005でGUI(Windows Form)を作って、IronPythonで制御するやり方を調べてみました。 結論としては、非常に簡単に実現できます。 以前、Python + Delphiな P4D を使いましたが(もっと楽にGUIとの連携がしたい:Python + Delphi = P4D(Python for Delphi) )、IronPythonは、これと同じか それ以上に、Python + .NET な環境を提供してくれるようです。 という訳で、実際に、Visual Sutdio 2005でGUI(Windows Form)を作って、ボタンを押したら IronPython からGUI上の部品にアクセスするコードサンプルを作ってみます。 Visu
2006年9月、.NETで動作するPython「IronPython」が正式にリリースされました。.NET環境の本格的な動的言語として多くの注目を集めている反面、C#やVisual Basicを使っている開発者にとって、IronPythonの魅力が良くわからないという人もいるのではないでしょうか。そこで、本稿では、C#からIronPythonを利用するメリットとその方法について紹介します。 はじめに 2006年9月、.NETで動作するPython「IronPython」が正式にリリースされました。.NET環境の本格的な動的言語ということもあってIronPythonは多くの注目を集めました。その反面、C#やVisual Basicを使っている開発者にとって、IronPythonをどのような局面で使ってよいのかわからない人も少なくないと思います。また、IronPythonの魅力がわからない人も
IronPythonは、いわゆるCPythonと高い互換性を持っており、過去のCPythonの資産と.NET Frameworkの資産を両方から扱うことのできる、"糊"(glue)言語の一面を持っている。 しかし、全ての資産を扱えるわけではなく、例えばCPythonの資産で利用可能なのは、スクリプトのみで作成されたライブラリ(拡張子が.py)である。C言語で作成された拡張モジュールと呼ばれるライブラリ(拡張子が.pyd)は使用できない。 ところが先ごろユーザーコミュニティより、IronPythonからこれら拡張モジュールを扱えるライブラリが発表された。本稿では、この「CPython Extensions for IronPython」と呼ばれるライブラリの紹介と簡単な利用方法について、説明を行う。 CPython、IronPythonとライブラリの関係 CPython IronPython
はじめに こんばんは。「PowerShell Memo」管理人のnewpopsこと吉岡洋です。 この度、牟田口さんが企画された「PowerShell Advent Calendar 2011」に参加することになりました。 本イベントの12日目を務めさせていただきます。 今回紹介するのは「サーバールームの室温監視を行う」スクリプトです。 作成の経緯 今から3年前の夏、とあるサーバルームのエアコンの温度センサーの不正動作で「時々、設定温度通りに室温が下がらない」という事象に遭遇しました。この「時々」というのが曲者で、通常は22℃前後に保たれているのですが、週に1回程度、センサーが温度を正しく検知できずに、温度が上昇してしまうのです。 気づくのが遅れると、室温が30℃に上昇することもあるとのこと。夜に問題が起こると、朝まで気づかないので厄介ですね。 運用責任者の方いわく、エアコン業者が調査しても
Microsoft Learn. Spark possibility. Build skills that open doors. See all you can do with documentation, hands-on training, and certifications to help you get the most from Microsoft products. Learn by doing Gain the skills you can apply to everyday situations through hands-on training personalized to your needs, at your own pace or with our global network of learning partners. Take training Find
日本ではあまり知名度の高くないプログラミング言語だったPythonが、ここ最近、日本を含め、世界中で人気が高まってきている。その理由は、Python開発の手軽さ&簡単さという要因に加え、GoogleやYouTubeなど最先端IT企業が社内で一部活用していることが知られるようになってきたからだろう。 Pythonの代表的な特長をいくつか挙げてみよう。まず、Pythonは文法規則が簡潔なためコードが読みやすいということ。2つ目に、インタプリタ型のスクリプト言語であるため、煩わしいコンパイル作業が不要なこと。3つ目に、たいていのOSで動作するため、例えばLinuxでもWindowsでも同じ言語知識でプログラミングが可能なことなどだ。 Pythonは特に、ちょっとした身の回りの作業を効率化するためのパーソナルなプログラムや、社内で使う簡易なツール類を作成する場合に向いている。Windows上のほか
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く