On 19 February 2014 15:37, Mukesh Yadav <mak....@gmail.com> wrote:
> Hi,
>    I normally create small scripts for crons, Sometime I do create multiple
> modules.
> My question is how to pass same variable to modules which is being used.
>
> e.g.
>
> script.py file contans following code
>
> *import module *
>
> *bucket* = 'some_bucket'
>
> object = module.*Class_name*('value');
>
> object.*some_awesome_function*()
>
> I want bucket variable should be available in *some_awesome_function. *
>
> How to achieve above?

Unless I am missing something, why can't you use:
  object.some_awesome_function( bucket )

It makes little sense to me to have a class import a
variable from a script just to use it in a function. Also,
as you are presumably writing these scripts after the
class code has already been created, how would the
class know where to import from?

Regards,
Gora
_______________________________________________
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers

Reply via email to