0

I don't know if you guys are having the same problem, but when I'm trying to use """ and """ for multi-lines comments in eclipse pydev, it sometimes does not work. Anybody can suggest me some better IDE?

Sorry. I will try to make this clearer. It happens every time when I try to comment off looong multi lines like 300 or so. Just type whatever expression such as Bug = "This is a bug", and copy paste this single line to make the whole script 300 lines, now if you want to comment off these 300 lines, normally you would add """ before all these lines, and then add """ in the end. You will find that these lines do not get comment-off aka coloring problem.

"""
Bug = "This is a bug"
Bug = "This is a bug"
...
...
Bug = "This is a bug"
"""
smci
  • 32,567
  • 20
  • 113
  • 146
Shane
  • 4,875
  • 12
  • 49
  • 87
  • 5
    In what way does it not work? Does it delete your code? Fail to indent properly? Cause cataclysmic seismic events? – Dominic Rodger Aug 18 '10 at 13:53
  • Yes Pydev's syntax coloring is sometimes confused with triple quotes, but after a little further typing it becomes all right again. – Eike Aug 18 '10 at 13:57
  • what's this got to do with wxpython? – volting Aug 18 '10 at 13:57
  • 1
    possible duplicate of [What IDE to use for Python?](http://stackoverflow.com/questions/81584/what-ide-to-use-for-python) – Jochen Ritzel Aug 18 '10 at 13:57
  • @Eike I noticed that as well. Ive grown used to it though and barely notice it any more – volting Aug 18 '10 at 13:59
  • @Dominic Rodger: When I'm trying to comment off long multi-lines, it always fails to work... – Shane Aug 18 '10 at 14:00
  • @volting: I'm currently working on a GUI program, so I just added wxpython anyway – Shane Aug 18 '10 at 14:03
  • @Eike: It's not just coloring problem, the IDE prompts IndentationError which bugs me a lot... – Shane Aug 18 '10 at 14:06
  • @Shane - can you post some code that gives you an `IndentationError`? Then those of us with pydev can try it out. – Dominic Rodger Aug 18 '10 at 14:13
  • @Dominic Rodger: It's actually not about IndentationError. Just type Error = "error" 400 lines, and if you try to comment off these 400 lines, you will find it impossible to do so. I don't know why it's not working with long lines – Shane Aug 18 '10 at 14:19
  • 1
    @Shane can you add more description like others have asked above? You've fallen into the developer hate speak with such helpful and descriptive phrases of "doesn't work." That's the worst thing we get back from customers. We can't even tell if it's actually a bug or something you're doing wrong. – wheaties Aug 18 '10 at 14:34
  • Sorry. I will try to make this clearer. It happens every time when I try to comment off looong multi lines like 300 or so. Just type whatever expression such as Bug = "This is a bug", and copy paste this single line to make the whole script 300 lines, now if you want to comment off these 300 lines, normally you would add """ before all these lines, and then add """ in the end. You will find that these lines do not get comment-off aka coloring problem. – Shane Aug 18 '10 at 14:59
  • @Shane If you want to comment out some lines why dont you just select those lines and `Ctrl +3` or `Ctrl +\ ` to uncomment... – volting Aug 18 '10 at 15:15
  • @Shane Maybe it's not a problem with the syntax coloring as such, but with accessing the editor's contents from the outside. Then Pydev's code analysis would be off too. Nevertheless the error goes away after a short while. And you could use `#` and the "comment" function (Source -> Comment) to create comments, this has always worked for me. – Eike Aug 18 '10 at 15:29
  • This issue is >7 years old, can you either confirm it still happens on latest Eclipse+PyDev versions (if so, post version nos) or else close it (add your own answer if necessary)? – smci Nov 09 '17 at 21:53

2 Answers2

1

I prefer pyDev plugin with Eclipse.

But if you feel its problem checkout following:

YoK
  • 14,329
  • 4
  • 49
  • 67
0

I have this problem as well. It has been around for so long, I have become used to it. It tends to happen to me most when I am writing epydoc for functions. I do not think it is an actual bug that affects the code, but it makes typing comments more annoying. A quick fix that I have found is to:

Put the cursor before the initial ''', press enter, press ctrl+z.

That tends to fix it for me.

Hope that helps.

River
  • 133
  • 1
  • 8
  • I also found that when you are trying to comment off long multi lines, if the content between the two """ does not get comment off you can put the cursor at the end of the beginning """ and press enter, then all the content between should now become comments. – Shane Sep 27 '10 at 12:20
  • @Shane: I will keep that in mind. I have been doing some Python coding in vim and it occasionally has a similar problem as well. – River Sep 28 '10 at 17:52