Hi,
Assume that I have a target directory, which I am using as a location to store my python scripts.What I need to do is to listen to that directory and when a python script is placed in that directory, I need to execute it at that time.Can anyone give me an idea on how to do this using python?
User Profile
Collapse
-
Filtering & Getting data out from a object
Hi,
I have written a the following python code to analyse a function or a method. I am having a script which is having a python function (add) and a class (MyClass) with a method (multiply).When I analyse it using the following method(analyze_ func) , I get an output like below.
The problem I am having is, I need to get the value 'MyClass.multip ly' from the obj. When I do obj.__name__ , I am only getting "multiply" only.So... -
java.util.map Compatible data structure in python
I am using java.util.map to store some data ( one key and two values , per row ) in java and return it to a python function . What kind of a data structre should I use in python to catch it? (btw I am using Jython as a bridge between python and java) -
Executing a string
Hi,
If I execute the following code I will get the the output as 2. What I need is to execute the string str. Is there a way that I can execute the string str as it is, so I will get the output as 5.
Code:def add(a,b): return a+b var = 2 str = "var = add(2,3)" [color=#4080FF]# execute the code snippet inside the str string variable[/color] print var -
In javascript I'm used to associating metadata with a function as
follows.
foo.bar = "foobar";
function foo(){
}
What's the normal python practice to do this kind of a thing. What's the
python way of doing this. -
Storing Meta-data in python
Is there a mechanism to express meta-data about classes, methods, variables and method parameters in python ( like annotations in java)? I will be thankful if anyone can point me to a sample code or a web reference.
No activity results to display
Show More
Leave a comment: