I want to delete all user defined objects from a python session. Suppose I do the following things.
1) Start Rodeo ( a python GUI )
2) write u = 5
3) So u is an object now.
4) import some packages say
import os
import pandas as pd
import datetime
5) Now I want to clear only these objects :- u, os module, pd module and datetime module.
By 'clear' I mean to say that after clearing if I type u in console, python should not be able to find the object u.
Similarly all commands in pd ( i.e. pandas ) module should be inaccessible.
How to do this ?
Please note that I don't want to delete any builtins ( as described in this question : How do I clear all variables in the middle of a Python script? ).
The duplicate question that you are pointing does not answer the question completely. I want to know how to remove only the user defined objects without removing the builtins etc.
The duplicate question gives answer about how to remove the builtins too - which I don't want.