0

Let's consider 3 situations:

1) I write a pyhon module in Eclipse (pydev) and run it Ctrl-F11. The module runs and I don't have any control or access (AFAIK) to the module variables and functions.

2) I have defined a python interpreter as an external tool in Eclipse, so I can run it within Eclipse. It works fine, but it does not have tab completion.

3) I open my module with python IDLE (not eclipse) and press f5 (run). It runs on the IDLE opened window and when it finishes I have all the variables and functions form the module to play with.

So I have 2 questions: a) how to enable, if possible, tab completion in python interpreter in Eclipse? If it's not possible, do I have any alternative to standard Python interpreter?

b) I would like to run step 1) and then be able to continue developing / testing with python interpreter, just like I do with IDLE, but all inside Eclipse. Any suggestion?

Thanks in advance

4

2 に答える 2

1

質問がされてからどれだけ変更されたかはわかりませんが、デバッグコンソールでコード補完を取得できるようになりました(http://pydev.org/manual_adv_debug_console.htmlによると、PyDev 1.6.0の時点で、私はPyDevを使用しています2.8.1、エクリプス 4.3.0)

  • コード内の実行可能なステートメント (print('')またはだけでもTrue) にブレークポイントを設定します。コードの左側にある灰色の垂直バーをダブルクリックすると、それが実行されます。
  • F11 でデバッグモードで実行
  • Eclipse は、デバッグ パースペクティブに切り替えるように求める場合があります。いずれにせよ、コンソールが表示されるはずです
  • これで、トレースバック後でも、コンソール ペインをクリックして、コード補完で対話型デバッグを開始できるはずです。(Ctrl + スペースは私にとってはうまくいきます。)

:またはで分割しない限り、複数行のステートメントは機能しないことに注意してください/

1.6.0 で更新: 行が「 」または「/t」で始まるか、「:」または「/」で終わる場合を除き、コマンドは新しい行ごとに評価されます (したがって、複数行のステートメントを入力するには、入力を入力する必要があります)。これらの制限を適切に尊重します)。

于 2013-08-08T05:59:36.300 に答える
0

Eclipseでデバッグ操作として実行すると、ブレークポイントを設定できるはずです。その後、変数などを調べることができます。ただし、監視機能を使用してランダムなPythonスクリプトを評価できます。

于 2010-04-14T20:24:20.950 に答える