moi 在 2022年12月12日 星期一下午5:38:50 [UTC+8] 的信中寫道:
> >>> ast.literal_eval("r'\x7a'") == ast.literal_eval("r'z'")
> True
> >>> ast.literal_eval("r'\xe0'") == ast.literal_eval("r'à'")
> True
> >>> ast.literal_eval("r'\x9c'") == ast.literal_eval("r'œ'")
> False
>
> -
>
>
> >>> print(codec
> ./cl.py '^M
> '
> Input
> -
> - length 3
> 13 32 10
> From: Python-list on
> behalf of Jach Feng
> Date: Thursday, December 8, 2022 at 9:31 PM
> To: pytho...@python.org
> Subject: Re: How to convert a raw string r'xdd' to 'xdd' mo
moi 在 2022年12月9日 星期五晚上11:41:20 [UTC+8] 的信中寫道:
> PS C:\humour> py38 sysargwithliteral.py a\x0ab\x09c\x0a\x80uro\x0ax\x08z
> cp1252
> a
> b c
> €uro
> z
>
> PS C:\humour> $a = py38 sysargwithliteral.py a\x0ab\x09c\x0a\x80uro\x0ax\x08z
> cp1252
>
> PS C:\humour> licp($a)
> a U+0061
> b U+0
)
for c in args.data:
print(f'{ord(c)} ',end='')
print()
Using bash on Linux:
./cl.py '^M
'
Input
-
- length 3
13 32 10
From: Python-list on
behalf of Jach Feng
Date: Thursday, December 8, 2022 at 9:31 PM
To: python-list@python.org
Subject: Re: How to co
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道:
> s0 = r'\x0a'
> At this moment it was done by
>
> def to1byte(matchobj):
> return chr(int('0x' + matchobj.group(1), 16))
> s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
>
> But, is it that difficult on doing this simple thing?
>
>
Jach Feng 在 2022年12月7日 星期三上午10:23:20 [UTC+8] 的信中寫道:
> s0 = r'\x0a'
> At this moment it was done by
>
> def to1byte(matchobj):
> return chr(int('0x' + matchobj.group(1), 16))
> s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
>
> But, is it that difficult on doing this simple thing?
>
>
On 08/12/2022 02:17, Jach Feng wrote:
Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道:
On 07/12/2022 03:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
The original post started out with r'\x0a' but then talked about '\xdd'.
I assumed that there was a pattern here, a raw string containing "\x"
and two more characters, and made a suggestion for converting any string
with that pattern. But the OP was very unclear
chobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
exam(s0)
exam(s1)
---
examine \x0a
92 \
120 x
48 0
97 a
examine
10
From: Python-list on
behalf of Jach Feng
Date: Wednesday, December 7, 2022 at 9:27 PM
To: python-list@python.o
Peter Otten 在 2022年12月8日 星期四清晨5:17:59 [UTC+8] 的信中寫道:
> On 07/12/2022 03:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
> > B
Roel Schroeven 在 2022年12月7日 星期三下午4:42:48 [UTC+8] 的信中寫道:
> Op 7/12/2022 om 4:37 schreef Jach Feng:
> > MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> > > On 2022-12-07 02:23, Jach Feng wrote:
> > > > s0 = r'\x0a'
> > > > At this moment it was done by
> > > >
> > > > def to1byte(matchobj):
>
On 07/12/2022 03:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
>>> import codecs
>>>
Thomas Passin 在 2022年12月7日 星期三中午12:51:32 [UTC+8] 的信中寫道:
> On 12/6/2022 9:23 PM, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
>
Op 7/12/2022 om 4:37 schreef Jach Feng:
MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> On 2022-12-07 02:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9
On 12/6/2022 9:23 PM, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
--Jach
I'm not tota
MRAB 在 2022年12月7日 星期三上午11:04:43 [UTC+8] 的信中寫道:
> On 2022-12-07 02:23, Jach Feng wrote:
> > s0 = r'\x0a'
> > At this moment it was done by
> >
> > def to1byte(matchobj):
> > return chr(int('0x' + matchobj.group(1), 16))
> > s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
> >
> > But, is
On 2022-12-07 02:23, Jach Feng wrote:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
You could try this:
s0 = r'\x0a'
At this moment it was done by
def to1byte(matchobj):
return chr(int('0x' + matchobj.group(1), 16))
s1 = re.sub(r'\\x([0-9a-fA-F]{2})', to1byte, s0)
But, is it that difficult on doing this simple thing?
--Jach
--
https://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber writes:
> On Tue, 01 Mar 2022 08:35:05 +0100, Loris Bennett
> declaimed the following:
>
>>Thanks for the various suggestions. The data I need to store is just a
>>dict with maybe 3 or 4 keys and short string values probably of less
>>than 32 characters each per event. The tr
Robert Latest writes:
> Loris Bennett wrote:
>> Thanks for the various suggestions. The data I need to store is just a
>> dict with maybe 3 or 4 keys and short string values probably of less
>> than 32 characters each per event. The traffic on the DB is going to be
>> very low, creating maybe a
Loris Bennett wrote:
> Thanks for the various suggestions. The data I need to store is just a
> dict with maybe 3 or 4 keys and short string values probably of less
> than 32 characters each per event. The traffic on the DB is going to be
> very low, creating maybe a dozen events a day, mainly tr
Cameron Simpson writes:
> On 28Feb2022 10:11, Loris Bennett wrote:
>>I have an SQLAlchemy class for an event:
>>
>> class UserEvent(Base):
>> __tablename__ = "user_events"
>>
>> id = Column('id', Integer, primary_key=True)
>> date = Column('date', Date, nullable=False)
>> ui
On 28Feb2022 10:11, Loris Bennett wrote:
>I have an SQLAlchemy class for an event:
>
> class UserEvent(Base):
> __tablename__ = "user_events"
>
> id = Column('id', Integer, primary_key=True)
> date = Column('date', Date, nullable=False)
> uid = Column('gid', String(64), Foreig
On 1/03/22 6:13 am, Albert-Jan Roskam wrote:
I think you need a
BLOB.
https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.LargeBinary
That won't help on its own, since you still need to choose a
serialisation format to store in the blob.
I'd be inclined to use JSO
Albert-Jan Roskam wrote:
> The event may have arbitrary, but dict-like data associated with it,
> which I want to add in the field 'info'. This data never needs to be
> modified, once the event has been inserted into the DB.
>
> What type should the info field have? JSON, Pick
On Feb 28, 2022 10:11, Loris Bennett wrote:
Hi,
I have an SQLAlchemy class for an event:
class UserEvent(Base):
__tablename__ = "user_events"
id = Column('id', Integer, primary_key=True)
date = Column('date', Date, nullable=False)
Hi,
I have an SQLAlchemy class for an event:
class UserEvent(Base):
__tablename__ = "user_events"
id = Column('id', Integer, primary_key=True)
date = Column('date', Date, nullable=False)
uid = Column('gid', String(64), ForeignKey('users.uid'), nullable=False)
info
On 2020-10-19 06:24:18 -, Mladen Gogala via Python-list wrote:
> On Mon, 19 Oct 2020 02:44:25 +, Stefan Ram wrote:
> > Mladen Gogala writes:
> >>In Perl, there are no classes.
> >
> > If there are no classes in Perl, then what does
> >
> > bless REF,CLASSNAME
> >
> > do?
>
> bles
That's the first thing I thought of, though I would probably use a
> non-space character to avoid convusion when reading:
>
> mystr = r'abc\_'[:-1]
But it doesn't actually "end a raw string with a single backslash".
The compiler could be optimized for slic
On 2020-10-19, Stephen Tucker wrote:
> For a neatish way to get a string to end with a single backslash, how about
>mystr = r"abc\ "[:-1]
> (Note the space at the end of the rough-quoted string.)
That's the first thing I thought of, though I would probably use a
non-space character to avoid
f Serhiy Storchaka:
> > 13.10.20 11:52, Tony Flury via Python-list пише:
> >> I am trying to write a simple expression to build a raw string that ends
> >> in a single backslash. My understanding is that a raw string should
> >> ignore attempts at escaping characte
Op 13/10/20 om 15:14 schreef Serhiy Storchaka:
13.10.20 11:52, Tony Flury via Python-list пише:
I am trying to write a simple expression to build a raw string that ends
in a single backslash. My understanding is that a raw string should
ignore attempts at escaping characters but I get this
On Mon, Oct 19, 2020 at 5:26 PM Mladen Gogala via Python-list
wrote:
> bless \$ref will make the given reference a reference to the class. And
> classes is Perl
> are called "modules". However, Perl classes are not the classes in the real
> sense. There
> is no inheritance. You can have a simil
On Mon, 19 Oct 2020 02:44:25 +, Stefan Ram wrote:
> Mladen Gogala writes:
>>In Perl, there are no classes.
>
> If there are no classes in Perl, then what does
>
> bless REF,CLASSNAME
>
> do?
bless \$ref will make the given reference a reference to the class. And classes
is Perl
are
On 10/18/20 5:37 PM, Mladen Gogala via Python-list wrote:
> On Sun, 18 Oct 2020 12:19:18 -0600, Michael Torrie wrote:
>
>> Python certainly is procedural. A script starts at the top and executes
>> through to the bottom and ends, barring any flow control in the middle.
>> Like Perl you can use i
On Sun, 18 Oct 2020 12:19:18 -0600, Michael Torrie wrote:
> Python certainly is procedural. A script starts at the top and executes
> through to the bottom and ends, barring any flow control in the middle.
> Like Perl you can use it in many different ways and paradigms including
> OO if you desi
On 10/18/20 11:07 AM, Mladen Gogala via Python-list wrote:
> The fundamental
> difference between the two languages is that Perl is procedural while
> Python is a fully OO language. Discussion of Perl vs Python necessarily
> devolves into the discussion of procedural vs OO paradigms.
Python cert
On Sun, 18 Oct 2020 16:13:16 +0200, Peter J. Holzer wrote:
>
> Ah, I see, that the sillyness of Perl's grammar-altering modules (which
> let you write Perl in Latin (with proper declensions and conjugations,
> of course) or Chinese) has found its way to Python
>
To tell the truth, I only instal
On 2020-10-17 21:03:26 -, Mladen Gogala via Python-list wrote:
> On Thu, 15 Oct 2020 21:30:15 +, Stefan Ram wrote:
> > Tony Flury writes:
> >> >>> a = r'end' + chr(92)
> >
> > Or maybe,
> >
> > a = r'''
> > end\
> > '''[ 1: -1 ]
> >
> > ? The first and the last line are messy, but i
On Thu, 15 Oct 2020 21:30:15 +, Stefan Ram wrote:
> Tony Flury writes:
>> >>> a = r'end' + chr(92)
>
> Or maybe,
>
> a = r'''
> end\
> '''[ 1: -1 ]
>
> ? The first and the last line are messy, but in the middle,
> the intended string is clearly visible.
You can use perl module for
15.10.20 22:16, Roland Müller via Python-list пише:
> I used the triple single quotes as delimiter:
>
s = r'''a single quote ', a double quote "'''
s
>
> 'a single quote \', a double quote "'
It does not help if the string contains both kinds of triple quotes
You have to use triple
On 10/13/20 4:14 PM, Serhiy Storchaka wrote:
13.10.20 11:52, Tony Flury via Python-list пише:
I am trying to write a simple expression to build a raw string that ends
in a single backslash. My understanding is that a raw string should
ignore attempts at escaping characters but I get this
13.10.20 11:52, Tony Flury via Python-list пише:
> I am trying to write a simple expression to build a raw string that ends
> in a single backslash. My understanding is that a raw string should
> ignore attempts at escaping characters but I get this :
>
> >>> a = r
On 10/13/20, Tony Flury via Python-list wrote:
> I am trying to write a simple expression to build a raw string that ends
> in a single backslash. My understanding is that a raw string should
> ignore attempts at escaping characters but I get this :
>
> >>> a = r'
I am trying to write a simple expression to build a raw string that ends
in a single backslash. My understanding is that a raw string should
ignore attempts at escaping characters but I get this :
>>> a = r'end\'
File "", line 1
a = r'end\
On Thu, May 24, 2018 at 9:34 PM, Mikhail V wrote:
> Hi.
> I've put some thoughts together, and
> need some feedback on this proposal.
> Main question is: Is it convincing?
> Is there any flaw?
> My own opinion - there IS something to chase.
> Still the justification for such syntax is hard.
>
Th
On Sat, May 26, 2018 at 10:21 PM, Chris Angelico wrote:
>
> I'm done. Argue with brick walls for the rest of eternity if you like.
I see you like me, but I can reciprocate your feelings.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/
like REVERSE SOLIDUS?
> I'll also ask you a question -
> Which such non-text codes you may need to
> generate C code? Python code? HTML code?
What do you mean?
>> And we've gone from a single string literal, which is an expression that
>> can be used anywhere, to a
tation.
I'll also ask you a question -
Which such non-text codes you may need to
generate C code? Python code? HTML code?
>
> And we've gone from a single string literal, which is an expression that
> can be used anywhere, to a statement that cannot be used in expressions.
Ok show m
On Sat, 26 May 2018 18:22:15 +0300, Mikhail V wrote:
>> Here is a string assigned to name `s` using Python's current syntax:
>>
>> s = "some\ncharacters\0abc\x01\ndef\uFF0A\nhere"
>>
>> How do you represent that assignment using your syntax?
>
> Hope its not mandatory to decipher your random exam
'c'
>
> How do we write that piece of code using your syntax?
That's too easy - maybe you can try it yourself?
I am not trying to imply anything, but I don't see how
this example can cause problems - just put the TQS in a block.
>>> Would it then be possible
gt; workable scheme, and have a source file PROG1.PY which contains such
>> raw strings.
>>
>> Would it then be possible to create a source file PROG2.PY which
>> contains PROG1.PY as a raw string? That is, without changing the text
>> from PROG1.PY at all.
>
> Sh
r question.
> Another thing that might come up: suppose you do come up with a workable
> scheme, and have a source file PROG1.PY which contains such raw strings.
>
> Would it then be possible to create a source file PROG2.PY which contains
> PROG1.PY as a raw string? That is, wit
source file PROG1.PY which contains such raw strings.
Would it then be possible to create a source file PROG2.PY which
contains PROG1.PY as a raw string? That is, without changing the text
from PROG1.PY at all.
Here's one scheme I use in another language:
print strinclude "file.tx
Hi.
I've put some thoughts together, and
need some feedback on this proposal.
Main question is: Is it convincing?
Is there any flaw?
My own opinion - there IS something to chase.
Still the justification for such syntax is hard.
Raw string statement
--
Issue
-
On 23 April 2017 at 05:03, MRAB wrote:
> On 2017-04-22 23:30, Mikhail V wrote:
>>
>> On 20 April 2017 at 23:54, MRAB wrote:
>> > On 2017-04-20 22:03, Mikhail V wrote:
>> >>
>> >> On 20 April 2017 at 22:43, Random832 wrote:
>> >>> [snip]
>> >>>
>> >>> The best solution I can think of is to have a
On 2017-04-22 23:30, Mikhail V wrote:
On 20 April 2017 at 23:54, MRAB wrote:
> On 2017-04-20 22:03, Mikhail V wrote:
>>
>> On 20 April 2017 at 22:43, Random832 wrote:
>>> [snip]
>>>
>>> The best solution I can think of is to have a text editor designed to
>>> parse a string literal, spawn a nes
On Sun, Apr 23, 2017 at 12:30 PM, eryk sun wrote:
> The X terminals that I've used make it easy to copy text to the
> clipboard. For Windows, it's a pain prior to Windows 10 since the
> legacy console only does rectangular selection. The Windows 10 console
> does line-wrapped selection.
This is t
On Sun, Apr 23, 2017 at 2:06 AM, Mikhail V wrote:
>
> But are you joking, right? Even if it worked, how can this be convinient,
> e.g. in console one cannot even select and copy paste easily.
The X terminals that I've used make it easy to copy text to the
clipboard. For Windows, it's a pain prior
On Sun, Apr 23, 2017 at 12:06 PM, Mikhail V wrote:
> Don't know, all I see is "SyntaxError: invalid syntax" if I paste
> there some text.
> Try to paste e.g. this:
> "ffmpeg -i "D:\VIDEO\exp\intro.mp4" -vf "crop=1280:720:0:40,
> scale=640:360" -pix_fmt yuv420p "D:\ART\0MASTER_UMST\yt_pico.mp4""
On 23 April 2017 at 02:33, Chris Angelico wrote:
> On Sun, Apr 23, 2017 at 10:19 AM, Mikhail V wrote:
>> On 23 April 2017 at 00:48, Chris Angelico wrote:
>>> On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote:
The purpose is simple: reduce manual work to escape special
characters in str
On Sun, Apr 23, 2017 at 10:19 AM, Mikhail V wrote:
> On 23 April 2017 at 00:48, Chris Angelico wrote:
>> On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote:
>>> The purpose is simple: reduce manual work to escape special
>>> characters in string literals (and escape non-ASCII characters).
>>>
>>>
On 23 April 2017 at 00:48, Chris Angelico wrote:
> On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote:
>> The purpose is simple: reduce manual work to escape special
>> characters in string literals (and escape non-ASCII characters).
>>
>> Simple usage scenario:
>> - I have a long command-line stri
On Sun, Apr 23, 2017 at 8:30 AM, Mikhail V wrote:
> The purpose is simple: reduce manual work to escape special
> characters in string literals (and escape non-ASCII characters).
>
> Simple usage scenario:
> - I have a long command-line string in some text editor.
> - Copy this string and paste in
On 20 April 2017 at 23:54, MRAB wrote:
> On 2017-04-20 22:03, Mikhail V wrote:
>>
>> On 20 April 2017 at 22:43, Random832 wrote:
>>> [snip]
>>>
>>> The best solution I can think of is to have a text editor designed to
>>> parse a string literal, spawn a nested editor with the unescaped
>>> conten
On 2017-04-22 23:13, Mikhail V wrote:
> k = r"abc
> def"
>
> gives an error:
>
> k = r"abc
> ^
> SyntaxError: EOL while scanning string literal
>
> So one could define a rule, that a raw string *must*
> be terminated by th
On Sun, Apr 23, 2017 at 7:13 AM, Mikhail V wrote:
> So one could define a rule, that a raw string *must*
> be terminated by the sequence quote + newline.
> In theory.
Then how would you pass one as a function parameter?
func(r""
)
Ugh. Ugly.
ChrisA
--
https://mail
On 20 April 2017 at 18:40, Grant Edwards wrote:
> On 2017-04-20, Mikhail V wrote:
>> On 20 April 2017 at 17:59, Grant Edwards wrote:
>>> On 2017-04-20, Mikhail V wrote:
>>>> Quite often I need raw string literals for concatenating console commands.
>>>>
Tim Chase writes:
> On 2017-04-21 08:23, Jussi Piitulainen wrote:
>> Tim Chase writes:
>>> Bash:
>>> cat <>> "single and double" with \ and /
>>> EOT
>>>
>>> PS: yes, bash's does interpolate strings, so you still need to do
>>> escaping within, but the arbitrary-user-specified-delimiter ide
On 2017-04-21 08:23, Jussi Piitulainen wrote:
> Tim Chase writes:
>> Bash:
>> cat <> "single and double" with \ and /
>> EOT
>>
>> PS: yes, bash's does interpolate strings, so you still need to do
>> escaping within, but the arbitrary-user-specified-delimiter idea
>> still holds.
>
> If you
Tim Chase writes:
> A number of tools use a custom quote-string:
>
> Bash:
>
> cat < "single and double" with \ and /
> EOT
[snip]
> PS: yes, bash's does interpolate strings, so you still need to do
> escaping within, but the arbitrary-user-specified-delimiter idea still
> holds.
If you p
On 2017-04-21 01:11, Tim Chase wrote:
On 2017-04-20 16:40, Grant Edwards wrote:
How can there exist a "universal solution" even in theory?
There has to be some sort of "end of literal" terminator character
sequence. That means there has to be some sort of escaping
mechanism when that "end of l
On 2017-04-20 16:40, Grant Edwards wrote:
> How can there exist a "universal solution" even in theory?
>
> There has to be some sort of "end of literal" terminator character
> sequence. That means there has to be some sort of escaping
> mechanism when that "end of literal" sequence appears in the
On 2017-04-20 22:03, Mikhail V wrote:
On 20 April 2017 at 22:43, Random832 wrote:
On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote:
On 2017-04-20, MRAB wrote:
> There _is_ a "universal solution"; it's called a Hollerith constant. :-)
Wow, I haven't seen one of those in a _long_ time -- pr
On Fri, Apr 21, 2017 at 7:37 AM, Stefan Ram wrote:
> Mikhail V writes:
>>But the less probable it is, the more complex or ugly would the tag
>>become.
>>E.g. curly braces {} seems to be much less frequent characters
>>for filenames and command line arguments.
>
> When one uses brackets to delim
On 20 April 2017 at 22:43, Random832 wrote:
> On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote:
>> On 2017-04-20, MRAB wrote:
>> > There _is_ a "universal solution"; it's called a Hollerith constant. :-)
>>
>> Wow, I haven't seen one of those in a _long_ time -- probably about 45
>> years. I
On 20 April 2017 at 19:27, Chris Angelico wrote:
> On Fri, Apr 21, 2017 at 2:26 AM, wrote:
>> I find this:-
>>
>> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' "
>>
>> vastly superior.
>
> It's semantically different though. I don't know whether single quotes
> are valid in that context, on Wind
On Thu, Apr 20, 2017, at 16:01, Grant Edwards wrote:
> On 2017-04-20, MRAB wrote:
> > There _is_ a "universal solution"; it's called a Hollerith constant. :-)
>
> Wow, I haven't seen one of those in a _long_ time -- probably about 45
> years. I think the first FORTAN implementation I used was WA
On 2017-04-20, MRAB wrote:
> On 2017-04-20 17:40, Grant Edwards wrote:
>
>> There has to be some sort of "end of literal" terminator character
>> sequence. That means there has to be some sort of escaping mechanism
>> when that "end of literal" sequence appears in the literal itself.
>>
> There
On 2017-04-20 17:40, Grant Edwards wrote:
On 2017-04-20, Mikhail V wrote:
On 20 April 2017 at 17:59, Grant Edwards wrote:
On 2017-04-20, Mikhail V wrote:
Quite often I need raw string literals for concatenating console commands.
I want to input them exactly as they are in python sources
No escaping is not something possible, in your suggested syntax ") is
ambigous. E.g. raw("abcd")") is ambigous.
Any sequence delimited string involves escaping, the only thing that
wouldnt would be size-defined strings but they are impractical.
Le 20/04/2017 à 18:03, Mikhail V a écrit :
On 2
On Thu, Apr 20, 2017 at 5:27 PM, Chris Angelico wrote:
> On Fri, Apr 21, 2017 at 2:26 AM, wrote:
>> I find this:-
>>
>> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' "
>>
>> vastly superior.
>
> It's semantically different though. I don't know whether single quotes
> are valid in that context, o
On Fri, Apr 21, 2017 at 2:26 AM, wrote:
> I find this:-
>
> s = r"ffmpeg -i '\\server-01\D\SER_Bigl.mpg' "
>
> vastly superior.
It's semantically different though. I don't know whether single quotes
are valid in that context, on Windows.
ChrisA
--
https://mail.python.org/mailman/listinfo/pyth
On Thursday, April 20, 2017 at 4:59:48 PM UTC+1, Grant Edwards wrote:
> On 2017-04-20, Mikhail V wrote:
> > Quite often I need raw string literals for concatenating console commands.
> > I want to input them exactly as they are in python sources.
> >
> > There is r&qu
On 2017-04-20, Mikhail V wrote:
> On 20 April 2017 at 17:44, Mikhail V wrote:
>> Quite often I need raw string literals for concatenating console commands.
>> I want to input them exactly as they are in python sources.
>>
>> There is r"" string, but it is o
On 2017-04-20, Mikhail V wrote:
> On 20 April 2017 at 17:59, Grant Edwards wrote:
>> On 2017-04-20, Mikhail V wrote:
>>> Quite often I need raw string literals for concatenating console commands.
>>> I want to input them exactly as they are in python sources.
>>
On Fri, Apr 21, 2017 at 2:16 AM, Mikhail V wrote:
> On 20 April 2017 at 17:59, Grant Edwards wrote:
>> On 2017-04-20, Mikhail V wrote:
>>> Quite often I need raw string literals for concatenating console commands.
>>> I want to input them exactly as they are in pytho
On 20 April 2017 at 17:59, Grant Edwards wrote:
> On 2017-04-20, Mikhail V wrote:
>> Quite often I need raw string literals for concatenating console commands.
>> I want to input them exactly as they are in python sources.
>>
>> There is r"" string, but i
ecause I
wouldn't call ffmpeg this way. I'd do it like this:
cmd = ["ffmpeg", "-i", r"\\server-01\D\SER_Bigl.mpg"]
with the separate arguments as, well, separate arguments. Far less
need for double escaping that way, and you can use different escaping
rules for different arguments if you need to. (Actually, I usually use
forward slashes, so even raw string lits are unnecessary.)
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 20 April 2017 at 17:55, Chris Angelico wrote:
> On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V wrote:
>> What I think: why there is no some built-in function, for example like:
>> s = raw("ffmpeg -i "\\server-01\D\SER_Bigl__"")
>>
>> which would just need *one* quote sign in the beginning and on
On 2017-04-20, Mikhail V wrote:
> Quite often I need raw string literals for concatenating console commands.
> I want to input them exactly as they are in python sources.
>
> There is r"" string, but it is obviously not enough because e.g. this:
> s = r"ffmpeg -
On 20 April 2017 at 17:44, Mikhail V wrote:
> Quite often I need raw string literals for concatenating console commands.
> I want to input them exactly as they are in python sources.
>
> There is r"" string, but it is obviously not enough because e.g. this:
> s = r&
On Fri, Apr 21, 2017 at 1:44 AM, Mikhail V wrote:
> What I think: why there is no some built-in function, for example like:
> s = raw("ffmpeg -i "\\server-01\D\SER_Bigl__"")
>
> which would just need *one* quote sign in the beginning and on the end.
> Would it be useful, what do you think? I thin
Quite often I need raw string literals for concatenating console commands.
I want to input them exactly as they are in python sources.
There is r"" string, but it is obviously not enough because e.g. this:
s = r"ffmpeg -i "\\server-01\D\SER_Bigl.mpg" "
is not val
On 17/01/2014 16:45, Xaxa Urtiz wrote:
[masses of double spaced lines snipped]
Would you please read and action this
https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing the
double line spacing in your posts, thanks.
--
My fellow Pythonistas, ask not what our language can do
Le jeudi 16 janvier 2014 19:14:30 UTC+1, Neil Cerutti a écrit :
> On 2014-01-16, Xaxa Urtiz <> wrote:
>
> > Hello everybody, i've got a little problem, i've made a script
>
> > which look after some files in some directory, typically my
>
> > folder are organized like this :
>
> >
>
> > [share
On 2014-01-16, Chris Angelico wrote:
>> Hmmm... I might be doing too much in __init__. ;)
>
> Hmm, why is it even a class? :) I guess you elided all the
> stuff that makes it impractical to just use a non-class
> function.
I didn't remove anything that makes it obviously class-worthy,
just timest
On Fri, Jan 17, 2014 at 5:14 AM, Neil Cerutti wrote:
> class Miner:
> def __init__(self, archive):
> # setup goes here; prepare to acquire the data
> self.descend(os.path.join(archive, '*'))
>
> def descend(self, path):
> for fname in glob.glob(os.path.join(path, '*
On 2014-01-16, Xaxa Urtiz wrote:
> Hello everybody, i've got a little problem, i've made a script
> which look after some files in some directory, typically my
> folder are organized like this :
>
> [share]
> folder1
> ->20131201
> -->file1.xml
> -->file2.txt
> ->20131202
> -->file9696009.tmp
> --
Le jeudi 16 janvier 2014 17:49:57 UTC+1, Xaxa Urtiz a écrit :
> Hello everybody, i've got a little problem, i've made a script which look
> after some files in some directory, typically my folder are organized like
> this :
>
>
>
> [share]
>
> folder1
>
> ->20131201
>
> -->file1.xml
>
> --
1 - 100 of 229 matches
Mail list logo