On 27/09/2021 06.34, Grant Edwards wrote:
> On 2021-09-26, Ethan Furman wrote:
>> On 9/26/21 9:21 AM, Grant Edwards wrote:
>>> On 2021-09-26, Chris Angelico wrote:
>>
>>>> I'm not sure whether the policy change happened on python-list, or at
>>>&
On 25/09/2021 11.26, David L Neil via Python-list wrote:
> On 25/09/2021 11.00, Chris Angelico wrote:
>
>> Invented because there weren't enough markup languages, so we needed another?
>
> Anything You Can Do I Can Do Better
> https://www.youtube.com/watch?v=_UB1YAsPD
On 29/09/2021 10.50, Stefan Ram wrote:
> (For Python programmers who have watched "Game of Thrones".)
>
> |>>> class girl:
> |... pass
> |...
> |>>> girl = girl()
> |>>> print( girl.name )
> |Traceback (most recent call last):
&g
.
Whereas 'today', many follow the sequence of "Test-Driven Development"
(er, um, often omitting the initial test) of attempting some idea as
code, reviewing the result, and then "re-factoring" (improving), in a
circular progression - until it not only works, but works
On 29/09/2021 12.21, Chris Angelico wrote:
> On Wed, Sep 29, 2021 at 9:10 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
>>
>> On 2021-09-29 at 11:38:22 +1300,
>> dn via Python-list wrote:
>>
>>> For those of us who remember/can compute in binary, octal,
ou're implementing a CPU, though.
Oh yes! The D2 kit - I kept those books for years...
https://www.electronixandmore.com/adam/temp/6800trainer/mek6800d2.html
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 01/10/2021 06.16, Barry Scott wrote:
>
>
>> On 30 Sep 2021, at 12:29, Shaozhong SHI wrote:
>>
>> Dear All,
>>
>> I am trying to look for a definitive guide for Regex in Python.
>> Can anyone help?
>
> Have you read the python docs for the r
On 30/09/2021 18.11, Anil Anvesh wrote:
> I want to write a python calculator program that has different methods to
> add, subtract, multiply which takes 2 parameters. I need to have an execute
> method when passed with 3 parameters, should call respective method and
> perform t
es, eg an integer and a
floating-point number, both utilise the same operator-symbol, enables us
to draw analogies (and in this case, probably get it 100% correct), but
this does not imply a complete equivalence across-the-board
(particularly when crazy-people are let-loose with custom classes! Thus
"a" + "b" should not be pronounced "add", even though the operator looks
very much like the one we use to add two numbers!
For fun, and quickly now, what happens here:
2 + 2
2 + 2.0
2.0 + 2
2.0 + 2.0
"2" + "2"
2 + "2"
"2" + 2
(they're all 'the same', except the last two?three - aren't they???)
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
The issues illustrated likely have less to do with Python than with
Selenium (or even Firefox - depending how far back we need to go).
That and our fate with the many web-search engines prioritising
'authoritative sources' in their results. Such definition includes
'clicks' ov
On 23/10/2021 08.34, Chris Angelico wrote:
> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
> wrote:
>>
>> On 2021-10-22, Stefan Ram wrote:
>>> Paulo da Silva writes:
>>>> Why doesn't this work
>>>> if (self.ctr:=self.c
With apologies for pressing Send too early...
On 23/10/2021 08.41, dn via Python-list wrote:
> On 23/10/2021 08.34, Chris Angelico wrote:
>> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
>> wrote:
>>>
>>> On 2021-10-22, Stefan Ram wrote:
>&
creating a (whole) new list (for example) IS legal, because the
list's name IS an identifier.
Yes, the LHS must be an identifier - the point that was made in the
first response (quoting "Python Language Reference") and since.
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 26/10/2021 10.45, Chris Angelico wrote:
> On Tue, Oct 26, 2021 at 8:42 AM Avi Gross via Python-list
> wrote:
>> Personally, I don't care what is done and suspect I will rarely feel much
>> need to use the current walrus operator, let alone an enhanced Odobenus
&g
heme
developed throughout the talk.
Have searched, but been unable to re-locate this video. Do you recall
the talk? Please advise its URL...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 27/10/2021 11.16, Stefan Ram wrote:
> dn writes:
>> Some time ago I watched a video of a Raymond Hettinger talk. In it he
>> recounted answering his son's question of 'what do you do, Dad?'
>
> The Mental Game of Python - Raymond Hettinger (PyBay 2019)
&
On 27/10/2021 11.21, Stefan Ram wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>> The Mental Game of Python - Raymond Hettinger (PyBay 2019)
>> |What daddy does is make new words to make computers easier to use."
>
> BTW: It now also reminds me of:
>
On 27/10/2021 04.16, Avi Gross via Python-list wrote:
> Chris,
>
> I think it is time someone set up a business where they do the homework for
> people for a mere $1,000 or so per hour. Anonymously, of course. And we can
> refer requests for free homework advice there.
>
>
another data-structure, eg a list of data-points, then combining such
with/into my_class may well yield further simplifications,
encapsulations, and benefits - but all in-theory and complete ignorance
of your application...
Hope the above gives you some ideas/pause for thought!
* this gratuitous and somewhat awkward expression is me claiming to be
clever by quoting Lewis Carroll - if he isn't sick of me
baiting-the-hook, it might earn extra brownie-points (or another groan)
from @Chris...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
e written in the user's terms (those of the
"domain"). Thus, the easiest (and accuracy/consistency promoting) path,
is to maintain the use of that terminology/names all the way through
from spec to code.
Above also reduces my cognitive load - an appealing characteristic for
such a lazy "bear of little brain"...
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
osen there is less impetus on the
programmer to change it, "its not great but it'll do"
where as a nonsense name sticks out like a saw thumb until it is
corrected.
I am firmly undecided
--
Riches cover a multitude of woes.
-- Menander
--
https://mail.python.org/mailman/listinfo/python-list
unless it's easy
--
After a number of decimal places, nobody gives a damn.
--
https://mail.python.org/mailman/listinfo/python-list
On 30/10/2021 11.42, Shaozhong SHI wrote:
> Python script works well, but seems to stop running at a certain point when
> handling very large dataset.
>
> Can anyone shed light on this?
Storage space?
Taking time to load/format/process data-set?
--
Regards,
=dn
--
https://mai
logic.
YMMV!
Indeed some may wish to argue that the data-set includes unnecessary
verbiage, and that this in-and-of-itself might contribute to
cognitive-overload...
import this
>> So, the obvious solution is to ask the language, like Python, to allow
>> variables that are syno
file_path as-required.
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
;open"? Is it
$free? Are you free from 'surveillance'? Is the product as a whole,
"open-source"? Are you free (legally unencumbered) to modify (or even
read) the source-code of any/all MSFT 'improvements'?
VSCodium claims to be an "open source" version/equival
tra process-time and storage-allocation. (?)
Doesn't it already return a (evaluated) function? Remember: one is not
limited to Python built-in or PSL types. Thus:
def countdown():
return [ 10, 9, 8, 7, ..., "blast-off" ]
...
launch_commentary:list = field( default_factory=countdow
On 20/11/2021 03.38, lucas wrote:
> ok. all good advice. thank you for that. and with all that I've decided
> what to do.
>
> I'm going to close off any server-side python access so that I don't expose
> my server or the file system to vulnerabilities and/or won
point numbers), and particularly values
to the 'right' of a decimal-point; we had to study?suffer classes in
"Numerical Analysis" and be able to gauge the declining accuracy and
precision of sundry calculations. A skill disappearing as fast as
slide-rules!?
This 'pool of
On 20/11/2021 10.21, Chris Angelico wrote:
> On Sat, Nov 20, 2021 at 7:39 AM dn via Python-list
> wrote:
>>>> >>> 0.3 + 0.3 + 0.3 == 0.9
>>>> False
>>>
>>> That's because 0.3 is not 3/10. It's not because floats are
>>>
I have a C program that uses fork-execv to run Python 3.10 in a child process,
and I am using eventfd with epoll for IPC between them. The eventfd file
descriptor is created in C and passed to Python through execv. Once the Python
child process starts I print the file descriptor to verify
Thanks very much for your reply.
I am now getting a single event returned in Python, but it's not the right
event, as I'll explain below.
I rearranged the Python code based on your comments:
#!/usr/bin/python3
import sys
import os
import select
print("Inside Python&qu
that this good-looking boy has not missed the point about
"ugly".
Is this the problem, re-stated to be fully explicit, with (almost)
zero-complexity? [Zen of Python]
>>> x = [ "a", "b", "c", "d", "e" ]
>>> for y in [ 1,
ir purpose.
NB no mention of the output/return-value's specifics.
This format plays-nicely with the Python help() system and related.
Barely one year later the topic was advanced, with the more detailed
"PEP 287 -- reStructuredText Docstring Format"
(https://www.python.org/dev/peps
On 27/11/2021 19.11, Frank Millman wrote:
> On 2021-11-26 11:24 PM, dn via Python-list wrote:
>> On 26/11/2021 22.17, Frank Millman wrote:
>>> In my program I have a for-loop like this -
>>>
>>>>>> for item in x[:-y]:
>>> ... [do stuff]
a web-browser, the flags
appear, as desired.
Is this a terminal short-coming (locale charmap -> UTF-8 - which brings
to mind the old UCS-4 questions), a font issue, or what (to fix)?
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
Have you tried using Nuitka - rather than pyInstalller - it means you
distribute a single executable and the Python run time library (which
they probably have already), and it has the advantage that it is a bit
quicker than standard python.
Rather than bundle the source code and interpreter
On 26/11/2021 07:13, Ulli Horlacher wrote
But consider another possibility that your compiler software is compromised
Then https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe
is infected. I doubt this.
But you aren't using python3.10 to 'compile' the code to
On 29/11/2021 12.06, Cameron Simpson wrote:
> On 29Nov2021 09:19, Chris Angelico wrote:
>> On Mon, Nov 29, 2021 at 8:10 AM dn via Python-list
>> wrote:
>>> However, when trying the above, with our local flag in (Fedora Linux,
>>> Gnome) Terminal or PyCharm's
On 30/11/2021 07.43, Peter Mwale wrote:
> Hello Christian,
> Am referring to menu marked in picture below. It's not coming on my window.
>
>
> On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer wrote:
>
>> Am 26.11.21 um 21:38 schrieb Peter Mwale:
>>&
On 27/11/2021 21.23, Chris Angelico wrote:
> On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list
> wrote:
>> The expression list is evaluated once; it should yield an iterable
>> object. An iterator is created for the result of the expression_list.
>> The suite is the
7;s not to say there won't be considerably more who
manage to diagnose the problem without admitting such to 'the outside
world'!
There are times when there is no need to (wait quite a while to) boot-up
a whole IDE, eg running a utility program. I've nominated Kitty as
Fedora's default terminal. We'll see how it goes with work-loads beyond
raising the flag...
Salute!
--
Regards,
=dn
--
https://mail.python.org/mailman/listinfo/python-list
On 29/11/2021 10.08, dn via Python-list wrote:
> On 29/11/2021 02.18, Chris Angelico wrote:
>> On Mon, Nov 29, 2021 at 12:10 AM Abdur-Rahmaan Janhangeer
>> wrote:
>>
>> Flags are actually constructed from multiple codepoints. What you want
>> is to insert each
On 08/12/2021 09.45, Roland Mueller via Python-list wrote:
> Hello
>
> ti 7. jouluk. 2021 klo 19.47 vani arul (arulvan...@gmail.com) kirjoitti:
>
>> Hey There,
>> Can someone help to understand how a python function can return value with
>> using return in th
On 08/12/2021 11.07, Chris Angelico wrote:
> On Wed, Dec 8, 2021 at 9:04 AM dn via Python-list
> wrote:
>>
>> plus Python, unlike some other languages, allows us to return multiple
>> values, either as a collection or as an implied-tuple:
>>
>> def function_
Go on, I dare you to remind me that good-old 'dumb-terminals' didn't
have 'clipboards'...
(neither did they have to cope with Unicode, emoticons, or national flags!)
Accordingly, having developed an idea in the REPL (running within
Kitty), could not later copy-paste into
rr)-1):
> if arr[b]>arr[a+1]:
> arr[b],arr[a+1]=arr[a+1],arr[b]
> return arr
>
> arr=[3,5,9,8,2,6]
> print(selectionsort(arr))
This looks like a typical 'homework question'. Accordingly, we are happy
to help, but that means helping yo
Database
>
> - All functions mentioned above are to be deployed on the website
> pythonhow.com so make according to
> https://pythonhow.com/python-tutorial/flask/web-development-with-python-
and-flask/
>
> - Do you know any other websites to deploy a python web application??
&
Salaam Mahmood,
On 08/01/2022 12.07, Mahmood Naderan via Python-list wrote:
>I have a csv file like this
>V0,V1,V2,V3
>4,1,1,1
>6,4,5,2
>2,3,6,7
>
>And I want to search two rows for a match and find the column. For
>example, I want to searc
er will be
>> > entered/added in the Excel file table or sheet already made and the
>> > column name is BORROWER’S NAME.
>> >
>> Database!
>> > 4. The borrower’s or user name can be more than one so they will be
>> > separated with a comma in the E
otherwise CSV looks to me as fine. To do everything
> using CSV I will be requiring a tutorial to see how to do all this.
>
> Anything not clear?
Sql-lite is not essential to the task CSV would be sufficient, but you may
find that taking the time to learn it pays off later (even if you wait
untill after this project)
--
Trying to establish voice contact ... please yell into
keyboard.
--
https://mail.python.org/mailman/listinfo/python-list
dn
--
https://mail.python.org/mailman/listinfo/python-list
On 16/01/2022 09.56, Mahmood Naderan via Python-list wrote:
> Hi,
> I use the following line to write some information to a CSV file which is
> comma delimited.
>
> f = open(output_file, 'w', newline='')
> wr = csv.writer(f)
> ...
> f.write(str(n)
) writes the entire key in one column, but
> I would like to do the same with write(). Any idea to fix that?
>
>
> Regards,
> Mahmood
you need to quote the data
the easies way to ensure this is to inculde to QUOTE_ALL option when
opening the file
wr = csv.writer(output, quoting=csv.QUOTE_ALL)
--
Chocolate chip.
--
https://mail.python.org/mailman/listinfo/python-list
On 17/01/2022 22.31, Shaozhong SHI wrote:
> I got quite a few version of Python on my machine.
>
> How do I set environmental variables for Python 3.6.1 to work?
Set from Python, or set in the OpSys?
https://docs.python.org/3/library/os.html?highlight=environment%20variable
MS-W
epeat the essential data to identify a specific call in
>>all the logs of the function, so if it is called simultaneously by more
>>clients you can distinguish them
>>
>>> - How do you decide, which kind of log message goes into which level?
>>
>>It depends o
Hi,
I have recently started using venv for my hobby-programming. There
is an annoying problem. Since venv modifies $PATH, python programs
that use the "#!/usr/bin/env python" variant of the hashbang often
fail since their additional modules aren't install inside in venv.
How to p
ou only enter it when you actually want
> that specific python stack.
Well, it's not that I activate the venv *for* those troubling
programs. I activate it to work on the particular project. ;-)
> Get yourself a terminal that can either multiplex, or add something like
> tmux or screen
I'm currently considering a career change (not much choice actually just
been made redundant).
I'd like to be able to turn my interest in python to my advantage, What
qualifications do employers look for?
--
I'm reporting for duty as a modern person. I want to do the La
On Tue, 29 Mar 2022 20:49:53 -0400, Dennis Lee Bieber wrote:
> On Tue, 29 Mar 2022 19:26:03 - (UTC), alister
> declaimed the following:
>
>>I'm currently considering a career change (not much choice actually just
>>been made redundant).
>>I'd like to be
ernet.com
--
https://mail.python.org/mailman/listinfo/python-list
ntispam-Bot-for-
Telegram-0.2.0-GA.html
>
>
>
> INTRODUCTION
>
> eGenix has long been running a local user group meeting in Düsseldorf
> called Python Meeting Düsseldorf and we are using a Telegram group for
> most of our communication.
>
> In the early
Am 14.04.2022 um 17:02 schrieb Cecil Westerhof via Python-list:
> In C when you declare a variable static in a function, the variable
> retains its value between function calls.
> The first time the function is called it has the default value (0 for
> an int).
> But when the funct
Am 13.04.2022 um 20:39 schrieb Dennis Lee Bieber:
> On Thu, 14 Apr 2022 03:38:11 +1000, Tim Deke declaimed
> the following:
>
>> Dear Sir,
>>
>> I have successfully downloaded Python into my laptop but the shortcut icon
>> is not appearing on the desktop.
On Fri, 15 Apr 2022 10:18:33 -0700 (PDT), luca72.b...@gmail.com wrote:
> We are searching for someone that can develop a python program for use
> servomotor for automotive.
What location & what is the salary?
(although based on the method of recruitment I doubt that you will get
m
e Windows for myself since many years, but it is hard
for me to remember any software that did not add those shortcuts.
> right-click + create shortcut.
Right-click on what and where? On something called "IDLE" (has what
to do with python?). Right click on "python.exe" which gives s
t machine.
I am running Python 3.5.2.
I have tried uninstalling the software and reinstalling but no luck with that.
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, 20 Aug 2016 10:57:37 +1000, Chris Angelico wrote:
> On Sat, Aug 20, 2016 at 9:42 AM, Lawrence D’Oliveiro
> wrote:
>> Python 3.5.2+ (default, Aug 5 2016, 08:07:14)
>> [GCC 6.1.1 20160724] on linux
>> Type "help", "copyright",
On Sat, 20 Aug 2016 11:20:44 +1000, Chris Angelico wrote:
> On Sat, Aug 20, 2016 at 11:11 AM, Wildman via Python-list
> wrote:
>> Since I am fairly new to Python, I realize there is much that I
>> still don't know but I don't understand how Windows can have
>>
t have 8.x. I
would, however, expect the same result.
On Linux a file is created named con.txt that contains hello/n
as expected.
--
GNU/Linux user #557453
"The Constitution only gives people the right to
pursue happiness. You have to catch it yourself."
-Benjamin Franklin
--
https://mail.python.org/mailman/listinfo/python-list
rd?" I said "That is also a byte." He thought for a moment,
> then said "So the full word is 'byte byte'?"
LOL! Did you explain to him that a full word could also be
'nibble nibble nibble nibble' or 'bit bit bit bit bit bit
bit bit bit bit bit bit bit bit bit bit'?
--
GNU/Linux user #557453
The cow died so I don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, 05 Sep 2016 20:01:08 +, alister wrote:
> On Mon, 05 Sep 2016 12:46:58 -0700, emaraiza98 wrote:
>
>> I installed pycharm for a computer science class I'm taking, and also
>> downloaded python 3.5.2. However, my computer for some reason won't use
>>
On Tue, 06 Sep 2016 02:51:39 -0700, wxjmfauth wrote:
> It's curious to see all these apps, that were
> more of less working correctly up to Python 3.2
> (included) and are now no more working at all.
>
> Probably something wrong somewhere...
http://sebastian
On Wed, 07 Sep 2016 02:27:40 +1000, Chris Angelico wrote:
> On Wed, Sep 7, 2016 at 2:13 AM, Wildman via Python-list
> wrote:
>> On Tue, 06 Sep 2016 02:51:39 -0700, wxjmfauth wrote:
>>
>>> It's curious to see all these apps, that were
>>> more o
f here.
The following will insert 1 at the head of the list...
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> A=["1","2","3"]
gt; Patterns book by the so-called Gang of Four (GoF).
http://c2.com/cgi/wiki?GangOfFour
--
GNU/Linux user #557453
Keyboard not detected! Press any key to continue...
--
https://mail.python.org/mailman/listinfo/python-list
height - offsetBottom, 1)
>> MouseDown("Left")
>> EndIf
>> Next
>>EndIf
>> End
>>
>> Can someone help me please?
>
> Is observation this is not Python code
> it looks more like some variety of BASIC but I
On Tue, 18 Oct 2016 00:58:42 +0200, pozz wrote:
> I'm sorry, I know it is a FAQ..., but I couldn't find a good answer.
>
> I'm learning python and I'd like to start creating GUI applications,
> mainly for Windows OS. In the past, I wrote many applications in Vis
(self, _):
self.load_image()
Both the key bindings and the button click work. My question
is whether my workaround is the correct way? Could my key
binding code be wrong in some way? An insight appreciated.
--
GNU/Linux user #557453
May the source be with you.
--
https://mail.python.org/mailman/listinfo/python-list
gle method with a default argument that you ignore:
>
> def load_image(self, event=None):
> # code to load an image
That works perfectly. Thank you.
--
GNU/Linux user #557453
The cow died so I don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 20 Oct 2016 12:48:28 -0700, SS wrote:
> The following script works fine:
>
> #!/bin/python
>
> import socket
>
> str = raw_input("Enter a domain name: ");
> print "Your domain is ", str
> print socket.gethostbyname(str)
>
> You
On Thu, 20 Oct 2016 12:48:28 -0700, SS wrote:
> The following script works fine:
>
> #!/bin/python
I meant to include this with my other post but I forgot it.
Using a direct path to the Python interpreter can cause problems
on some systems because it is not always installed to
On Fri, 21 Oct 2016 16:14:41 +1100, Steve D'Aprano wrote:
> On Fri, 21 Oct 2016 11:03 am, Wildman wrote:
>
>> On Thu, 20 Oct 2016 12:48:28 -0700, SS wrote:
>>
>>> The following script works fine:
>>>
>>> #!/bin/python
>>
>&
On Sat, 22 Oct 2016 15:01:46 +, John Gordon wrote:
> In Wildman
> writes:
>
>> > Another serious problem with using env in the hash-bang line is that you
>> > cannot pass commandline options to the Python executable.
>
>> Not true. I made a test scr
pen a terminal in that directory and
enter this...
sudo python setup.py install
Here is a code example: (tested)
import getch
while something:
if getch.getch() == '\x1b':
break
--
GNU/Linux user #557453
May the Source be with you.
--
https://mail.python.org/mailman/li
Text(testo)
How i can pass the variable testo to the def test?
If i use :
self.timer.singleShot(1000, self.metto_testo(testo)
i get error
Thanks
--
https://mail.python.org/mailman/listinfo/python-list
I get () missing 1 required positional argument: 's'
--
https://mail.python.org/mailman/listinfo/python-list
thanks
--
https://mail.python.org/mailman/listinfo/python-list
dout.read in case you're getting
>> deadlocked. See the big red warning below
>> https://docs.python.org/3/library/subprocess.html#subprocess.Popen.stdout
Try this:
def umount(self):
'''unmounts VirtualDVD'''
cmd = ["gksudo", "umount", VirtualDVD
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
proc = p.communicate()
print proc
--
GNU/Linux user #557453
The cow died so I don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
s.python.org/3/library/subprocess.html#subprocess.Popen.stdout
>
> Try this:
>
> def umount(self):
> '''unmounts VirtualDVD'''
> cmd = ["gksudo", "umount", VirtualDVD]
^
> p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
> proc = p.communicate()
> print proc
Oops!
--
GNU/Linux user #557453
The cow died so I don't need your bull!
--
https://mail.python.org/mailman/listinfo/python-list
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. Below is the code I am using. S
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 c
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:
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
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
>
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 co
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
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
On Tue, 01 Nov 2016 16:23:08 +1100, Ben Finney wrote:
> 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 variab
>> are on a Linux system, enter this into a terminal to illustrate:
>>
>> sudo grep ^$USER\: /etc/shadow
>
> Bash is not involved here. Python is calling grep directly.
>
>
> You don't have to believe us, you can test this yourself. Create a simple
> text
1201 - 1300 of 6330 matches
Mail list logo