Author Topic: Python tester  (Read 2204 times)

0 Members and 1 Guest are viewing this topic.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Python tester
« on: April 30, 2014, 01:21:11 PM »
Not sure what to call it, but the python tester part of the PY plugin
http://voxcommando.com/mediawiki/index.php?title=Python


This is cool in app quick tester. I know its not meant to be an IDE, but w/ python being case/indent sensitive, can the tab key but used in there to indent versus change object focus?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Python tester
« Reply #1 on: April 30, 2014, 01:53:10 PM »
Perhaps in a future version.  For now I recommend you actually do your editing using notepad++.

I also recommend that you never, ever, EVER use actual tabs when writing python code.  You should only indent your code using spaces.  

Notepad++ can be set up so that when you press tab it inserts spaces instead, which is what I will do in the plugin if I ever get around to it.

vulcanjedi

  • $upporter
  • Sr. Member
  • *****
  • Posts: 213
  • Karma: 8
    • View Profile
Re: Python tester
« Reply #2 on: April 30, 2014, 03:04:00 PM »
Interesting, haven't encountered re spaces vs tab. I will make note, thanks!

Perhaps in a future version.  For now I recommend you actually do your editing using notepad++.

I also recommend that you never, ever, EVER use actual tabs when writing python code.  You should only indent your code using spaces.  

Notepad++ can be set up so that when you press tab it inserts spaces instead, which is what I will do in the plugin if I ever get around to it.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Python tester
« Reply #3 on: April 30, 2014, 03:41:47 PM »
It is actually OK to use tabs, but what inevitably seems to happen is that you end up with a mix of spaces and tabs, and then poof... errors...  It looks like it is perfectly indented but python throws errors because it sees 4 spaces differently from how it sees 1 tab.  The only reliable way I have found to always avoid this problem is to set notepad++ to only use spaces.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Python tester
« Reply #4 on: April 30, 2014, 03:49:10 PM »
Here is an hilarious quote.  It is not an argument in favour of spaces, but it makes me happy.

Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. -- Georg Brandl

If you want to read about a gajillion arguments for both sides including this quote, follow this link: http://stackoverflow.com/questions/119562/tabs-versus-spaces-in-python-programming/6338054#6338054?newreg=fed867ffb63c4a93b7d8c7b32b4dc671

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Python tester
« Reply #5 on: July 02, 2014, 04:04:56 PM »
Not sure what to call it, but the python tester part of the PY plugin
http://voxcommando.com/mediawiki/index.php?title=Python


This is cool in app quick tester. I know its not meant to be an IDE, but w/ python being case/indent sensitive, can the tab key but used in there to indent versus change object focus?

Behold.  Version 2.0.0.0 has a new python editor. :D

http://voxcommando.com/forum/index.php?topic=1443.0

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2_official_release

garryjw

  • $upporter
  • Contributor
  • *****
  • Posts: 59
  • Karma: 5
    • View Profile
Re: Python tester
« Reply #6 on: July 02, 2014, 05:01:39 PM »
and it is fabulous - thanks