how copy my code with its line number i cant do it in visual studio code
edit:someone said that mostly code number is useless but yet also it could be important when addressing code line while working on problems so do anyone know a way
The line numbers are not relevant for the code operation and therefore could be meaningless. Theyâre simply there for local code analysts, such as callback error reporting and an easy way for us humans to see the code, so to speak.
yeah but just for the callback it can appear very useful so do you know how to put numbers automatically for code lines ?
Please explain why you want to do thisâŚotherwise when someone says, âtake a screen-shotâ you might respond to such assistance with âno, becauseâŚâ
Maybe youâd have better chances asking in a Visual Studio Code discussion forum rather than in a Python one.
Maybe, you mean to ask about some code error or other? In which case youâd simply create a code block area, within your âpostâ, such as:
# your code would be here
...
...
...
And then ask, something like: âCould someone please tell me why Iâm seeing this error?â
File "/home/rob/Desktop/python/temp/temp.py", line 19, in <module>
for name_l2 in names[name_tl][name_l1]:
builtins.TypeError: 'NoneType' object is not iterable
As you can see, the trace back not only tells you what the line number is, but it also shows the actual codeline, which is the relevant part; the line number is purely incidental.
That could read: ..., line 1254, in...
and it would make no difference.
Clearly, it would be nuts to post up 1300 lines of code, just to show the relevant code block; youâd simply post up the relevant code.