How to clear console in sublime text editor

2024/11/20 3:37:42

How to clear console in sublime text editor. I have searched on internet too..But can't find proper shortcut for that. Please provide info

Answer

I assume you're talking about the console accessible via View -> Show Console or Ctrl`. Unlike other answers on SO, which deal with clearing the Python console when opened from the command prompt, os.system("cls") or os.system("clear") (depending on your OS) don't work with the Sublime console. The Sublime API (version 2 or version 3) does not have any built-in console-clearing method, and I was unable to find any undocumented method in sublime.py or sublime_plugin.py. The console appears to be read-only, as selecting all the text and hitting Delete doesn't work either.

I've been looking into this for some time, and I've come to the conclusion that it does not appear to be possible. However, there is a hackish workaround - just run print('\n'*100) to print 100 newline characters, and you won't be able to see any of the previous output unless you scroll up some distance.

https://en.xdnf.cn/q/26360.html

Related Q&A

YAML loads 5e-6 as string and not a number

When I load a number with e form a JSON dump with YAML, the number is loaded as a string and not a float.I think this simple example can explain my problem.import json import yamlIn [1]: import jsonIn …

How to get rid of grid lines when plotting with Seaborn + Pandas with secondary_y

Im plotting two data series with Pandas with seaborn imported. Ideally I would like the horizontal grid lines shared between both the left and the right y-axis, but Im under the impression that this is…

How to set the line width of error bar caps

How can the line width of the error bar caps in Matplotlib be changed?I tried the following code:(_, caplines, _) = matplotlib.pyplot.errorbar(data[distance], data[energy], yerr=data[energy sigma],cap…

Where is Pythons shutdown procedure setting module globals to None documented?

CPython has a strange behaviour where it sets modules to None during shutdown. This screws up error logging during shutdown of some multithreading code Ive written.I cant find any documentation of this…

Save a dictionary to a file (alternative to pickle) in Python?

Answered I ended up going with pickle at the end anywayOk so with some advice on another question I asked I was told to use pickle to save a dictionary to a file. The dictionary that I was trying to sa…

python equivalent of functools partial for a class / constructor

I want to create a class that behaves like collections.defaultdict, without having the usage code specify the factory. EG: instead of class Config(collections.defaultdict):passthis:Config = functools.p…

Set the font size in pycharms python console or terminal

There are terminal and python console in pycharm, which are very convenient. But I found that the font size was too small to recognize in terminal or python console. How can change the font size in the…

How to filter model results for multiple values for a many to many field in django

I have the following Model:class Group(models.Model):member = models.ManyToManyField(Player, through=GroupMember)name = models.CharField(max_length=20, unique=True)join_password = models.CharField(max_…

Why is string comparison so fast in python?

I became curious to understand the internals of how string comparison works in python when I was solving the following example algorithm problem:Given two strings, return the length of the longest comm…

What is a namespace object?

import argparseparser = argparse.ArgumentParser(description=sort given numbers) parser.add_argument(-s, nargs = +, type = int) args = parser.parse_args() print(args)On command line when I run the comma…