Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Gora Mohanty
On 19 February 2014 17:01, Mukesh Yadav wrote: >> > I can change the class code and parameter as it is small script. >> >> I would think that this is terrible practice. >> > > Would love to more about it. Passing multiple arguments to the function seems to be the cleanest approach, as it separate

Re: [BangPypers] Need help Extracting data properly in python

2014-02-19 Thread Kulkarni, Shreyas
if this is a valid tab-seperated file, you could try parsing it using csv module with dialect set to '\t' or 'excel-tab' maybe? shreyas On Feb 19, 2014, at 5:43 PM, "kamalakar06 ." wrote: > I have a file like this(Tabular data) : > > 0 1 CEN/4 1.e33.000e3 4.000e-3 >

[BangPypers] Need help Extracting data properly in python

2014-02-19 Thread kamalakar06 .
I have a file like this(Tabular data) : 0 1 CEN/4 1.e33.000e3 4.000e-3 1.000e-3 3.000e3 5.000e3 112.000e3 3.000e4 6.000e3 1.000e4 1.000e4 1.000e5

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Mukesh Yadav
> > I can change the class code and parameter as it is small script. > > I would think that this is terrible practice. > Would love to more about it. > > Regards, > Gora > ___ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Mukesh Yadav
@Rohit thanks for **kwargs example. On Wed, Feb 19, 2014 at 4:36 PM, Rohit K wrote: > How about creating a class object > > *Class Params():* > > *def __init__(self, **kwargs):* > > *self.bucket = kwargs['bucket'] * > > > *self.value = kwargs["value"]*. > > and while y

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Gora Mohanty
On 19 February 2014 16:21, Mukesh Yadav wrote: >> Unless I am missing something, why can't you use: >> object.some_awesome_function( bucket ) >> > I can but in my case I have 5+ setting variables, which is not feasible to > pass it for each method which it is using. Why not? If you really wante

[BangPypers] [MANPOWER] Python Developers

2014-02-19 Thread hr
Hi, We are Manpower outsourcing and consulting company, HQ at Bangalore. We can support companies by providing Python Manpower of difference experience on Permanent or Contractual basis. Right from Freshers to 5+ years experienced Python developers we can provide. For any kind of Python r

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Rohit K
How about creating a class object *Class Params():* *def __init__(self, **kwargs):* *self.bucket = kwargs['bucket'] * *self.value = kwargs["value"]*. and while you create instance for module class: # object = module.*Class_name*('value'); instead of this use below

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Mukesh Yadav
> Unless I am missing something, why can't you use: > object.some_awesome_function( bucket ) > > I can but in my case I have 5+ setting variables, which is not feasible to pass it for each method which it is using. Also, > as you are presumably writing these scripts after the > class code has a

Re: [BangPypers] Managing variable in small scripts.

2014-02-19 Thread Gora Mohanty
On 19 February 2014 15:37, Mukesh Yadav 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 * > > *buck

[BangPypers] Managing variable in small scripts.

2014-02-19 Thread Mukesh Yadav
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.