Tagged Questions
1
vote
1answer
22 views
Dynamically create list of classes with inheritance and classmethods
I have a list of classes, and I'm trying to dynamically create another list of classes, such that each one has a classmethod that creates an instance of a child of a class from the original list.
The ...
2
votes
3answers
53 views
Dynamically adding key-arguments to method
I would like to set the default key-arguments of an instance method dynamically. For example, with
class Module(object):
def __init__(self, **kargs):
...
1
vote
0answers
18 views
Dynamic (i.e. Runtime Configurable) Log Configuration for Django + Celery based application
We have a need to customize the log levels on the server at runtime. We are building a SAAS application using Django, and we have to be able to enable logging per tenant eventually. I am trying to ...
0
votes
2answers
52 views
How do I programmatically add new functions to current scope in Python?
In Python it is easy to create new functions programmatically. How would I assign this to programmatically determined names in the current scope?
This is what I'd like to do (in non-working code):
...
2
votes
2answers
65 views
Python: renaming method names on-the-fly
I have many files using classes with the following syntax:
o = module.CreateObject()
a = o.get_Field
and now the implementation has changed from 'get_XXX' and 'set_XXX' to just 'XXX':
o = ...
1
vote
3answers
49 views
Python Dynamic Execution
I have a list of dictionary items stored in variable List_dicts, and I have to write a selected list of items from the above list into a file. given below my python function:
def ...
0
votes
0answers
52 views
I am trying to build a knowledge management system that learns dynamically. As it comes
I am trying to build a knowledge management system that in small way tries to mimic human ability to learn. It deals with both, new instances of concepts that it already knows, which allows it to ...
0
votes
1answer
29 views
Loading module at runtime works except under fabric
I have 2 files in a directory: loader.py & mod1.py. Loader.py dynamically instanciates a class in mod1.py and calls a method on it. Here is mod1.py
class MyClass1:
def run(self):
...
0
votes
1answer
77 views
Python creating dynamic global variable from list
I am trying to make generic config, and thus config parser. There are two config files say A and B. I want to parse sections and make global values from them according to hardcoded list.
Here is an ...
0
votes
1answer
72 views
Python Matplotlib: Dynamically update plot - array length not known a priori
I am aware of these questions: (A), (B) and (C) - all of which address parts of my problem.
I have also read the Animations Cookbook
My questions, however, seem not to be addressed in any of the ...
0
votes
1answer
35 views
Dynamically create clean_* methods for readonly fields in Django forms
This is an extension to this SO question.
Is there an easy way to dynamically generate the required clean_X methods to ensure that read-only form fields do not get modified? I can manually write the ...
0
votes
1answer
40 views
BeautifulSoup not grabbing dynamic content
My issue I'm having is that I want to grab the related links from this page:
http://support.apple.com/kb/TS1538
If I Inspect Element in Chrome or Safari I can see the div id="outer_related_articles" ...
0
votes
1answer
48 views
Python/Django Forms: Dynamic variable creation and access for Form fields
I have a django form class only with one widget. I would like to give a name to this widget like <select name="custom_name"></select> but Django takes the name of the variable and gives it ...
2
votes
1answer
86 views
Creating a dynamic form and displaying in a custom template table with Django Python
I am making a web application which will display a list of students in a table, and beside each name an input field allowing the user to give a "tag" to that student. I am having trouble figuring out ...
0
votes
1answer
26 views
Dynamicaly decoratoring methods in a class on Python
I'm thinking about creating a decorator for a class, which can add a decorator dynamically to specific methods that start with a certain word, instead of manually adding the decorator to each method.
...