Re: syntax question

2018-06-02 Thread Timo Furrer
>From the Python documentation at
https://docs.python.org/3/tutorial/controlflow.html#lambda-expressions

> Small anonymous functions can be created with the lambda
<https://docs.python.org/3/reference/expressions.html#lambda> keyword. This
function returns the sum of its two arguments: lambda a, b: a+b. Lambda
functions can be used wherever function objects are required. They are
syntactically restricted to a single expression. Semantically, they are
just syntactic sugar for a normal function definition.

Thus, in your case the lambda is equivalent to:

def line(x):
return x + 3

Cheers, Timo

On Sat, Jun 2, 2018 at 1:12 PM Sharan Basappa 
wrote:

> Can anyone please tell me what the following line in a python program does:
>
> line = lambda x: x + 3
>
> I have pasted the entire code below for reference:
>
> from scipy.optimize import fsolve
> import numpy as np
> line = lambda x: x + 3
> solution = fsolve(line, -2)
> print solution
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
*Timo Furrer*

https://github.com/timofurrer
tuxt...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re:

2018-06-10 Thread Timo Furrer
Can you be more specific.
What did you try? In which environment? What was the error message you got?

On Sun, Jun 10, 2018 at 6:32 PM sagar daya  wrote:

> Couldn't install any module from pip
> Plz help???
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
*Timo Furrer*

https://github.com/timofurrer
tuxt...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Daemon strategy

2016-02-06 Thread Timo Furrer
As Ben already said .. either deploy to Unix systems or use
subprocess.Popen and detach the process:

from subprocess import Popenfrom win32process import DETACHED_PROCESS
Popen(["YOURPROCESS"],creationflags=DETACHED_PROCESS,shell=True)



On Fri, Feb 5, 2016 at 10:52 AM, Ben Finney 
wrote:

> paul.hermeneu...@gmail.com writes:
>
> > It appears that python-deamon would be exactly what I need. Alas,
> > appears not to run on Windows. If I am wrong about that, please tell
> > me.
>
> You're correct that ‘python-daemon’ uses Unix facilities to create a
> well-behaved Unix daemon process.
>
> Since MS Windows lacks those facilities, ‘python-daemon’ can't use them.
>
> > To what tools should I turn?
>
> If what you need – the support to create a Unix daemon process – is
> available only on Unix by definition, it seems you'll need to deploy to
> Unix.
>
> > I am not eager to produce a "service" on Windows unless it cannot be
> > avoided.
>
> Agreed :-)
>
> --
>  \ “Wrinkles should merely indicate where smiles have been.” —Mark |
>   `\Twain, _Following the Equator_ |
> _o__)      |
> Ben Finney
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
*Timo Furrer*

https://github.com/timofurrer
tuxt...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list