User Profile

Collapse

Profile Sidebar

Collapse
Heshan Suri
Heshan Suri
Last Activity: May 6 '08, 04:17 AM
Joined: Apr 2 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Listening to a target directory and executing a python file dynamically

    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?
    See more | Go to post

  • Heshan Suri
    started a topic Filtering & Getting data out from a object

    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...
    See more | Go to post

  • 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)
    See more | Go to post

  • Heshan Suri
    started a topic Executing a string

    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
    See more | Go to post

  • Heshan Suri
    replied to Storing Meta-data in python
    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.
    See more | Go to post

    Leave a comment:


  • Heshan Suri
    started a topic Storing Meta-data in python

    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.
    See more | Go to post
No activity results to display
Show More
Working...