comments

vscode preserve indentation when commenting out lines

戏子无情 提交于 2020-12-07 05:03:07
问题 In vscode (or most other editors I tried for that matter) when I have a block of code like this: function() { if(test1) { doThis(); andThenDoThat(); } } And I try to comment out the line andThenDoThat() e.g. by pressing Ctrl + / , I will get this: function() { if(test1) { doThis(); // andThenDoThat(); } } What I would like to get is this: function() { if(test1) { doThis(); // andThenDoThat(); } } In other words, I want the comment to preserve the original indentation of the code, and start

vscode preserve indentation when commenting out lines

白昼怎懂夜的黑 提交于 2020-12-07 04:57:51
问题 In vscode (or most other editors I tried for that matter) when I have a block of code like this: function() { if(test1) { doThis(); andThenDoThat(); } } And I try to comment out the line andThenDoThat() e.g. by pressing Ctrl + / , I will get this: function() { if(test1) { doThis(); // andThenDoThat(); } } What I would like to get is this: function() { if(test1) { doThis(); // andThenDoThat(); } } In other words, I want the comment to preserve the original indentation of the code, and start

vscode preserve indentation when commenting out lines

北慕城南 提交于 2020-12-07 04:56:58
问题 In vscode (or most other editors I tried for that matter) when I have a block of code like this: function() { if(test1) { doThis(); andThenDoThat(); } } And I try to comment out the line andThenDoThat() e.g. by pressing Ctrl + / , I will get this: function() { if(test1) { doThis(); // andThenDoThat(); } } What I would like to get is this: function() { if(test1) { doThis(); // andThenDoThat(); } } In other words, I want the comment to preserve the original indentation of the code, and start

get one specific line of comment as header with python Pandas

别等时光非礼了梦想. 提交于 2020-08-26 06:54:51
问题 I have a file looking like # Comment 1 # Comment 2 # A B C 1 2 3 4 5 6 7 8 9 How to read it with python pandas module, so as the last line of comments can be interpreted as the columns titles ? I've tried pandas.read_table(file_path, header= 2 , comment='#' ) But the comment lines are eliminated first, thus the header line will be 7 8 9 回答1: You can do this manually: first read the comments, parse the column names, then call read_table : import itertools import pandas as pd def read_data(path