[Tutor] (no subject)

2015-06-10 Thread rakesh sharma
I have come across this syntax in python. Embedding for loop in []. How far can things be stretched using this []. l = [1, 2, 3, 4, 5] q = [i*2 for i in l] print qthanksrakesh ___ Tutor maillist - Tutor@python.or

[Tutor] Using lambda

2015-08-23 Thread rakesh sharma
I am beginner in pythonI see the use of lambda has been for really simple ones as in the numerous examples over the net.Why cant we use lambda in another one like g = lambda x: (lambda y: y + 1) + 1when I am able to do that in two lines h = lambda x: x + 1>>> h(12)13y = lambda x: h(x) + 1>>> y(1)

Re: [Tutor] Private members?

2016-02-26 Thread rakesh sharma
I believe in Python there are no private public concept. All are public by default Sent from Outlook Mobile On Fri, Feb 26, 2016 at 12:04 AM -0800, "kay Cee" mailto:une...@gmail.com>> wrote: Say I have a basic Circle class, for example: class Circle: def __init__(

[Tutor] Help regarding reg exp.

2016-10-05 Thread rakesh sharma
Hi all I have a string of pattern ({A,BC},{(A,B),(B,C)(C,A)}. I want to extract the inner brackets {A,B,C} etc. Please help. I have tried various methods of re to no avail. Get Outlook for Android ___ Tutor maillist - Tutor@p

Re: [Tutor] good django book?

2014-02-07 Thread rakesh sharma
Hi Alex, >From my experience, though in windows env, there is considerable amount of >difference in the way both the version gets implemented thanks,rakesh > From: eryk...@gmail.com > Date: Fri, 7 Feb 2014 22:43:55 -0500 > To: aklei...@sonic.net > CC: tutor@python.org > Subject: Re: [Tutor] good

Re: [Tutor] learning recursion

2014-02-07 Thread rakesh sharma
Hi Shouldn't your code be like this def fib(n): if n==0:return 0else: return n + fib(n-1) this works >>> for i in range(4): print fib(i) 0136>>> > To: tutor@python.org > From: da...@davea.name > Date: Thu, 6 Feb 2014 18:06:41 -0500 > Subject: Re: [Tu

Re: [Tutor] learning recursion

2014-02-08 Thread rakesh sharma
; > On Fri, Feb 7, 2014 at 9:05 PM, rakesh sharma > wrote: > > Hi > > > > Shouldn't your code be like this > > > > def fib(n): > > if n==0: > > return 0 > > else: > > return n + fib(n-1) > > > Hi Rakesh, > > Unf

Re: [Tutor] learning recursion

2014-02-08 Thread rakesh sharma
ubject: Re: [Tutor] learning recursion > From: denis.heidtm...@gmail.com > To: rakeshsharm...@hotmail.com > CC: da...@davea.name; tutor@python.org > > On Fri, Feb 7, 2014 at 9:05 PM, rakesh sharma > wrote: > > Hi > > > > Shouldn't your code be like thi

Re: [Tutor] trace / profile every function with inputs

2014-02-10 Thread rakesh sharma
Hi, Have tried inspect module in python.See this code def foo(): print inspect.stack()[0][3] >>> foo()foo>>> this shall meet your purpose I believe thanks,rakesh > From: r.cziv...@research.gla.ac.uk > To: tutor@python.org > Date: Fri, 7 Feb 2014 16:07:58 + > Subject: [Tutor] trace

[Tutor] Upload a file using python

2014-02-16 Thread rakesh sharma
Greetings!! Hi , I need to upload some file into a website. Its ajax based and so I managed to do using selenium.But I feel if i can use the http methods without involving any UI level automation things would be better.I have tried 'requests' library for this. Can't get how to upload a file. I

Re: [Tutor] Upload a file using python

2014-02-17 Thread rakesh sharma
hanks,rakesh > To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Sun, 16 Feb 2014 15:17:52 + > Subject: Re: [Tutor] Upload a file using python > > On 16/02/14 09:15, rakesh sharma wrote: > > > But I feel if i can use the http methods without involving an

[Tutor] Creating a pojo in python

2015-02-08 Thread rakesh sharma
How can one create a POJO in python.I mean a class like this class A { private a; private b; public getA() { return a; } public getB() { return b }} I tried creating class in python but the variables were accessible as public data members. Any help?

[Tutor] (no subject)

2015-02-19 Thread rakesh sharma
Greetings !! Hi all, what the meaning of the line at the start of the python file __author__ = "user" thanks in advancerakesh ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options

[Tutor] Error with sqlalchemy

2017-08-01 Thread rakesh sharma
Hi All I am getting an error in python. Its a flask app that I am doing I am getting the error TypeError: utf_8_decode() argument 1 must be string or buffer, not long at this point in the code ship_schedules = ShipSchedule.query.all() The schema definition is like that I gave below, there is