Re: Object-oriented philosophy

2018-09-06 Thread Thomas Jollans
On 2018-09-06 17:40, Abdur-Rahmaan Janhangeer wrote: > Also, get someone, preferrable a python engineer to review your code. Does anyone here know anyone who would refer to themselves as a "Python engineer" with a straight face? I merely ask... -- Thomas -- https://mail.pytho

Re: ModuleNotFoundError: No module named 'encodings'

2018-09-06 Thread Thomas Jollans
eans your Python 3.7 build is broken, or it doesn't know where to look. Perhaps whatever it is you're actually passing to Py_SetPythonHome needs to be changed to point to the right place? (i.e. maybe you're giving it the location of the Python 3.6 library rather than the Python 3.

Re: ModuleNotFoundError: No module named 'encodings'

2018-09-07 Thread Thomas Jollans
On 2018-09-07 17:13, Jason Qian via Python-list wrote: > Thanks Thomas, > > You are right, this seems the Python home configuration issue. > > One more question. > > Is there a way I can catch the error ( Fatal Python error: initfsencoding: > ..) as exception in the c co

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-09 Thread Thomas Jollans
On 09/09/2018 02:20 PM, Gilmeh Serda wrote: # Python 3.6.1/Linux (acts the same in Python 2.7.3 also, by the way) from glob import glob glob('./Testfile *') ['./Testfile [comment] some text.txt'] glob('./Testfile [comment]*') [] glob('./Testfile [comment? some text.*') ['./Testfile [

Re: "glob.glob('weirdness')" Any thoughts?

2018-09-10 Thread Thomas Jollans
On 10/09/18 14:40, Max Zettlmeißl via Python-list wrote: On Sun, Sep 9, 2018 at 6:03 PM, Thomas Jollans wrote: https://docs.python.org/3/library/glob.html#glob.escape demonstrates a way of escaping that works: glob('./Testfile [[]comment]*') That is about the least correct workin

Re: GUI, Python2.7- how to build a loop with a button + textbox

2018-09-12 Thread Thomas Jollans
On 12/09/18 04:51, alon.naj...@gmail.com wrote: hi, on python 2.7 Please use Python 3. how do I build a loop with a button + textbox? There are many GUI libraries. Tkinter is part of the standard library and appears to be well-documented. https://docs.python.org/3/library/tkinter.html A

Re: getfqdn passes a hostname to gethostbyaddr instead of an ip address

2018-09-12 Thread Thomas Jollans
On 12/09/18 16:29, Florian Bergmann wrote: On the other hand I feel given the documentation, passing the `ip_address` would be the right thing to do, so I am wondering if I am missing something very obvious here (especially given that the code seems to be unchanged for 18 years). Whatever the do

Add header at top with email.message

2018-09-14 Thread Thomas Schneider
Hi, the EmailMessage class of email.message provides the methods add_header() and __setitem__() to add a header to a message. add_header() effectively calls __setitem__(), which does `self._headers.append(self.policy.header_store_parse(name, val))`. This inserts the header at the bottom. It is,

Re: Trying to use threading.local()

2018-09-14 Thread Thomas Jollans
imal.html#decimal.localcontext -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Image processing libraries in python

2018-09-14 Thread Thomas Jollans
(e.g. astronomy) there are also more specialized packages that may help. In short, if you images are pictures, have a look at Pillow. If your images are data, have a look at scikit-image, scipy.ndimage, and maybe more specialized packages like OpenCV or astropy. -- Thomas -- https://mail.pyt

Re: Add header at top with email.message

2018-09-17 Thread Thomas Schneider
Jason Friedman writes: > I suppose you already figured out that you can call __delitem__() to > clear the headers and add them back in whatever order you like. Well, this would mean saving all headers, deleting all, inserting my own, and adding the saved original headers again. Seems complicate

Re: transform a "normal" decorator in one for async functions

2018-09-18 Thread Thomas Jollans
On 2018-09-18 16:20, vito.detul...@gmail.com wrote: > but I cannot rewrite this library. Perhaps not, but surely you can write your own decorator that does whatever this library's decorator does for async functions? Presumably you have the code... > is there a way to "convert" a "normal" decorato

Re: Permutations using a recursive generator

2018-09-18 Thread Thomas Jollans
On 2018-09-18 17:05, ast wrote: > Le 18/09/2018 à 17:01, ast a écrit : >> Hello >> >> I found a smart and very concise code to >> generate all permutations of a list. >> I put it here if someone is interested to >> figure out how it works When you say "found a [...] code" I hope you mean "wrote a

Re: Serializing complex objects

2018-09-21 Thread Thomas Jollans
On 21/09/2018 20:44, Joseph L. Casale wrote: -Original Message- From: Python-list On Behalf Of Rhodri James Sent: Friday, September 21, 2018 11:39 AM To: python-list@python.org Subject: Re: Serializing complex objects Depending on what exactly your situation is, you may be able to use

Re: Multiple problems with Python 3.7 under Windows 7 Home Premium

2018-09-21 Thread Thomas Jollans
(actually, I don't think anybody really needs these any more, do they?) WINDOWS APP CERTIFICATION KIT   Somehow, I got a notice to try "Windows App Certification Kit 10.0.17134.12". What? Why? What is this? I don't even. Cheers Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: What is not working with my "map" usage?

2018-09-21 Thread Thomas Jollans
to lend you a hand. That should help you understand what the difference between the two cases is, and what map() is doing. Good luck! Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: What is not working with my "map" usage?

2018-09-22 Thread Thomas Jollans
On 22/09/2018 20:18, Victor via Python-list wrote: On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote: Victor via Python-list wrote: Let me use a different input args and display them below. Basically, I am hoping to add up all elements of each nested list. So at first it

Re: Problema na DLL

2018-09-22 Thread Thomas Jollans
On 22/09/2018 19:28, Allan Sobrero wrote: Olá, estou tendo problemas para executar o Python, baixei a versão 64 bit pois nas configurações de meu computador mostra 64x, porém na hora de executar diz que não tenho o api-ms-win-crt-runtime-l1-1-0.dll https://support.microsoft.com/pt-pt/help/2999

Re: compiling 3.7.0 from source with custom libffi path

2018-09-24 Thread Thomas Jollans
On 2018-09-24 10:48, Fetchinson . via Python-list wrote: > I'm trying to compile python 3.7.0 from source with a custom libffi > path and the compiler/linker doesn't seem to pick up the right > version. The system libffi doesn't have the development files so I've > installed the latest libffi (also

Re: compiling 3.7.0 from source with custom libffi path

2018-09-24 Thread Thomas Jollans
On 2018-09-24 14:14, Fetchinson . via Python-list wrote: >>> I'm trying to compile python 3.7.0 from source with a custom libffi >>> path and the compiler/linker doesn't seem to pick up the right >>> version. The system libffi doesn't have the development files so I've >>> installed the latest libf

Re: Need to find the centroid of a circular camera image

2018-09-24 Thread Thomas Jollans
On 2018-09-24 16:52, Gene Heskett wrote: > On Sunday 23 September 2018 16:24:23 Oscar Benjamin wrote: > >> On Sun, 23 Sep 2018 at 20:45, Gene Heskett > wrote: >>> save the image and locate the centroid of that saved image. >>> >>> Is there code to do that centroid math in somebodies "bottom desk

Re: compiling 3.7.0 from source with custom libffi path

2018-09-24 Thread Thomas Jollans
On 2018-09-24 16:30, Fetchinson . via Python-list wrote: > [fetch@fetch]$ grep LIBFFI_INCLUDE Makefile > LIBFFI_INCLUDEDIR= /opt/custom/lib/libffi-3.2.1/include > > So I'd say everything should work but it doesn't, I reran ./configure > and also make of course. I'm confused. ./configure succ

Re: [OT] master/slave debate in Python

2018-09-24 Thread Thomas Jollans
On 24/09/2018 14:52, Robin Becker wrote: On 23/09/2018 15:45, Albert-Jan Roskam wrote: *sigh*. I'm with Hettinger on this. https://www.theregister.co.uk/2018/09/11/python_purges_master_and_slave_in_political_pogrom/ I am as well. Don't fix what is not broken. The semantics (in programming)

Re: [OT] master/slave debate in Python

2018-09-25 Thread Thomas Jollans
Victor's anonymous source? Isn't that a bit harsh, considering you know nothing about them? Some unspecified possible future threat? Now this seems more likely, but it's also rather silly, don't you think? All the best, Thomas PS: I'm not a great fan of it, but I think

Re: clever exit of nested loops

2018-09-27 Thread Thomas Jollans
On 2018-09-26 21:06, Mark Lawrence wrote: > > To me the Ned Batchelder presentation > https://www.youtube.com/watch?v=EnSu9hHGq5o "Loop like a Native" is the > definitive way on how to deal with loops in Python. > Hear, hear. Great talk. -- https://mail.python.org/mailman/listinfo/python-list

Re: ipython and prompt-toolkit

2018-09-27 Thread Thomas Jollans
On 27/09/2018 07:14, Cecil Westerhof wrote: For a long time I cannot update prompt-toolkit, because ipython requires a version lower as 2. That is why I still use 1.0.15 instead of 2.0.4. Any chance that ipython will be updated concerning this dependency? Well this is an interesting coincidenc

Re: How to change '\\' to '\'

2018-10-01 Thread Thomas Jollans
>>>    "\\Borland\\Bcc55\\Include" >>> >>> Or this? >>> >>>    "/Borland/Bcc55/Include" >>> >>> ??? >>> >>> >> >> Practicality Beats Purity >> >> >> >> > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > -- Thomas Jollans m ☎ +31 (6) 42630259 e ✉ t...@tjol.eu -- https://mail.python.org/mailman/listinfo/python-list

Re: python not working on RHEL6

2018-10-02 Thread Thomas Jollans
to install it through the software collections mechanism: https://www.softwarecollections.org/en/scls/rhscl/python27/ Better yet, forget about Python 2.7 and use Python 3.7 (or 3.6, which is available as an SCL) > > I guess from the little knowledge I have I should have executed altinst

Re: Querying MariaDB from python

2018-10-02 Thread Thomas Jollans
On 2018-10-02 18:07, Tony van der Hoff wrote: > On 02/10/18 16:47, Ervin Hegedüs wrote: >> hi, >> >> now rows will looks like this: >> ({'id':...,...},{'id':...,}...) > > Thanks Ervin, but: > >cursor = cnx.cursor(pymysql.cursors.DictCursor) > NameError: name 'pymysql' is not defined > > I ha

Re: python not working on RHEL6

2018-10-02 Thread Thomas Jollans
On 02/10/2018 19:22, Dan Purgert wrote: Thomas Jollans wrote: [...] (preferably, not in /usr - that's for OS-installed files only. /usr/local is a nice place to put things you installed from source). While I agree that /usr(/bin) is incorrect, I believe that "for OS-installed file

Re: python not working on RHEL6

2018-10-03 Thread Thomas Jollans
On 03/10/2018 13:17, Chris Angelico wrote: On Wed, Oct 3, 2018 at 9:11 PM Dan Purgert wrote: Chris Angelico wrote: On Wed, Oct 3, 2018 at 5:17 AM Thomas Jollans wrote: [...] Whether we agree on the terminology here or not, of course we can agree that you have to be bloody careful if you

Re: Calling an instance method defined without any 'self' parameter

2018-10-04 Thread Thomas Jollans
'yo!') ... >>> A.foo >>> A.foo() yo! >>> > > Python 2.7 > There is a way in Python 2 as well, and I'm sure someone else will demonstrate. I won't. It's easy enough to discover if you know that it should exist. I'll just tell you that Python 3 is much nicer: Python 3 is much nicer. Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating dice game : NEED HELP ON CHECKING ELEMENTS IN A LIST

2018-10-06 Thread Thomas Jollans
On 06/10/2018 20:10, eliteanarchyra...@gmail.com wrote: # - THIS LINE IS WHERE I NEED HELP # ( if 2, 3, 4, 6 in list: ) print("you can roll again") else: print("you have all 1's and 5's in your result") You can use a loop: for good_number in [2,3,4,6]: if good_number in

Re: Python indentation (3 spaces)

2018-10-08 Thread Thomas Jollans
On 08/10/2018 03:13, Gene Heskett wrote: On Sunday 07 October 2018 19:20:57 Dennis Lee Bieber wrote: On Sun, 7 Oct 2018 14:19:15 -0400, Gene Heskett declaimed the following: But that automatically assumes one is running in a windows environment. I don't allow it on the premises if I own the

Re: Python indentation (3 spaces)

2018-10-08 Thread Thomas Jollans
On 08/10/2018 08:31, Marko Rauhamaa wrote: Chris Angelico : How wide my indents are on my screen shouldn't influence your screen or your choices. Where I work (and at home), the only control character that is allowed in source code is LF. No tolerance for form feeds? -- https://mail.python

Re: My environment doesn't load

2018-10-09 Thread Thomas Jollans
On 09/10/2018 09:20, f...@lutix.org wrote: Hello, I have rsynced a folder on my distant server. Now I try to source my environment: source ./env/bin/activate and nothing happens. When type > which python, /usr/bin/python is still printed. What could be the issue? Thanks What shell are you

Re: My environment doesn't load

2018-10-09 Thread Thomas Jollans
uess that copying an environment is not "creating" it remotely. > However it works in a certain point of view because apache can find it an use > it as python-path is set for my WSGI Daemon Process. > DOn't understand... > > > October 9 2018 10:18 AM, "Thoma

Re: Python on 10.14 Mojave

2018-10-10 Thread Thomas Jollans
On 2018-10-10 14:52, Kevin Walzer wrote: > I'm trying to build Python 3.7.0 on macOS 10.14, and Tkinter is not > linking to my installation of Tcl/Tk 8.6.8 in /Library/Frameworks. > Instead it is linking to the ancient 8.5 Tk installed in > /System/Library/Frameworks. My usual way of forcing Python

Re: From Mathematica to Jypyter

2018-10-10 Thread Thomas Jollans
On 10/10/2018 23:32, Gregory Ewing wrote: Rhodri James wrote: I'm a great fan of erroneous spelling and this blog needs a spelling check as this quote shows "Mathematica exemplifies the horde of new Vandals whose pursuit of private gain threatens a far greater pubic loss–the collapse of soci

Re: From Mathematica to Jypyter

2018-10-10 Thread Thomas Jollans
On 11/10/2018 01:26, Chris Angelico wrote: On Thu, Oct 11, 2018 at 10:09 AM Thomas Jollans wrote: On 10/10/2018 23:32, Gregory Ewing wrote: Rhodri James wrote: I'm a great fan of erroneous spelling and this blog needs a spelling check as this quote shows "Mathematica exemplifies

Re: ESR "Waning of Python" post

2018-10-11 Thread Thomas Jollans
On 11/10/2018 09:11, Ben Finney wrote: Chris Angelico writes: In actual fact, it's not a problem per-se. It's a design choice, and every alternative choice tried so far has even worse problems. THAT is why we still have it. That reads to me like a rejection of the point made in the blog post

Re: From Mathematica to Jypyter

2018-10-11 Thread Thomas Jollans
On 2018-10-11 10:48, jfine2...@gmail.com wrote: > It is fun to find fault in the work of a new Nobel laureate. In this case, a > typo. Not a Nobel laureate. It's not a Nobel prize. > > However, I'm disappointed that no-one has picked up the other error. Someone > posted to this thread "the #me

Re: how to replace line on particular line in file[no need to write it back whole file again]

2018-10-11 Thread Thomas Jollans
On 2018-10-11 11:44, Iranna Mathapati wrote: > Hi Team, > > How to replace particular line text with new text on a file > i have below code but its writing whole code. > > def replace_line(file_name, line_num, text): > lines = open(file_name, 'r').readlines() > lines[line_num] = text >

Re: Single DB connection during class's lifetime. Metaclass, singleton and __new__() examples and references.

2018-10-12 Thread Thomas Jollans
On 12/10/2018 01:19, Ryan Johnson wrote: I am working on using mysql.connector in a class and have found an example of how to create a single connection that spans the lifetime of all instances of the class: https://softwareengineering.stackexchange.com/a/358061/317228 however, I do not under

Re: Quickest way to concatenate strings

2018-10-12 Thread Thomas Jollans
On 12/10/2018 07:55, Frank Millman wrote: Hi all I have often read that the quickest way to concatenate a number of strings is to place them in a list and 'join' them -    C:\Users\User>python -m timeit -s "x='a'*500; y='b'*500; z='c'*500" ''.join([x, y, z])    50 loops, best of 5: 30

Re: Is this mailbox manipulation working by luck, or can't I understand my own code?

2018-10-13 Thread Thomas Jollans
On 13/10/2018 18:28, Chris Green wrote: Stefan Ram wrote: Chris Green writes: msg.get You can get some information about »get«: print( "msg.get.__doc__ =", msg.get.__doc__ ) print( "msg.get.__func__ =", msg.get.__func__ ) print( "msg.get.__self__ =", msg.get.__self__ ) print( "msg.get._

Email parsing and unicode/utf8

2018-10-15 Thread Thomas Jollans
of the docs suggests, the utf8 flag does nothing at all when parsing. Just to check that this was in fact a perfectly valid email: >>> bfp = email.parser.BytesFeedParser(policy=pol) >>> bfp.feed(msg.encode('utf-8')) >>> msg_objb = bfp.close() >>> print(msg_objb.get_content()) ¡This message contains two (٢) non-ASCII characters! >>> print(msg_objb['Subject']) ¿Will it parse? Нет. BytesFeedParser is happy. Question: Is this a bug? Am I missing something? Does the clause in the docs about utf8 mean anything? Cheers Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Questions about weakref

2018-10-16 Thread Thomas Jollans
l of this for you, like PySignal. I believe all the pure-Python signal/slot libraries use weakrefs internally. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Package creation documentation?

2018-10-16 Thread Thomas Jollans
packages, and most packages come in packages. Some packages just contain modules, and some packages are not packaged, though. I would like to apologize for the previous paragraph. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: SSHLibrary (PyNaCl and Cryptography) inst for Python 3.6.4 in Windows 10

2018-10-17 Thread Thomas Jollans
On 2018-10-17 16:41, Saila wrote: > Hi > Has somebody been able to install SSHLIbrary from sources (all libs with > offline installations) on virtual Win 10 for Python 3.6.4? > > Python 3.6.4 ... [MSC v. 1900 64 bit (AMD 64)] > > Also Microsoft Visual Studio 2017 is installed (also vc_redist.x64

Re: SSHLibrary (PyNaCl and Cryptography) inst for Python 3.6.4 in Windows 10

2018-10-18 Thread Thomas Jollans
On 18/10/2018 08:28, Saila wrote: > keskiviikko 17. lokakuuta 2018 20.18.55 UTC+3 Thomas Jollans kirjoitti: >> Can't you just install it with pip? >> >> py -3 -m pip install PyNaCl > > That is not possible because there isn't connection to www in development

Re: Twython has a problem with latest urllib3

2018-10-18 Thread Thomas Jollans
On 2018-10-18 11:30, Cecil Westerhof wrote: > I use Twython to post on Twitter. Yesterday I upgraded urllib3 from > 1.23 to 1.24. Since then when I do: > from twython import Twython > > I get: > /usr/local/lib/python3.5/dist-packages/requests/__init__.py:91: [...]

Re: PEP 394

2018-10-19 Thread Thomas Jollans
On 2018-10-19 12:06, Marko Rauhamaa wrote: > Anders Wegge Keller : >> * python2 will refer to some version of Python 2.x. > > Untrue for macOS. > >> * python3 will refer to some version of Python 3.x. > > Untrue for macOS, ArchLinux, RHEL and CentOS. Sure it's true for *EL (it's just that pytho

Re: PEP 394

2018-10-19 Thread Thomas Jollans
On 19/10/2018 18:38, Marko Rauhamaa wrote: > Thomas Jollans : > >> On 2018-10-19 12:06, Marko Rauhamaa wrote: >>> Anders Wegge Keller : >>>> * python3 will refer to some version of Python 3.x. >>> >>> Untrue for macOS, ArchLinux, RHEL and C

Re: email automation

2018-10-23 Thread Thomas Jollans
On 22/10/2018 18:35, Brian Oney via Python-list wrote: > Dear List, > > I would like to send out custom automated replies to email. In the future, I > would like to be able to integrate nltk and fuzzy matching if necessary. > > After some basic research I have a few options: > > 1. Grapple

Re: email automation

2018-10-23 Thread Thomas Jollans
On 2018-10-23 13:58, Brian J. Oney via Python-list wrote: > Now that it seems that I will be writing this. What is the recommended way to > set up a timer. I know 2 system options, systemd timers and cron jobs. I > prefer the former for the handy logging options. What about a python solution? cele

Re: Function factory?

2018-10-24 Thread Thomas Jollans
On 2018-10-24 10:58, f...@lutix.org wrote: > if check_file(path,file_name): > return True > else: > return False Replace this with a simple return check_file(path, file_name) and now your functions share one line, and one that simply calls another function at that. -

Re: recommends of redesign OO feature of python !!!

2018-10-25 Thread Thomas Jollans
On 2018-10-25 07:14, iamybj--- via Python-list wrote: > Using dictionary as data model is the 20th century style, [citation needed] -- https://mail.python.org/mailman/listinfo/python-list

Re: regular expression problem

2018-10-28 Thread Thomas Jollans
On 28/10/2018 22:04, Karsten Hilbert wrote: > - options needs to be able to contain nearly anything, except '::' > > Is that sufficiently defined and helpful to design the regular expression ? so options isn't '.*', but more like '(:?[^:]+)*' (Figuring out what additional restriction this imposes

Re: regular expression problem

2018-10-28 Thread Thomas Jollans
On 28/10/2018 22:04, Karsten Hilbert wrote: > - options needs to be able to contain nearly anything, except '::' Including > and $ ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Accessing clipboard through software built on Python

2018-10-28 Thread Thomas Jollans
On 27/10/2018 20:50, Musatov wrote: > On Saturday, October 27, 2018 at 11:12:35 AM UTC-5, Marko Rauhamaa wrote: >> Michael Torrie : >>> As far as I know it's not possible for an application to directly yank >>> highlighted text from another application. >> >> That's an age-old pattern in X11. I don

Re: Mixing R and Python in the same Jupyter Notebook and finding Python code within an RMarkdown document

2018-11-03 Thread Thomas Jollans
On 03/11/2018 00:17, Spencer Graves wrote: > Hello, All: > > >   Two questions: > > >         1.  Is it feasible to mix R and Python code in the same > Jupyter notebook?  If yes, can you please point me to an example? While Jupyter are always linked to *one* specific language, rpy2's i

Re: builtins confusion

2018-11-05 Thread Thomas Jollans
On 2018-11-05 10:47, Robin Becker wrote: >     raise ImportError('This package should not be accessible on Python 3. ' >   'Either you are trying to run from the python-future > src folder ' >   'or your installation of python-future is corrupted.') It woul

Re: Unable to remove python from my computer.

2018-11-06 Thread Thomas Jollans
On 2018-11-06 10:05, Varshit Jain wrote: > Hi Python Support Team, > > > I just want to remove python 3.6.6 from my computer. I am unable to do > it. Please find attached video that describe my problem. Use your words, friend! (this list is text-only) -- https://mail.python.org/mailman/listin

Re: int.to_bytes() for a single byte

2018-11-07 Thread Thomas Jollans
On 07/11/2018 05:22, jlada...@itu.edu wrote: > On Tuesday, November 6, 2018 at 7:19:09 PM UTC-8, Terry Reedy wrote: >> On 11/6/2018 9:30 PM, j...y@it.u wrote: >> >>> b = i.to_bytes(1, "big") >>> >>> Is there another function which provides a more logical interface to this >>> straightforward task?

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-07 Thread Thomas Jollans
On 06/11/2018 22:51, Lie Ryan wrote: >> I like to step through my code line by line, >> it's impossible to do it with >> object-oriented programming language. > > I suggest pudb, it's a curses based debugger, which is nicer than pdb, but > doesn't require tedious IDE setup. I'll just take this o

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-07 Thread Thomas Jollans
On 07/11/2018 21:31, MRAB wrote: > On 2018-11-07 09:20, Thomas Jollans wrote: >> On 06/11/2018 22:51, Lie Ryan wrote: >>>> I like to step through my code line by line, >>>> it's impossible to do it with >>>> object-oriented programming language. &g

Re: installing modules problem

2018-11-08 Thread Thomas Jollans
e using the wrong pip? - what operating system are you using? - what are you trying to install and use? - how exactly are you trying to install and import this module? (exact commands, exact copy-pasted output) -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Good editor for python

2018-11-11 Thread Thomas Jollans
and a bit slower and more bloated, but it has fantastic Python support, including a well-integrated visual debugger. There are of course loads and loads of other options. Everything I've mentioned runs at least on x86_64 Linux, OSX, and Windows. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 12/11/2018 09:28, srinivasan wrote: > Dear Python Experts team, > > This question might be very simple for you, As am newbie to python, could > you please how to parse the below strings > > [snip] > > > root:~/qa/robot_tests# nmcli c show Pro tip: many *nix tools have a flag that makes them

Re: Quote of the day

2016-05-18 Thread Thomas Mlynarczyk
orted as "todo"/"incomplete" or whatever? (I know that PHPUnit reports such tests as "passed" which I find utterly wrong.) Thomas -- Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison! (Coluche) -- https://mail.python.org/mailman/listinfo/python-list

Re: Quote of the day

2016-05-18 Thread Thomas Mlynarczyk
of a test runner that does that. Simple: a function which does not produce at least one "failure" or "pass" does not test anything. No need to introspect the code. Just check if the total score of failures and passes has changed after the function was run. Thomas -- Ce n&

Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
tuff, max_section_size):" en_of_stuff is always less than the max long (around 600). We're using gevent and I'm suspecting some "threading" could cause this, as I'm able to replicate it locally with the same data. Kind regards, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
Hi! Thanks! That was a typo. I do '=='. The rest of the mail is ok (with the corrections from Chris) :) T Den 24. maj 2016 klokken 17:05 skrev Novocastrian_Nomad : On Tuesday, May 24, 2016 at 5:47:55 AM UTC-6, thomas povtal.org wrote: ...

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread thomas povtal.org
Den 24. maj 2016 klokken 15:18 skrev Chris Angelico : On Tue, May 24, 2016 at 8:22 PM, thomas povtal.org wrote: > Please excuse me if this is not the right place, but I have some issues > with CPython on a NUMA machine. > > We're using gevent an

Re: Spurious issue in CPython 2.7.5

2016-05-25 Thread thomas povtal.org
Hi! Thanks. Replies in-line > Den 24. maj 2016 klokken 19:12 skrev Steven D'Aprano : > > On Tue, 24 May 2016 08:22 pm, thomas povtal.org wrote: > > > Hi, > > > > Please excuse me if this is not the right place, but I have some issues > > with CPython

Re: Spurious issue in CPython 2.7.5

2016-05-25 Thread thomas povtal.org
, thomas povtal.org wrote: > 2016-05-24_08:15:40.84187 File "checkrc.pxd", line 14, in > zmq.core.checkrc._check_rc (zmq/core/socket.c:5932) > 2016-05-24_08:15:40.84187 OverflowError: long too big to convert That exception is arising from ZeroMQ's own code

PEP8 needs revision

2016-06-15 Thread Kyle Thomas
To Whom It May Concern, Knuth's quote refers to the output of TeX, the programming language he authored. The quote cannot be interpreted to speak about formatting of source-code. One bit of evidence I can offer is that TeX's source only cares about multiple newlines in considering the multiplicity

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:05:14 UTC+2 schrieb Thomas Kaufmann: > Hi, > > I have a little scrapy-script: scrapy gets the links from a webpage; this > works fine. Then I want to write these links in a sqlite3-table. There is no > error-note. But in the database are not any r

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:52:12 UTC+2 schrieb Chris Angelico: > On Fri, Jul 8, 2016 at 12:42 AM, Thomas Kaufmann wrote: > > I changed my code in the way you suggested. There is no effect in the db. I > > start this script on the commandline with: > > > > tk

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:56:48 UTC+2 schrieb Peter Otten: > Thomas Kaufmann wrote: > > > Am Donnerstag, 7. Juli 2016 16:05:14 UTC+2 schrieb Thomas Kaufmann: > >> Hi, > >> > >> I have a little scrapy-script: scrapy gets the links from a webpage; thi

Re: Issue in parsing the strings in python code

2018-11-12 Thread Thomas Jollans
On 2018-11-12 10:23, srinivasan wrote: > Hi Thomas, > > Great to hear from you, Could you please let me know how do I get the UUID > "1da7d068-4548-4446-bf88-a440e49db1b1" by passing the name of the SSID > "Funkloch' using "nmcli --terse" ?? Have a

Re: distribute python interpreter and dependencies

2018-11-12 Thread Thomas Jollans
on interpreter > available to all windows based different machines? Am i missing something > else? What are the steps the python windows installer performs in order? I have no idea what the Python.org installer is doing here, but you could try one of the other Python distributions (e

Re: IDLE Default Working Directory

2018-11-12 Thread Thomas Jollans
On 13/11/2018 00:45, Terry Reedy wrote: > > On Windows, a simple alternate is a .bat file.  I belive the folloiwing > should work. > > cd c:/desired/startup/directory > py -x.y -m idlelib > > The default for x.y is latest 3.x or latest 2.x if no 3.x. Correct me if I'm wrong, but won't that crea

Re: Reading 'scientific' csv using Pandas?

2018-11-19 Thread Thomas Jollans
#x27;, sep='\t') Out[2]: Value Index 0 1.674000e+00 1 3.48e+03 2 8.183400e-10 3 3.984109e+03 4 2.830812e+09 In [3]: pd.read_csv('test.csv', header=[0], index_col=0, decimal=',', sep='\t', engine='python') Out[3]: Value Index 0 1.674 1 3,48e+3 2 8,1834e-10 33984.109 4 2830812370 In [4]: pd.__version__ Out[4]: '0.23.4' -- Cheers, Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Odd truth result with in and ==

2018-11-22 Thread Thomas Jollans
On 21/11/2018 20:18, Python wrote: > $ python3 > Python 3.5.2 (default, Nov 23 2017, 16:37:01) > [GCC 5.4.0 20160609] on linux > Type "help", "copyright", "credits" or "license" for more information. 1 in [1,2,3] == True > False 1 in ([1,2,3] == True) > Traceback (most recent call last):

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 21:36, Calvin Spealman wrote: > If you want to create your own immutable class, maybe inherit from a > namedtuple? If you're tempted to go down that route and can require Python 3.7, use dataclasses! > > On Wed, Nov 21, 2018 at 11:45 AM Iwo Herka wrote: > >> Hello, >> >> Let's s

Re: Question about implementing immutability

2018-11-22 Thread Thomas Jollans
On 2018-11-21 17:45, Iwo Herka wrote: > Hello, > > Let's say I want to implement immutability for user-defined class. > More precisely, a class that can be modified only in its (or its > super-class') __init__ method. My initial idea was to do it the > following fashion: > > def __setattr__(s

Re: Odd truth result with in and ==

2018-11-23 Thread Thomas Jollans
On 2018-11-22 09:58, Chris Angelico wrote: > On Thu, Nov 22, 2018 at 7:51 PM Thomas Jollans wrote: >> >> On 21/11/2018 20:18, Python wrote: >>> $ python3 >>> Python 3.5.2 (default, Nov 23 2017, 16:37:01) >>> [GCC 5.4.0 20160609] on linux >>> T

Re: Python2.7 unicode conundrum

2018-11-25 Thread Thomas Jollans
On 25/11/2018 18:51, Robert Latest via Python-list wrote: > Hi folks, > what semmingly started out as a weird database character encoding mix-up > could be boiled down to a few lines of pure Python. The source-code > below is real utf8 (as evidenced by the UTF code point 'c3 a4' in the > third line

Re: multiple JSON documents in one file, change proposal

2018-11-30 Thread Thomas Jollans
On 30/11/2018 23:40, Marko Rauhamaa wrote: > Paul Rubin : >> Maybe someone can convince me I'm misusing JSON but I often want to >> write out a file containing multiple records, and it's convenient to >> use JSON to represent the record data. >> >> The obvious way to read a JSON doc from a file is

Re: Injecting methods into instance / class

2018-12-02 Thread Thomas Jollans
On 02/12/2018 18:56, duncan smith wrote: > Hello, > I have a lot of functions that take an instance of a particular > class as the first argument. I want to create corresponding methods in > the class. I have tried the following, which (when called from __init__) > creates the relevant method

Re: How to run an infinite loop on Menu?

2018-12-03 Thread Thomas Jollans
On 03/12/2018 08:58, huey.y.ji...@gmail.com wrote: > Hi Folks, > > I need to run an infinite loop on a Menu button, like this: > > from Tkinter import * > > def run_job(): > i = 0 > while 1: > i = i + 1 > if i > 100: > break > ... > > root = Tk() > m

Re: Import module from file path

2018-12-05 Thread Thomas Jollans
ld work with namespace packages. > Also it seems as if there should be a simpler way to get from > the path to the module name... I doubt it. There's no reason for the import machinery to have such a mechanism. Besides, not all modules have real file names (e.g. if they live in zip files) -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating type evaluation annotation

2018-12-06 Thread Thomas Jollans
On 06/12/2018 11:48, Marek Mosiewicz wrote: > I'm Java developer,but had some experience with Python based > ERP software. It is quite serious application and I feel > unconfortable with not having type checking. I do not say language > should be static, but having checking method signature > is b

Re: Kivy native GUI examples

2019-01-07 Thread Thomas Jollans
, Linux/Gnome/KDE).  Is that possible and > anyone know of some examples? AFAIK looking like a native app is quite simply not something Kivy helps you with. If that's important, you should look into other options such as Qt (PyQt5 or PySide2). -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Kivy native GUI examples

2019-01-07 Thread Thomas Jollans
, Linux/Gnome/KDE).  Is that possible and > anyone know of some examples? AFAIK looking like a native app is quite simply not something Kivy helps you with. If that's important, you should look into other options such as Qt (PyQt5 or PySide2). -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: get the terminal's size

2019-01-14 Thread Thomas Jollans
On 14/01/2019 12.57, Alex Ternaute wrote: > Hi there, > > I want to know the number of columns of the terminal where python2 writes > it's outputs. > > In a terminal, I type > $ echo $COLUMNS > 100 > > But in Python, os.getenv("COLUMNS") gets nothing. > It gets nothing as well if I try to read

Fwd: improve TypeError for AsyncIterables when attempting to sync iterate

2019-02-10 Thread Thomas Grainger
Currently when attempting to sync iterate an async iterable you get a TypeError: TypeError: 'SomeType' object is not iterable When attempting to iterate an async iterable (eg an object with a __aiter__ method the error could be something like: TypeError: 'SomeType' object is not iterable, it is

Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 14/02/2019 19:10, Grant Edwards wrote: > On 2019-02-14, Liste guru wrote: >> Il 14/02/2019 00:06, Grant Edwards ha scritto: >>> For many, many years I've always installed ActiveState's ActivePython >>> Community edition when forced to use Windows. It has always included >>> ... >>> I guess it'

<    7   8   9   10   11   12   13   14   15   16   >