Mar-25-2022, 06:00 PM
(Mar-25-2022, 07:06 AM)Gribouillis Wrote: Are you looking for inspect.getsource() ?almost. if the code i want to extract from can be imported as a module, this could work. for stdin i'd have to copy it to a file, first, unless there is a way to import from stdin or a list of str or a big str.
(Mar-25-2022, 06:27 AM)ndc85430 Wrote: For what purpose?to extract source code of a function or class to the end of that function or class, comiing from a file or stdin. this is to find the end of that function or class. maybe parsing indentation (after disposing of comments) would be the easy way.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.