Wildman via Python-list wrote:
> Python 2.7.9 on Linux
>
> Here is a bash command that I want to run from a python
> program: sudo grep "^user\:" /etc/shadow
>
> If I enter the command directly into a terminal it works
> perfectly. If I run it from a python program it returns an
> empty string
On 2016-10-31, Wildman wrote:
> Here is a bash command that I want to run from a python
> program: sudo grep "^user\:" /etc/shadow
>
> If I enter the command directly into a terminal it works
> perfectly. If I run it from a python program it returns an
> empty string. Below is the code I am usi
On 2016-10-31, Ben Finney wrote:
> Instead, you should invoke the exact Python interpreter you want – and,
> by extension, the Python environment into which you want packages
> installed.
>
> $ /foo/bar/virtualenv/bin/python3 -m pip install LoremIpsum
I'm slightly curious about that. /foo/bar
On Mon, 31 Oct 2016 07:21 pm, Jon Ribbens wrote:
> On 2016-10-31, Ben Finney wrote:
>> Instead, you should invoke the exact Python interpreter you want – and,
>> by extension, the Python environment into which you want packages
>> installed.
>>
>> $ /foo/bar/virtualenv/bin/python3 -m pip inst
I have some confuse about the recursive generator where the code mixing Yield
and return keywork as below. I understand that "return" keywork just raise
StopIteration exception but can not understanding in depth, so, could some one
explain me about the actual function of two "return" keyworks in
On Tue, Nov 1, 2016 at 12:39 AM, wrote:
> I have some confuse about the recursive generator where the code mixing Yield
> and return keywork as below. I understand that "return" keywork just raise
> StopIteration exception but can not understanding in depth, so, could some
> one explain me abo
Hi ChrisA,
Thank you so much for sharing this point, I just concern to the point that:
normally, I found that the generator (it may be recursive generator also) do
not apply the "return" keyword, just the yield only. But when I delete one or
both of "return" keyword above, the code do not actio
On Mon, 31 Oct 2016 15:31:27 +1100, Chris Angelico wrote:
> On Mon, Oct 31, 2016 at 3:19 PM, Wildman via Python-list
> wrote:
>> Here is a bash command that I want to run from a python
>> program: sudo grep "^user\:" /etc/shadow
>>
>> If I enter the command directly into a terminal it works
>> p
On Tue, Nov 1, 2016 at 1:03 AM, wrote:
> Hi ChrisA,
>
> Thank you so much for sharing this point, I just concern to the point that:
> normally, I found that the generator (it may be recursive generator also) do
> not apply the "return" keyword, just the yield only. But when I delete one or
> b
Hi Chris,
Please see the exampl I just got it below, this is the Tower of Hanoi with
recursive generator but it do not have the 'return' here, do you have the
advice for this term:
def A001511():
yield 1
b=1
for x in A001511():
yield x+1
yield 1
trial=A001511()
for
On Mon, 31 Oct 2016 15:44:13 +1100, Ben Finney wrote:
> Wildman via Python-list writes:
>
>> Python 2.7.9 on Linux
>>
>> Here is a bash command that I want to run from a python
>> program: sudo grep "^user\:" /etc/shadow
>
> Some points to note:
>
> * Those commands are not special to Bash, o
On Mon, 31 Oct 2016 09:12:57 +0100, Peter Otten wrote:
> Wildman via Python-list wrote:
>
>> Python 2.7.9 on Linux
>>
>> Here is a bash command that I want to run from a python
>> program: sudo grep "^user\:" /etc/shadow
>>
>> If I enter the command directly into a terminal it works
>> perfect
On Mon, Oct 31, 2016, at 10:55, Wildman via Python-list wrote:
> I have code using that approach but I am trying to save myself
> from having to parse the entire shadow file. Grep will do it
> for me if I can get code right.
Python already has built-in functions to parse the shadow file.
https:/
On Tue, Nov 1, 2016 at 1:50 AM, wrote:
>
> Please see the exampl I just got it below, this is the Tower of Hanoi with
> recursive generator but it do not have the 'return' here, do you have the
> advice for this term:
>
> def A001511():
> yield 1
> b=1
> for x in A001511():
>
On Mon, 31 Oct 2016 08:13:54 +, Jon Ribbens wrote:
> On 2016-10-31, Wildman wrote:
>> Here is a bash command that I want to run from a python
>> program: sudo grep "^user\:" /etc/shadow
>>
>> If I enter the command directly into a terminal it works
>> perfectly. If I run it from a python pr
On Tue, 1 Nov 2016 12:39 am, tpqnn...@gmail.com wrote:
> I have some confuse about the recursive generator where the code mixing
> Yield and return keywork as below. I understand that "return" keywork just
> raise StopIteration exception but can not understanding in depth, so,
> could some one exp
On Mon, 31 Oct 2016 11:05:23 -0400, Random832 wrote:
> On Mon, Oct 31, 2016, at 10:55, Wildman via Python-list wrote:
>> I have code using that approach but I am trying to save myself
>> from having to parse the entire shadow file. Grep will do it
>> for me if I can get code right.
>
> Python al
Hi all,
I am trying to read an ascii file written in Fortran90 using python. I am
reading this file by opening the input file and then reading using:
inputfile.readline()
On each line of the ascii file I have a few numbers like this:
line 1: 1
line 2: 1000.834739 2000.38473 3000.349798
line
On 31-10-2016 18:20, Heli wrote:
> Hi all,
>
> I am trying to read an ascii file written in Fortran90 using python. I am
> reading this file by opening the input file and then reading using:
>
> inputfile.readline()
>
> On each line of the ascii file I have a few numbers like this:
>
> line 1
On Monday, October 31, 2016 at 6:30:12 PM UTC+1, Irmen de Jong wrote:
> On 31-10-2016 18:20, Heli wrote:
> > Hi all,
> >
> > I am trying to read an ascii file written in Fortran90 using python. I am
> > reading this file by opening the input file and then reading using:
> >
> > inputfile.readli
On 2016-10-31, Wildman via Python-list wrote:
> On Mon, 31 Oct 2016 15:44:13 +1100, Ben Finney wrote:
>> Wildman via Python-list writes:
>>
>>> Python 2.7.9 on Linux
>>>
>>> Here is a bash command that I want to run from a python
>>> program: sudo grep "^user\:" /etc/shadow
>>
>> Some points t
On Mon, 31 Oct 2016 11:55:26 -0500, Wildman wrote:
> On Mon, 31 Oct 2016 11:05:23 -0400, Random832 wrote:
>
>> On Mon, Oct 31, 2016, at 10:55, Wildman via Python-list wrote:
>>> I have code using that approach but I am trying to save myself
>>> from having to parse the entire shadow file. Grep w
On 31-10-2016 18:46, Heli wrote:
> Thanks Irmen,
>
> I tried with "rU" but that did not make a difference. The problem is a line
> that with one single write statement in my fortran code :
>
> write(UNIT=9,FMT="(99g20.8)") value
>
> seems to be read in two python inputfile.readline().
>
>
On 31-10-2016 19:24, Irmen de Jong wrote:
> So there must be something in that line in your file that it considers an EOF.
I meant to type EOL there. (end-of-line/newline).
Irmen
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for your detail explanation, my problem may be the 'return' keyword. I
confuse at the point that return come after yield keyword, I wonder what if in
case this code do not have the 1st return. So, when i try to delete the 1st
return, the code run with error (the list out of range).
This
On 2016-10-31 17:46, Heli wrote:
On Monday, October 31, 2016 at 6:30:12 PM UTC+1, Irmen de Jong wrote:
On 31-10-2016 18:20, Heli wrote:
> Hi all,
>
> I am trying to read an ascii file written in Fortran90 using python. I am
reading this file by opening the input file and then reading using:
>
>
http://imgur.com/a/rfGhK#iVLQKSW
How do I code a function that returns a list of the first n elements of the
sequence defined in the link? I have no idea!
So far this is my best shot at it (the problem with it is that the n that i'm
subtracting or adding in the if/else part does not represe
tpqnn...@gmail.com wrote:
def fg(args):
if not args:
yield ""
return
for i in args[0]:
for tmp in fg(args[1:]):
yield i + tmp
return
The final return is redundant, since there is an implicit return
at the end, just like an ordinary function. The other one is just
perfor
On 2016-10-31 22:09, devers.meetthebadger.ja...@gmail.com wrote:
http://imgur.com/a/rfGhK#iVLQKSW
How do I code a function that returns a list of the first n elements of the
sequence defined in the link? I have no idea!
So far this is my best shot at it (the problem with it is that the n t
devers.meetthebadger.ja...@gmail.com writes:
> http://imgur.com/a/rfGhK#iVLQKSW ...
> So far this is my best shot at it (the problem with it is that the n
> that i'm subtracting or adding in the if/else part does not represent
> the element's position...
Right, so can you figure out the element's
On Tue, 1 Nov 2016 09:09 am, devers.meetthebadger.ja...@gmail.com wrote:
> http://imgur.com/a/rfGhK#iVLQKSW
Why on earth are you posting a screen shot?
Do you edit your code with Photoshop?
As soon as you post an unnecessary screenshot, you cut the number of people
willing and able to help you
Wildman via Python-list writes:
> On Mon, 31 Oct 2016 15:44:13 +1100, Ben Finney wrote:
>
> > One immediate difference I see is that you specify different
> > arguments to ‘grep’. You have a different pattern for each command.
> >
> > * The ‘^user\:’ pattern matches “user\:” at the start of a li
On 10/31/2016 03:09 PM, devers.meetthebadger.ja...@gmail.com wrote:
http://imgur.com/a/rfGhK#iVLQKSW
How do I code a function that returns a list of the first n elements of the
sequence defined in the link? I have no idea!
So far this is my best shot at it (the problem with it is that the
On behalf of the Python development community and the Python 3.6 release
team, I'm pleased to announce the availability of Python 3.6.0b3. 3.6.0b3
is the third of four planned beta releases of Python 3.6, the next major
release of Python.
Among the new major new features in Python 3.6 are:
* PEP
On Tue, 01 Nov 2016 12:08:52 +1100, Ben Finney wrote:
> Wildman via Python-list writes:
>
>> On Mon, 31 Oct 2016 15:44:13 +1100, Ben Finney wrote:
>>
>> > One immediate difference I see is that you specify different
>> > arguments to ‘grep’. You have a different pattern for each command.
>> >
>
Wildman via Python-list writes:
> […] in this case grep never "sees" the '$' sign. Bash expands $USER to
> the actual user name beforehand.
I understand how Bash substitutes variables on the command line.
What I need to repeat, though: In this case, no, Bash doesn't do that
because Bash isn't g
On Tue, 1 Nov 2016 04:00 pm, Wildman wrote:
> You are correct about that but, in this case grep never "sees" the '$'
> sign. Bash expands $USER to the actual user name beforehand. If you
> are on a Linux system, enter this into a terminal to illustrate:
>
> sudo grep ^$USER\: /etc/shadow
Bash
would like to change Add operator to custom function op2 in solve function
and then this solve([x*y - 1, x + 2], x, y)
during solve, the parameters also change Add to custom function op2
import ast
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbo
38 matches
Mail list logo