LoginSignup
0
0

More than 3 years have passed since last update.

【初心者】phpで動作するプログラムをPythonで書くとどうなりますか?

Posted at

phpでLINE botを作成しました。チャットに入力された文字がデバッグとして該当txtに入力されるだけの仕組みです。

これをPythonで代替して作る場合のコードが分からず困っています。

以下はphpで実際に動作したコードになります。

<?php

//(1)ログファイルの指定
define('DEBUG','../debug.txt');

//(2)リクエストの取得
$input=file_get_contents('php://input');

//(3)ログファイルの出力
file_put_contents(DEBUG,$input):

これをPythonで代替するとどのようなコードになりますでしょうか?初歩的な事と理解出来ますが恥を承知でご教示頂ければと思います。
requestsを使うんだろうなぁ…というあたりまではつけれるのですが…

何卒よろしくお願いします。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0