Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread Lele Gaifax
s import Counter >>> stmt = "cur.execute('''SELECT url FROM files WHERE url = %s''', ( fullpath, >>> )" >>> chars_count = Counter(stmt) >>> print("Number of '(': %d" % chars_count['(']) >>> pri

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Τη Τρίτη, 4 Ιουνίου 2013 9:18:29 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: >> Νικόλαος Κούρας writes: > >> >>> from collections import Counter >> >>> stmt = "cur.execute('''SELECT url FROM files WHERE url

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
n the specific case, your line 64 is missing an ending colon (":"). ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Lele Gaifax
standalone Python interpreter? Did you notice something strange, something like that an empty line is missing between headers and body? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
e/path" >>> path.replace('some', '') Traceback (most recent call last): File "", line 1, in TypeError: expected bytes, bytearray or buffer compatible object >>> path.replace(b'some', b'') b'/path&

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-06 Thread Lele Gaifax
Skip Montanaro writes: > He will get an extra blank line, since he added a newline character at > the end of his Content-Type string. Right, missed that, sorry for the noise. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | cominc

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
igning *constant* expressions to both variables, most probably not what you meant ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread Lele Gaifax
tool! *Read* the error message, *look* at the arrow (i.e. the caret character "^"), *understand* what that is trying to tell you... ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapens

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-07 Thread Lele Gaifax
ndications to your SyntaxErrors, you *must* learn how to detect and fix those by yourself. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Lele Gaifax
get garbage characters, mojibake, or errors. Uhm, no: "encode" transforms a Unicode string into an array of bytes, "decode" does the opposite transformation. You cannot do the former on an "arbitrary" array of bytes: >>> s = "νίκος" >&g

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Lele Gaifax
Νικόλαος Κούρας writes: > Τη Κυριακή, 9 Ιουνίου 2013 11:55:43 π.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: >> Uhm, no: "encode" transforms a Unicode string into an array of bytes, >> "decode" does the opposite transformation. You cannot do the former

Re: Encoding questions (continuation)

2013-06-10 Thread Lele Gaifax
. http://www.foxnews.com/story/0,2933,511177,00.html Or maybe his encoding algorithm needs some refinement :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it |

Re: Eval of expr with 'or' and 'and' within

2013-06-15 Thread Lele Gaifax
nth+year) == "k" in (name and month and year) > True > > so both seem to work as expected. That happens only by chance: it seems you now understand the evaluation of "boolean" expressions in Python, so the following should be clear to you: >>> "k"

Re: A certainl part of an if() structure never gets executed.

2013-06-15 Thread Lele Gaifax
result = emptylist or mylist >>> result.append('bar') >>> result is mylist True >>> print(mylist) ['foo', 'bar'] ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-16 Thread Lele Gaifax
ng something > different. It's measuring how much disk space the file is using. For > most files, that's the number of characters in the file rounded up to a > full block. I think “du -c” emits a number very close to “wc -c”. ciao, lele. -- nickname: Lele Gaifax | Qua

Re: PYTHONPATH and module names

2013-07-01 Thread Lele Gaifax
which under Python 2.7 is enabled by default, another thing is the behaviour, that is whether the interpreter will give priority to the sys.path. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi c

Re: Default scope of variables

2013-07-04 Thread Lele Gaifax
t;> à 1 :-) back to easily-enumerable issues, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Lele Gaifax
try: host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] except Exception as e: host = "Reverse DNS Failed" print(e) ? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas |

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-04 Thread Lele Gaifax
ut with that?? >>> a = 1/0 or 100 Traceback (most recent call last): File "", line 1, in ZeroDivisionError: division by zero >>> a Traceback (most recent call last): File "", line 1, in NameError: name 'a' is not def

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
except: host = "Reverse DNS Failed" ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
> error handler. You should almost never have a bare except. I know, that's why I added "(almost)", I was just trying to explain why he wasn't able to see the problem. Thanks for pointing out the difference, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
not callable",) Dave already told you the reason[1]. Νίκος, *read* **and** *understand* our *whole* answers to your questions, otherwise we are wasting time, you, and us! ciao, lele. [1] “… The other one is perhaps more subtle; I replaced square brackets with parentheses.” -- nickname: L

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
r(e) > >> which yields: TypeError("'_Environ' object is not callable",) > > Any thoufgs as to why os.environ('REMOTE_ADDR') gives the above error? Yes, I'd try to understand the error message, and eventually lookup the documentation on os.enviro

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
coder that tried to translate it to Unicode. As already explained, your immediate goal should be trying to understand from *where* that byte string is coming. I can't help on that, sorry. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | co

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
Νίκος Gr33k writes: > Στις 5/7/2013 1:59 μμ, ο/η Lele Gaifax έγραψε: >> Νίκος Gr33k writes: >> >>> UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3 >>> >>> but what string does it try to decode and jeeps failing? >> >>

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Lele Gaifax
vironment. As Νίκος discovered, when he "cloudfare" (whatever that means) his site, the REMOTE_HOST envvar contains some (I guess) latin-greek encoded string, and the remote address is carried by a different envvar... ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello

Re: GeoIP2 for retrieving city and region ?

2013-07-13 Thread Lele Gaifax
ovide your exact street address when signed the contract with your ISP, but now ask yourself: would you be happy if your ISP gives that kind of information to whomever may ask for it (in the specific case, a geolocation service like maxmind.com)? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò

Re: hex dump w/ or w/out utf-8 chars

2013-07-13 Thread Lele Gaifax
nt: what is the character at the caret position? I am convinced you are not conceptually understanding FST very well. Alternatively, you may have a strange notion of “impossible”. Or both. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincer

Re: RE Module Performance

2013-07-28 Thread Lele Gaifax
ce", I'd suggest *you* should find a better implementation and propose it to the core devs. An even better suggestion, with due respect, is to get a life and find something more interesting to do, or at least better arguments :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di

Re: Critic my module

2013-07-29 Thread Lele Gaifax
This thread did not mention alternative and existing modules with (almost) the same goal, two come to mind: * https://pypi.python.org/pypi/sh * https://pypi.python.org/pypi/sarge bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò

Re: Printing characters outside of the ASCII range

2012-11-11 Thread Lele Gaifax
get my head around all this codecs/unicode stuff. I > haven't had to deal with it until now but I'm determined to not let it > get the best of me :-) Two good readings on the subject: - http://nedbatchelder.com/text/unipain.html - http://www.joelonsoftware.com/articles/Unicode.html ciao,

Re: Using filepath method to identify an .html page

2013-01-22 Thread Lele Gaifax
t;> print _.hexdigest() acbd18db4cc2f85cedef654fccc4a4d8 Do yourself a favor and learn using the interpreter to test your snippets line by line, most problems will find an easy answer :-) ciao, lele. [1] http://docs.python.org/2.7/library/hashlib.html#module-hashlib -- nickname: Lele Gai

Re: Converting a number back to it's original string (that was hashed to generate that number)

2013-01-23 Thread Lele Gaifax
the corresponding "short" integer value. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: mysql solution

2013-01-24 Thread Lele Gaifax
ES (%s, %s) RETURNING (pin) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- http://mail.python.org/mailman/listinfo/python-list

Re: mysql solution

2013-01-24 Thread Lele Gaifax
Ferrous Cranus writes: > Τη Πέμπτη, 24 Ιανουαρίου 2013 1:25:20 μ.μ. UTC+2, ο χρήστης Lele Gaifax > έγραψε: Please, trim your response messages, cutting away useless details. > > I just tried this statement: > > == > cursor.ex

Re: mysql solution

2013-01-24 Thread Lele Gaifax
> [/code] How? What's the error message/traceback? If, as Chris said, MySQL does not support the “RETURNING” syntax, you cannot use that. I gave two different solutions in my previous message, did you try the “simplest” one? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quel

Re: mysql solution

2013-01-24 Thread Lele Gaifax
nters.page=%s) AND visitors.host=%s But I wonder about the "logic" here: why are you storing the "useros", "browser" and "date" in a table where the primary key seems to be ("pin", "host")? I mean, what happens if a user visits the same p

Re: newb question about @property

2017-10-03 Thread Lele Gaifax
ails of *where* a logger writes the messages are better left to a configuration done at another level :) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortu

Re: OT again sorry [Re: Interactive scripts (back on topic for once) [was Re: The "loop and a half"]]

2017-10-08 Thread Lele Gaifax
7;s difficult-to-impossible to get a one-size-fits-all configuration that satisfies everybody (where the cardinality of "everybody" exceeds 1, of course). ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura

Re: The "loop and a half"

2017-10-08 Thread Lele Gaifax
If it's just a matter of "finding one", look no further and try out Emacs's TRAMP :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it |

Re: why del is not a function or method?

2017-10-16 Thread Lele Gaifax
cs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list and the next one. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l

Re: choice of web-framework

2017-10-22 Thread Lele Gaifax
Chris Warrick writes: > Zope is effectively dead these days. Except it's alive and kicking: https://blog.gocept.com/ :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapen

Re: Compression of random binary data

2017-10-24 Thread Lele Gaifax
p3.zip.zip.zip", while the other would be "movie.avi.zip.zip.zip.zip.zip"... some sort of https://en.wikipedia.org/wiki/Water_memory applied to file system entries :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comin

Re: Invoking return through a function?

2017-10-29 Thread Lele Gaifax
he point, MacroPy! See https://github.com/azazel75/macropy for a 3.5+ version. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero,

Re: Easiest way to access C module in Python

2017-11-07 Thread Lele Gaifax
hon-36m-x86_64-linux-gnu.so $ python -c "import life; print(life.life())" 42 As other said, for a single function accepting no arguments and returning a single value Cython may be an heavy tool, but I bet you can imagine more complex situations... ciao, lele. -- nickname: Lele Gaif

Re: Easiest way to access C module in Python

2017-11-07 Thread Lele Gaifax
he case you mentioned, but obviously that function can very well come from a library. > People use languages like Python to get away from this stuff. Which people? The OP explicitly asked for a way to access a C module from Python, and Cython surely is one option to accomplish that. ciao, le

Re: Easiest way to access C module in Python

2017-11-07 Thread Lele Gaifax
fe.so >>> dir(life) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__test__', 'life'] Can you try to import the "life" module and print its "dir()" to see the symbols it expose

Re: SystemError: error return without exception set

2017-12-07 Thread Lele Gaifax
NULL. > > Mmm true. Forgot about that part. So, yes, that's a different type > of failure that could be happening. Makes the audit a bit harder. More probably the problem is not directly from a Python API, as most of the time when such APIs return NULL they also call PyErr_SetX

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Lele Gaifax
'spam', 'eggs', 7) \ == identity(('spam', 'eggs', 7)) \ == identity((('spam', 'eggs', 7),)) \ == identity'spam', 'eggs', 7),),)) should yield True? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Stackoverflow question: Is there a built-in identity function in Python?

2017-12-07 Thread Lele Gaifax
Chris Angelico writes: > On Fri, Dec 8, 2017 at 6:29 AM, Lele Gaifax wrote: >> Chris Angelico writes: >> >>> On Fri, Dec 8, 2017 at 5:53 AM, Peter Otten <__pete...@web.de> wrote: >>>> >>>> Hm, what does -- and what should -- >

Re: RegExp - please help me!

2017-12-27 Thread Lele Gaifax
ery/blob/43ce2e8cdf54e4e1e8b0352e37adbd72e568e100/src/postgres/include/nodes/parsenodes.h [4] https://github.com/lelit/pg_query/blob/master/pg_query/enums/parsenodes.py -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapen

Re: Generating SVG from turtle graphics

2018-01-11 Thread Lele Gaifax
http://pyx.sourceforge.net/ to produce the images for a book[1] on the Carrom game, and I enjoyed its simplicity. ciao, lele. [1] https://bitbucket.org/lele/cta -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi c

Re: Simple graphic library for beginners

2018-01-12 Thread Lele Gaifax
ling lucky" Google advices. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Right way to io.open(...) an existing file object in Python 2.7?

2018-01-16 Thread Lele Gaifax
Skip Montanaro writes: > I don't see any sort of "fdopen" or "freopen" equivalent mentioned in the io > module documentation. Is this possible in a clean way? > There is an os.fdopen(), so maybe newf = os.fdopen(fp.fileno()) ciao, lele. -- nickname: Lele G

Re: editor recommendations?

2021-03-03 Thread Lele Gaifax
Cameron Simpson writes: > My fingers know vim. Some others' fingers know emacs. Emacs has also an Evil[1] mode, that mimics some vi/vim features. I suggest taking a look at Doom Emacs[2], a popular so-called "Emacs distribution", that provides an out-of-the-box great experience with a modular c

Re: [RELEASE] Python 3.6.0b1 is now available

2016-09-13 Thread Lele Gaifax
ecall we had a very brief exchange on this at the time, and I event spent a few days trying a quick&dirty approach (basically passing also the ordered list of keywords...). Anyway, we are in a new millenium now, and two major versions forward! ;-) Thank you all, ciao, lele. -- nickname: Lele Ga

Re: ANN: dedent 0.5 released

2016-09-29 Thread Lele Gaifax
https://docs.python.org/3.6/library/textwrap.html#textwrap.dedent ? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
documentation (https://docs.python.org/3.6/library/re.html#re.sub) “unknown escapes [in the repl argument] such as \& are left alone”. Am I missing something, or is this a regression? In the meantime, I will alert the pgcli people. Thanks in advance, bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Peter Otten <__pete...@web.de> writes: > Lele Gaifax wrote: > >> The original intent is to replace spaces within a string with the regular >> expression \s+ (see >> ... >> Accordingly to the documentation >> (https://docs.python.org/3.6/library/re.htm

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Chris Angelico writes: > There's a shift as of 3.6 to make unrecognized alphabetic escapes into > errors, or at least warnings. But we are talking about raw strings here, specifically r'\s+'. I agree that with plain strings it's a plus. ciao, lele. -- nickname: Lel

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Lele Gaifax writes: > And the documentation as well, to clarify the fact immediately, without > assuming one will scroll down to the "changed in version" part (at least, that > is what seem the rule in other parts of the manual). Also, I'd prefer the "Changed in 3

Re: Different behaviour of regexp in 3.6.0b2

2016-10-14 Thread Lele Gaifax
Ned Batchelder writes: > On Friday, October 14, 2016 at 12:50:44 PM UTC-4, Lele Gaifax wrote: >> Chris Angelico writes: >> >> > There's a shift as of 3.6 to make unrecognized alphabetic escapes into >> > errors, or at least warnings. >>

Re: Different behaviour of regexp in 3.6.0b2

2016-10-15 Thread Lele Gaifax
Serhiy Storchaka writes: > Seems the documentation is not accurate. Could you file a report on > https://bugs.python.org/ ? Thank you everybody answered! Here it is: http://bugs.python.org/issue28450 ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ier

Re: f-string anomaly

2018-05-14 Thread Lele Gaifax
} >>> print(f'this is {k} and {v}') this is 1 and 2 >>> print(f'Email: {d:{{k}} {{v}}}') Traceback (most recent call last): File "", line 1, in NameError: name 'd' is not defined ciao, lele. -- nickname: Le

Re: f-string anomaly

2018-05-14 Thread Lele Gaifax
st recent call last): File "", line 1, in ValueError: Invalid format specifier Which Python version are you using? ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: f-string anomaly

2018-05-14 Thread Lele Gaifax
Ken Kundert writes: > Lele, > I am using Python3.6. d has to be an object of mydict. My bad, sorry, I completely missed the premise :-|. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi co

Re: syntax oddities

2018-05-17 Thread Lele Gaifax
top-posting? >> The answers that precede the questions >>> What's the most boring thing in e-mails? :-) ciao, lele. -- nickname: Lele Gaifax | Perché è contrario al normale senso di lettura real: Emanuele Gaifas | > Cosa c'è di male nel rispondere in cima? l...@metapensier

Re: functions vs methods

2018-07-21 Thread Lele Gaifax
is correct, why not make len also as a part of list > class itself? Yes, that's correct. For the reason, see https://docs.python.org/3/faq/design.html#why-does-python-use-methods-for-some-functionality-e-g-list-index-but-functions-for-other-e-g-len-list ciao, lele. -- nickname: Lele Gaifax

Re: Untrusted code execution

2016-04-08 Thread Lele Gaifax
Paul Rubin writes: > Lua is supposed to be easy to embed and sandbox. It might be > interesting to write Python bindings for the Lua interpreter sometime. Isn't this something similar to already existing https://pypi.python.org/pypi/lupa/? ciao, lele. -- nickname: Lele Gaifax | Q

Re: Anonymous hyperlinks in restructuredtext

2016-05-28 Thread Lele Gaifax
his helps, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Cython, producing different modules from the same .pyx

2019-12-19 Thread Lele Gaifax
n't find a way to alter that name. Did I miss something, or is the only way to duplicate the source .pyx file to a different name? Thanks in advance, ciao, lele. (*) https://github.com/lelit/pglast/blob/master/setup.py#L76 -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri

Re: Cython, producing different modules from the same .pyx

2019-12-20 Thread Lele Gaifax
Greg Ewing writes: > You could try creating a set of top-level .pyx stubs, each of > which just 'include' the real code. Thank you, will try this approach! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad a

Re: Cython, producing different modules from the same .pyx

2019-12-20 Thread Lele Gaifax
Ethan Furman writes: > If you don't get an answer here, you can try the Cython Users group: Thanks, reposted the same question there. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi

Re: Data model and attribute resolution in subclasses

2020-03-02 Thread Lele Gaifax
ve confused its meaning: >>> class Base: ... pass ... >>> class Derived(Base): ... pass ... >>> print(Base.__subclasses__()) [] ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò a

Strange namespace issue

2020-08-10 Thread Lele Gaifax
est" nor the name "cv" are defined... Thanks in advance for any enlightenment! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange namespace issue

2020-08-11 Thread Lele Gaifax
if callable(v): print(" a callable, returning", v()) else: print(" a value,", v) In this case, it would be less practical to determine what the script defined: by any chance this case is the first I wrote, and here the choice to pass the t

Re: Highlighting program variables instead of keywords?

2014-01-27 Thread Lele Gaifax
bout this. Dunno how far it has gone wrt Python support, but the following mode appeared in MELPA archives in the last couple of days: https://github.com/ankurdave/color-identifiers-mode hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | com

ur'foo' syntax under Python 3

2014-02-08 Thread Lele Gaifax
t just a glitch? thanks in advance, bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: ur'foo' syntax under Python 3

2014-02-08 Thread Lele Gaifax
Thank you Peter and Mark for the links. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python

Re: Python 3 virtualenvs

2015-11-29 Thread Lele Gaifax
n support on Debian systems, but I think Daniele is missing the package "pythonX.Y-venv": they install the needed stuff, and in particular /usr/bin/pyvenv-X-Y. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver p

Re: Unable to use python 3.5

2015-12-23 Thread Lele Gaifax
Chris Warrick writes: >> I am maters student in India, > > We don’t care (expect that you made a typo there). Oh, really? Surprisingly, he's not alone :-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad

netrc and password containing whitespace

2016-03-24 Thread Lele Gaifax
te = 'a' elif nextchar in self.quotes: if not self.posix: self.token = nextchar self.state = nextchar ... I was not able to lookup an exact definition of netrc's syntax, so I wonder: is the implementation somewhat flawed, or am I missing something? Thanks in a

Re: netrc and password containing whitespace

2016-03-24 Thread Lele Gaifax
netrc-xxx, and comes from net/netrc.el. Cfr. also https://www.emacswiki.org/emacs/GnusAuthinfo. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depe

Re: time.monotonic() roll over

2014-12-04 Thread Lele Gaifax
ed down too, and act accordingly? just-for-the-sake-of-arguing-ly, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange behavior with sort()

2014-02-26 Thread Lele Gaifax
* return the object they are applied (self that is). This works though: >>> box = [1,3,2] >>> sorted(box) == [1,2,3] True hth, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi m

Re: checking if two things do not equal None

2014-03-29 Thread Lele Gaifax
Steven D'Aprano writes: > if not (a is b is None): ... > > Or if you prefer: > > if a is not b is not None: ... >>> 1 is not 1 is not None False So definitely the former! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: E

Re: Unicode Chars in Windows Path

2014-04-04 Thread Lele Gaifax
Python\TestCases\list_dir_script.txt" > > or just use forward slashes: > > u"c:/automation_common/Python/TestCases/list_dir_script.txt" The latter should be preferred, in case Python3 compatibility is a goal. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di que

Re: .split() Qeustion

2013-08-15 Thread Lele Gaifax
) > True Yes, I bet in stupid languages that would be either a single character, or a tuple of two or more characters, much more usable and compact. > — > > PS A "mole" is not a number. Oh, nice to know. And OOC, what is a "mole" in your stupid science? OTOH, WTF

Re: .split() Qeustion

2013-08-15 Thread Lele Gaifax
MRAB writes: > On 15/08/2013 15:38, Lele Gaifax wrote: >> wxjmfa...@gmail.com writes: >>> PS A "mole" is not a number. >> >> Oh, nice to know. And OOC, what is a "mole" in your stupid science? >> OTOH, WTF does that matter in current th

Re: python3-sqlalchemy and debian repo

2013-08-22 Thread Lele Gaifax
Chris Angelico writes: > It may be that the -ext accelerator isn't available for Py3 in package > form, or it might be incorporated, I don't know. AFAICT, the Py3 accelerators will be available with SA 0.9. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho p

PyPI and TestPyPI registration problems

2013-08-25 Thread Lele Gaifax
from the underlying nginx... I was finally able to register an account with the "manual" method on the live site, but I'd prefer to learn the upload procedure on the test site... Are these known problems? Thanks in advance, bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quell

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-22 Thread Lele Gaifax
The actual syntax would be [object method: arg1 withSomething: arg2 withSomethingElse: arg3] and IMHO once you train your eyes the result is very readable, and closely resembles Python's keywords (and I took advantage of the similarity when I enjoyed developing PyObjC :) ciao, lele. -- nickna

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-23 Thread Lele Gaifax
Gregory Ewing writes: > Steven D'Aprano wrote: >> On Tue, 22 Oct 2013 09:38:16 +0200, Lele Gaifax wrote: >> >>>The actual syntax would be >>> >>> [object method: arg1 withSomething: arg2 withSomethingElse: arg3] >> >> I don't

Re: Retrieving possible list for use in a subsequent INSERT

2013-11-02 Thread Lele Gaifax
lue) VALUES (%s, %s)" % (myid, myvalue) >>> print(mysql) INSERT INTO sometable (theid, thevalue) VALUES (theid, Italy, Europe) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...

Re: Dict comprehensions - improvement to docs?

2015-03-17 Thread Lele Gaifax
=dict()" 1000 loops, best of 3: 0.113 usec per loop $ python3 -m timeit "d={}" 1000 loops, best of 3: 0.0601 usec per loop ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver p

Re: Strategies for using cffi with C++ code?

2015-05-22 Thread Lele Gaifax
Skip Montanaro writes: > I also figure there must be some established best practices for exposing C++ > classes to Python. Maybe http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html? bye, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele

Re: Camelot a good tool for me

2015-05-22 Thread Lele Gaifax
live in a very strange corner! ;-) ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

Re: Camelot a good tool for me

2015-05-22 Thread Lele Gaifax
Chris Angelico writes: > On Sat, May 23, 2015 at 3:24 AM, Lele Gaifax wrote: >> Laura Creighton writes: >> >>> In my corner of the world, everybody uses SQL. >>> [...] >>> The people who have tried SQLAlchemy really didn't like it, and of cou

Re: Camelot a good tool for me

2015-05-24 Thread Lele Gaifax
Chris Angelico writes: > On Sat, May 23, 2015 at 5:12 AM, Lele Gaifax wrote: >> You are conflating two different layers, core and ORM. ORM relationships can >> be declared either on the parent or on the child, it's up to your taste. > > Not sure why that's distin

Re: Camelot a good tool for me

2015-05-24 Thread Lele Gaifax
t;> type(res) >>> type(res[0]) >>> type(res[0].name) >>> type(res[0][0]) >>> res[0].name == res[0][0] True ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. l...@metapensiero.it | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list

  1   2   >