- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
Andre S. Veteran
I'm kind of a newbie in Python and I'd like to know if the following is possible. All of the following happens at run-time. The application's presentation is basically a Python interpreter like the IDLE, where the user types Python code, hits enter and sees the results immediately. The difference is that this interpreter can generate new types on the fly, given a type definition is some arbitrary format (xml for instance). When it receives that type definition, it generates a new python class based on that type definition, with the same methods and fields etc. It also generates some extra code in the methods of that new type. The new type is then available to the user on the console so he can instantiate it and use it.
Basic use case :
User types "load type "MyType.xml"
MyType.xml :
MyType is now a python class loaded in the interpreter.
User types "mt = MyType()", uses mt's fields, methods, etc.
So basically this requires some metaprogramming ability and I wonder if that's possible in Python? If so, using what libraries/types? I've browsed the documentation and I'm not really sure. I understand that I can create a new run-time type using the function type, but I feel like that's insufficient given I also need to be able to plug some more code in there, and all that has to happen automatically, the user just specifies where to find the type definition and it should be available to him.
Thanks for any help.
Link to comment
https://www.neowin.net/forum/topic/775226-python-code-generation/Share on other sites
2 answers to this question
Recommended Posts