简体   繁体   中英

How to prevent tab characters from being converted to spaces in console output when using IPython in Spyder

In IDLE Python if I do print "a\\tb" I get an output that looks like: a[TAB]b .

If I do the same in IPython in Spyder, then I get an output that looks like: a[7 spaces]b

I like to output tables of data as tab delimited text to make it easier to copy from the console and paste it to Excel. If the tabs get converted to spaces it becomes more difficult.

Is there any setting within IPython or Spyder which controls how TAB characters are displayed? I am using Spyder+IPython on a Windows 10 desktop. I realized I could just write the data to a file, but in this case it is more convenient to just use the console and the clipboard.

这里是 Spyder 维护者)为了记录,这个问题在我们 2020 年 3 月发布的4.1.0版本中得到了解决。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM