Manfred Lotz wrote:
> I have a function like follows
>
> def regex_from_filepat(fpat):
> rfpat = fpat.replace('.', '\\.') \
> .replace('%', '.') \
> .replace('*', '.*')
>
> return '^' + rfpat + '$'
>
>
> As I don't want to have the replace()
On 17Sep2019 15:09, Hongyi Zhao wrote:
See the following two methods for obtaining the file's path:
os.path.realpath(file)
or
os.path.abspath(os.path.expanduser(file))
Which is more robust?
They're probably equally robust (BTW, you need the expanduser in the
realpath call as well, if your f
On Tue, 17 Sep 2019 16:51:04 -0400
Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote:
> On 9/17/19 2:59 PM, Manfred Lotz wrote:
>
> > def regex_from_filepat(fpat):
> > rfpat = fpat.replace('.', '\\.') \
> >.replace('%', '.') \
> >.rep
In comp.lang.python, lampahome wrote:
> what I tried many times like enter password, but it failed.
> I just want to use ps.stdin.write(password) to send password, but it always
> jump password prompt immediately.
Passwords are frequently read from stderr, not stdin, so that tools can
get a huma
On Wed, Sep 18, 2019 at 6:51 AM Eli the Bearded <*@eli.users.panix.com> wrote:
>
> In comp.lang.python, moi wrote:
> > I hope, one day, for those who are interested in Unicode,
> > they find a book, publication, ... which will explain
> > what is UCS1.
>
> There isn't anything called UCS1. There
On 9/17/19 2:59 PM, Manfred Lotz wrote:
> def regex_from_filepat(fpat):
> rfpat = fpat.replace('.', '\\.') \
>.replace('%', '.') \
>.replace('*', '.*')
>
> return '^' + rfpat + '$'
>
> As I don't want to have the replace() functions in on
In comp.lang.python, moi wrote:
> I hope, one day, for those who are interested in Unicode,
> they find a book, publication, ... which will explain
> what is UCS1.
There isn't anything called UCS1. There is a UTF-1, but don't use it.
UTF-8 is better in every way.
https://en.wikipedia.org/wiki/U
On 17 Sep 2019 19:10:29 GMT
Martin Schöön wrote:
> I have installed a bunch of packages using pip install --user and
> I went for a non-standard location for the install. Now I regret
> this and would like to wipe this and start all over again using
> the standard location. Is it enough to delete
On Tue, 17 Sep 2019 20:59:47 +0200
Manfred Lotz wrote:
> I have a function like follows
>
> def regex_from_filepat(fpat):
> rfpat = fpat.replace('.', '\\.') \
> .replace('%', '.') \
Not related to my question but the second replace must be:
.replace(
I have installed a bunch of packages using pip install --user and
I went for a non-standard location for the install. Now I regret
this and would like to wipe this and start all over again using
the standard location. Is it enough to delete the folder I
specified or am I missing something? Having t
I have a function like follows
def regex_from_filepat(fpat):
rfpat = fpat.replace('.', '\\.') \
.replace('%', '.') \
.replace('*', '.*')
return '^' + rfpat + '$'
As I don't want to have the replace() functions in one line my
question is if it
Shame on me :-)
Thank you very much Ethan.
--
https://mail.python.org/mailman/listinfo/python-list
On 09/17/2019 09:45 AM, Eko palypse wrote:
else:
class FOO():
def __init__(self, metaclass=Singleton):
In your test code, the `metaclass=Singleton` should be in `class Foo`:
class FOO(metaclass=Singleton):
...
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/p
Using the following code in Python3.7 doesn't make FOO to be singleton anymore.
import sys
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args,
**kwargs)
See the following two methods for obtaining the file's path:
os.path.realpath(file)
or
os.path.abspath(os.path.expanduser(file))
Which is more robust?
--
https://mail.python.org/mailman/listinfo/python-list
On 2019-09-17, Ian Pilcher wrote:
> I am using a bytearray to construct a very simple message, that will be
> sent across the network. The message should always be 20 bytes:
>
>2 bytes - address family (AF_INET or AF_INET6) - network byte order
>2 bytes - (padding)
>4 or 16 bytes - IP
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Supersedes:
>
> MRAB writes:
>> >>> import re
>> >>> pattern = r'[0-9]{4,6}'
>> >>> pattern2 = r'[0-9][0-9][0-9][0-9]([0-9]){0,2}'
>> >>> re.search(pattern, '1234')
>>
>> >>> re.search(pattern2, '1234')
>>
>>They look the same to me.
>
> |>>> import
Am 17.09.19 um 12:41 schrieb Hongyi Zhao:
> Hi,
>
> Is some python tools to make a bootable usb and then using it to install
> the following dvd-iso into my harddisk:
>
> https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-10.1.0-
> amd64-DVD-1.iso
No python tool needed, just copy
Hi,
Is some python tools to make a bootable usb and then using it to install
the following dvd-iso into my harddisk:
https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-10.1.0-
amd64-DVD-1.iso
Regards
--
https://mail.python.org/mailman/listinfo/python-list
Thank you very much Stefan, I'll have a look at it.
Le 17/09/2019 à 01:37, Stefan Ram a écrit :
tracer( 0 )/update()
--
https://mail.python.org/mailman/listinfo/python-list
20 matches
Mail list logo