Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 12:28, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 05:45, Marko Rauhamaa wrote: The two-space indentation is the out-of-the-box default for emacs. Ahem. It's the default for certain C styles. It's not even the default for C-mode itself, which is 4. You must be

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 16:41, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 12:28, Marko Rauhamaa wrote: Try running emacs -q abc.c and observe the indentation depth. """User Option: c-basic-offset This style variable holds the basic offset between indentation level

Re: gmpy2 problem

2018-11-01 Thread Rhodri James
d you copy the error text (preferably cut-and-paste the whole thing rather than retyping!)? The more information you can give us, the better the advice will be from the people who actually understand pip :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: gmpy2 problem

2018-11-01 Thread Rhodri James
-externally-managed --compile" failed with error code 1 in /tmp/pip-install-kiqba_j_/gmpy2/ " A little googling suggests that you need to install the libgmp3-dev package: $ sudo apt install libgmp3-dev On Thu, 1 Nov 2018 at 16:46, Rhodri James wrote: On 01/11/2018 14:40, jacob m wrot

Re: gmpy2 problem

2018-11-05 Thread Rhodri James
Jacob, please reply to the list, not to me personally. As I said, I have no idea about gmpy2 or pip, I just know how to google. On 01/11/2018 23:28, jacob m wrote: I tried to install libgmp3-dev, but it didn't solved my problem On Thu, 1 Nov 2018 at 18:44, Rhodri James wrote: Replyi

Re: Unable to remove python from my computer.

2018-11-06 Thread Rhodri James
ed off by the mailing list as well. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: can't assign to literal while using ""blkid -o export %s | grep 'TYPE' | cut -d"=" -f3" % (fs)" using subprocess module in Python

2018-11-06 Thread Rhodri James
ut' element of the pipeline. You have used double quotes in a double quoted string without escaping them. As a result, the interpreter thinks you are trying to assign the string literal " -f3" to the string literal "blkid -o export %s | grep 'Type' | cut -d" -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Unable to remove python from my computer.

2018-11-07 Thread Rhodri James
ignature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Tue, Nov 6, 2018 at 5:42 AM Rhodri James wrote: On 06/11/2018 09:25, Thomas Jollans wrote: On 2018-11-06 10:05, Varshit Jain wrote: Hi Python Suppo

Python and 64bit Windows7

2016-08-08 Thread James Santiago
issues and get Python and PyCharm to work? I would appreciate your help. Regards James -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and 64bit Windows7

2016-08-08 Thread James Santiago
like this: # C:\Python\lib\__pycache__\codecs.cpython-35.pyc matches C:\Python\lib\codecs.py Thank you in advance for your help. Regards James On Mon, Aug 8, 2016 at 2:08 AM, Joaquin Alzola wrote: > >I am having problems when installing Python on a 64bit windows7 laptop. >

Re: Issue in parsing the strings in python code

2018-11-12 Thread Rhodri James
4 NIFunkloch 1da7d068-4548-4446-bf88-a440e49db1b1 wifi -- [snipped for brevity] That looks conveniently aligned. Can't you just slice each line to get the entries you are after? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about the definition of the value of an object

2018-11-19 Thread Rhodri James
Attempting to define value here would be at best a massive distraction from the concepts the documentation is trying to get across. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.

2018-11-19 Thread Rhodri James
ling to see how this is relevant to Python. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Bytes vs Strings (Was Re: [Tutor] Error Python version 3.6 does not support this syntax)

2018-11-29 Thread Rhodri James
run shell commands and parse their output. Have you looked to see if there are existing Python modules that will Just Do The Work for you and avoid all this faffing about? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: multiple JSON documents in one file, change proposal

2018-12-03 Thread Rhodri James
case where you can't. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Fwd: PROBLEM IN LAUNCHING PYTHON...

2019-01-08 Thread Rhodri James
ert, but others here may be able to help if you give them enough information. (The temptation to say "Installing Linux will fix most of your problems" is strong :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: ValueError: Input contains NaN, infinity or a value too large for dtype('float32')

2019-01-24 Thread Rhodri James
On 23/01/2019 22:29, paulmatth...@gmail.com wrote: You may be using the sklearn package incorrectly; you'll have to read the (apparently quite prolific) documentation yourself, I've never used it. -- Rhodri James *-* Kynesim Ltd So why would you try to answer it? I have the same

Re: Python program to phone?

2019-02-05 Thread Rhodri James
ird it's the "Reply List" button. Sorry I can't help you on your initial problem Likewise :-( -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: exit 2 levels of if/else and execute common code

2019-02-11 Thread Rhodri James
the common code in a function? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Rhodri James
be at odds with the broad intent. You're going to have to expand on this somewhat, because at the moment I 100% disagree with you. I would much rather be explicit about the code that a context manager applies to than have it magically add itself to some other block. -- Rhodri

Re: revisiting the "What am I running on?" question

2019-02-19 Thread Rhodri James
vices, it's listing platforms. Linux could be running on an ARM, an x64 chip, or probably a few other chips too. What *specifically* do you want, and why? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: The NaNny State

2019-02-19 Thread Rhodri James
uot;. In this case, it really isn't helpful. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How to play with Python in an existing app

2019-02-20 Thread Rhodri James
would be ideal (but expensive). -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-21 Thread Rhodri James
ht in your example, particularly as revised here, the context managers showed up the real structure of the code nicely. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Lifetime of a local reference

2019-02-27 Thread Rhodri James
be called until the suite has been executed, so the reference to the open file must exist for at least that long. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: Creating GUI Applications with wxPython

2019-02-27 Thread Rhodri James
larly when mobiles enter the picture. I'm not convinced it's a completely good idea; a sensible UI for a desktop probably won't be sensible for a phone and vice versa -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Lifetime of a local reference

2019-02-28 Thread Rhodri James
On 27/02/2019 21:39, Roel Schroeven wrote: Rhodri James schreef op 27/02/2019 om 15:18: Aren't we overthinking this? I think it's pretty clear that a variable is never deleted before it goes out of scope. A quick search in the documentation points me to (https://docs.python.org/3

Re: Class Issue`

2019-03-06 Thread Rhodri James
being careless, but it really shouldn't break your expectations. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Class Issue`

2019-03-06 Thread Rhodri James
On 06/03/2019 14:15, Calvin Spealman wrote: C++ (a language I have no respect for) This was uncalled for and inappropriate. Please keep discord civil. That was the civil version :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Class Issue`

2019-03-06 Thread Rhodri James
spect here after all:) Fine, you've got me there :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: "use strict"

2019-03-11 Thread Rhodri James
-*- # -*- explicit -*- could be used to prevent it What exactly would you want "strict" (in whatever form) to do? I'm guessing, but it sounds like you want more static checking. Usually that's the province of linters and type annotation, depending on just what you wan

Re: "use strict"

2019-03-11 Thread Rhodri James
me special symbils to mark that. You sent this to me instead of the list, but never mind. If you want this, Guido's time machine strikes again. Just use type annotations and mypy, or pylint or the like for static checking of unexpected variables. -- Rhodri James *-* Kynes

Re: "use strict"

2019-03-12 Thread Rhodri James
'd hate to be the one trying to implement it and I imagine it's likely to slow down execution a fair bit. Under what condition do you want execution halted? At the moment you haven't been much more specific than "when my program is wrong", which isn't very he

Re: "use strict"

2019-03-12 Thread Rhodri James
all variables, because I think you know what the answer to that one will be. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: "use strict"

2019-03-12 Thread Rhodri James
ouldn't be so easily the default. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: "use strict"

2019-03-12 Thread Rhodri James
t to track maybe _var or something like that, i want to solve that problem and this is just a proposal Sorry, I still don't understand. *What* do you want to mark with "_var"? It that a comment? A new keyword? Just a leading underscore? Could you give a full example,

Re: Can my python program send me a text message?

2019-03-20 Thread Rhodri James
x27;t guarantee to deliver the texts at all. We have had clients become very unhappy when confronted with the reality of that. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Syntax for one-line "nonymous" functions in "declaration style"

2019-03-27 Thread Rhodri James
a[n] = x *n which makes it look a lot less magical. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Losing words

2019-04-01 Thread Rhodri James
want: s.send(bytes("PRIVMSG " + channel + " :" + mess + "\n", "UTF-8")) (Try printing out the line you want to send before sending it, and compare it with the example commands in the RFC.) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: DeprecationWarning in Python 3.6 and 3.7

2019-04-02 Thread Rhodri James
y are valid, and frankly I can't be bothered. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: requests

2019-04-04 Thread Rhodri James
h the documentation and see if it makes sense for your needs. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Kill stuck threads

2019-04-09 Thread Rhodri James
trategies. Killing and restarting a thread is always going to be a risky business, and will leave your system less stable. Don't do it unless you have no choice (and if you think you have no choice, you're probably wrong!). -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Friday Filosofical Finking: Import protections

2019-04-18 Thread Rhodri James
;t care about tags. That library is imported within a try/except block. Most imports I've seen have been for mandatory functionality; while my current code could run without its CRC library, everything it tried to talk to would reject its messages, for example! -- Rhodri James *-* Kynesi

Re: Read the table data from PDF files in Python

2019-04-24 Thread Rhodri James
text from the PDF. You are on your own for working out how to parse the tables out of that text, though; the structures in the data you are hoping for simply don't exist. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How to append horizontally the data array from the FOR loop?

2019-05-10 Thread Rhodri James
or any other into a .txt or .csv file or any other type? 3. How can I append the header on the top of this output file? Have you looked at the csv module in the standard library? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: problem in installation of python

2019-05-13 Thread Rhodri James
On 12/05/2019 07:10, hi wrote: Sent from Mail for Windows 10 What problem? If you sent a screenshot or similar, please be aware that the mailing list strips off attachments. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 594 cgi & cgitb removal

2019-05-22 Thread Rhodri James
were going to disappear I would have to rewrite it in C or similar. (No, using something more complex than CGI is not an option. I'm working on an embedded system, and we're watching our RAM usage nervously enough already.) -- Rhodri James *-* Kynesim Ltd -- https://mail.pyth

Re: PEP 594 cgi & cgitb removal

2019-05-23 Thread Rhodri James
gests that maintaining them wouldn't be a massive effort. Definitely something to think about. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 594 cgi & cgitb removal

2019-05-28 Thread Rhodri James
e written them like that myself ;-) My question is why people who value and understand old modules don't volunteer more to help keep them up to date. As I said (and was apparently misinterpreted), I am considering it. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Hide text in entry box when i click on it.(GUI using Tkinter in python)

2019-05-31 Thread Rhodri James
om the command line, the traceback tells you exactly what is going on. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python3-3.7.3: cannot run pdb

2019-06-07 Thread Rhodri James
it has finished compiling your program into byte code. There is nothing to run pdb on! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: positional argument follows keyword argument

2019-06-07 Thread Rhodri James
7;t complaining about the arguments to tth.Checkbutton. The call to ttk.Checkbutton() is itself a positional argument in the call to LabelInput, coming after the keyword argument "input_var = tk.IntVar". -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Coding problem

2019-06-17 Thread Rhodri James
On 14/06/2019 10:32, INJAMUL HOQUE wrote: ...nothing. I'm afraid your email had no content when it reached us. If you included a screen shot, I'm afraid it was automatically removed before it reached us. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listi

Re: How Do You Replace Variables With Their Values?

2019-07-11 Thread Rhodri James
dinner from for meal in dinner.keys(): exec(meal.replace(' ','_') + ' = list(dinner[meal])') print(Starters) print(Main_Course) print(Desert) OUTPUT: ['Fried Calamari', 'Potted crab'] ['Fish', 'Meat'] ['Cake', 'Banana Split'] If you think you need to do this, you are almost certainly wrong. Ew! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: super or not super?

2019-07-12 Thread Rhodri James
def __init__(self): C1.__init__(self) # Whoops, forgot this one super() also has major advantages if you are stuck with multiple inheritance. Raymond Hettinger has an excellent article on this here: https://rhettinger.wordpress.com/2011/05/26/super-considered-super/ -- Rhodri

Re: super() in Python 3

2019-07-16 Thread Rhodri James
ave to change my code then. With a shim layer like this, your chances of getting away with making no changes to your code when an API you use changes are rather small. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: super() in Python 3

2019-07-16 Thread Rhodri James
[Rearranged and snipped so this makes any kind of sense] On 16/07/2019 16:43, אורי wrote: On Tue, Jul 16, 2019 at 3:13 PM Rhodri James wrote: On 16/07/2019 11:08, אורי wrote: 2. I want to override a function called build_suite in an inherited class. The function receives an argument

Re: How to print out html tags excluding the attributes

2019-07-22 Thread Rhodri James
stead. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Rhodri James
ept; but mere mortals need/deserve something more. Accordingly, the PythonVersionError custom exception/class. Ah, so you *used* PythonVersionError without importing it. Sorry, but that's on you. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: help with tkinter

2019-08-01 Thread Rhodri James
od indication of what you did wrong; if you show us, we can help you get used to interpreting it for yourself. Happy coding! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: help with tkinter

2019-08-01 Thread Rhodri James
On 01/08/2019 19:06, Chris Angelico wrote: On Fri, Aug 2, 2019 at 2:30 AM Rhodri James wrote: Hi there, Adam! On 01/08/2019 14:31, adam kabbara wrote: Hello I am having trouble with tkinter when I enter the command from tkinter import* I get an error message What *exactly* did you type

Re: Python scripts

2019-08-05 Thread Rhodri James
don't have installed, the documentation coming with the application should tell you what to install and where to get it from. If files are genuinely missing from the script folder (wherever/whatever that is), contact the author of the application. If all else fails, read the documentation ;-)

Re: base = 1024 if (gnu or binary) else 1000

2019-08-05 Thread Rhodri James
the expression evaluates to . If it is false, it evaluates to . In this specific case, "base" is assigned 1024 if "gnu" or "binary" are true, else it is assigned 1000. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Rhodri James
o py3. Here is the code that returns the data I am trying to process: return map(self.doctor_answer, it) I don't see anything calling imap. That suggests you aren't calling the code you think you're calling. I think a little poking with pdb or some strategic prints is in

Re: Python in Blender. Writing information to a file.

2019-08-09 Thread Rhodri James
ameron Simpson I almost understand. Are you saying I should change the first line of code to something like: |outstream = with open(path to my file,'w') # this is invalid syntax| and then delete the outstream.close() No, you should do what Peter wrote: with open("/path/to/f

Re: How do i execute some code when I have subscribed to a topic with a message payload for mqtt in python?

2019-08-09 Thread Rhodri James
hould help you figure out what information is available when. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: String slices

2019-08-09 Thread Rhodri James
thing[0], file=outstream) print("Y:", thing[1], file=outstream) print("Z:", thing[2], file=outstream) I would probably use the latter, but it's just a matter of personal preference. (Actually I would probably use outstream.write() and do my own formatting, but let's not get side-tracked ;-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: String slices

2019-08-12 Thread Rhodri James
On 10/08/2019 10:45, Peter J. Holzer wrote: On 2019-08-10 09:10:12 +1000, Cameron Simpson wrote: On 09Aug2019 22:28, Paul St George wrote: On 09/08/2019 16:29, Rhodri James wrote: (Actually I would probably use outstream.write() and do my own formatting, but let's not get side-tr

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
erating the old text. The cursor is once again at the start of the line, so we can carry on with "3% complete", "4% complete" and so on. TLDR: these two lines set up (but don't output) a progress message for an interactive stream. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
On 29/08/2019 14:37, Hongyi Zhao wrote: On Thu, 29 Aug 2019 13:23:07 +0100, Rhodri James wrote: TLDR: these two lines set up (but don't output) a progress message for an interactive stream. Thanks a lot for your deeply notes on this. But, if so, when will the ``else ...'' be

Re: if STREAM.isatty():

2019-08-29 Thread Rhodri James
On 29/08/2019 16:29, Hongyi Zhao wrote: On Thu, 29 Aug 2019 14:51:43 +0100, Rhodri James wrote: When the stream isn't connected to an interactive terminal, obviously. For example, when it's writing to file. But I cannot see any thing like this in the code. I don't understan

Re: if STREAM.isatty():

2019-09-03 Thread Rhodri James
27;t, it will not change from one to the other. It's exactly like "STRING.isnumeric()"; for the same string it will always give the same answer. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError: loadtxt() got an unexpected keyword argument 'max_rows'

2019-09-03 Thread Rhodri James
n't ask me how, I've never used it) or delete the "max_rows=1" and accept the inefficiency. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I give a decorator acces to the class of a decorated function

2019-09-04 Thread Rhodri James
MyClassRegistry = my_class_registry @register(my_class_registry) def MyFunction(...): ... Or you may be able to achieve what you want with dir() and some careful naming? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Formatting floating point

2019-09-04 Thread Rhodri James
ad, you would have found that worked too. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Issue with Python installation

2019-09-11 Thread Rhodri James
o the text of your email, that way we will get to see them! (The temptation to say "Use your words" is oh so strong :-) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

JOB | Front End Architect (London, UK)

2019-09-23 Thread James Tobin
scuss further off-list using "JamesBTobin (at) Gmail (dot) Com". Kind regards, James -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to call a extern command as a filter

2019-09-25 Thread Rhodri James
=True) return latex.output The above is completely untested and not in the least bit robust, but that's the area of the standard library you should be looking at. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Python in The Economist

2019-09-25 Thread Rhodri James
roduce, and the overlap isn't as big as you would hope. Making chip design simpler would certainly help. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to call a extern command as a filter

2019-09-25 Thread Rhodri James
nice: I would like to avoid the extra steps writing an reading extern files. subprocess is your friend here. Something like: [snip myself] You can also use the io.StringIO class of the stdlib, which is more suitable for this use case. Not for running external tools, surely? -- Rhodri James

Re: __init__ is not invoked

2019-09-26 Thread Rhodri James
p of that, the language definition states that "The return value of __new__() should be the new object instance (usually an instance of cls)". You have returned the class object, not an instance of anything, so on the whole it's lucky that object.__init__() does nothing! -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: NEWBIE: how to get text onto 2 lines on a 16x2 lcd display

2019-09-26 Thread Rhodri James
of your message to overwrite the characters you don't want any more, but not so many that you overwrite what you want to keep. Working out how many spaces that is for any given message could be quite tedious. You may well find it easier to lcd.clear() the whole display and rewrite everything when you want to change anything. Anyway, I hope that helps. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: __init__ is not invoked

2019-09-26 Thread Rhodri James
On 26/09/2019 15:35, Oscar Benjamin wrote: On Thu, 26 Sep 2019 at 13:39, Rhodri James wrote: You have returned the class object, not an instance of anything, Well object is an instance of object as well as of type: Fair point. I keep forgetting that. -- Rhodri James *-* Kynesim Ltd

Re: Recursive method in class

2019-09-27 Thread Rhodri James
Try self.fib(...) instead of fib(self, ...) both times. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: pathlib

2019-10-01 Thread Rhodri James
home/rhodri/foo.txt: No such file or directory cat "concatenates files" to quote its man page. Does that mean it creates them if they don't exist, just because I typed the name into the command? No. I wouldn't expect it either. In exactly the same way I don't e

Re: Recursive method in class

2019-10-01 Thread Rhodri James
.factorial(n - 1) instance = Dummy() instance.factorial(3) 6 # correct So, to summarize, if you create a class with type(name, bases, dict_) or with the "class" keyword, recursive methods can't be writen in the same way. This is what puzzle me. On the contrary, recursive methods are

Re: pathlib

2019-10-02 Thread Rhodri James
ame, just one that may transiently be related to a real object. Concrete may not be the best term for this, but I can't think of a better one. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: uses both shell and python codes in one script.

2019-10-03 Thread James Lu
I would use IPython as a scripting language. It has a slow startup time though. On Thu, Oct 3, 2019 at 9:59 AM Chris Angelico wrote: > On Thu, Oct 3, 2019 at 11:41 PM Hongyi Zhao wrote: > > > > On Thu, 03 Oct 2019 23:12:45 +1000, Chris Angelico wrote: > > > > > > > Seems fine. Most of the code

Re: Would you be interested in this Python open source project?

2019-10-08 Thread Rhodri James
spaces will probably be more enthusiastic. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James
sage=("Could not start SASL: %s" % self.sasl.getError())) thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2' I am trying to connect from windows 10 local to Pre

Re: Curious about library inclusion

2019-10-11 Thread Rhodri James
overall into what this line means in particular. It's exactly like coming across an unusual phrasing or iffy grammar in a piece of writing; you get thrown out of the reading experience by having to concentrate on the individual words. Heh. Literary criticism as applied to programming. Only

Re: Error: thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable t

2019-10-11 Thread Rhodri James
On 11/10/2019 15:13, Prabakaran Hadoop wrote: Thanks for your reply. Any work around or any other way to achieve from python to prestosql . If there is, it'll be in the GitHub issue I linked to. I just applied Google to your question. -- Rhodri James *-* Kynesim Ltd --

Re: Curious about library inclusion

2019-10-15 Thread Rhodri James
On 15/10/2019 12:38, Antoon Pardon wrote: On 11/10/19 15:48, Rhodri James wrote: On 10/10/2019 12:40, Antoon Pardon wrote: About including piped iterators: http://code.activestate.com/recipes/580625-collection-pipeline-in-python/ On 10/10/19 13:00, Paul Moore wrote: As another measure

Re: Instantiating sub-class from super

2019-10-15 Thread Rhodri James
find many and varied ways of coming back to bite you? -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Black

2019-10-21 Thread Rhodri James
#x27;s my personal preference. (Which indicates that I too shouldn't consider using black!) -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculations and Variables

2019-11-01 Thread Rhodri James
ython3. So my first piece of advice would be to switch to Python3 now so you don't have to re-learn oddities like input(), print() and string handling. -- Rhodri James *-* Kynesim Ltd -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculations and Variables

2019-11-01 Thread Rhodri James
On 01/11/2019 17:07, MRAB wrote: On 2019-11-01 12:36, Rhodri James wrote: On 31/10/2019 20:14, MRAB wrote: On 2019-10-31 18:46, ferzan saglam wrote: The code below which I have written should print the result of 43.6 with the given values I have included at the end of this question, but for

Re: OOP - iterable class: how to delete one of its objects ?

2019-11-01 Thread Rhodri James
reference count. This won't automatically delete the reference from the WeakSet when the instance goes away, you'll want to set a finalizer for that, but the documentation covers what you want to know fairly clearly. Trust me, I was doing exactly this a week or so ago, and it

Re: OOP - iterable class: how to delete one of its objects ?

2019-11-04 Thread Rhodri James
t the reference count" existed.Thank you. Could cause some interresting "the object has disappeared!" problems when you're not carefull with it though ... :-) Yes, it can. That's why you want to create a finalizer to tidy up. -- Rhodri James *-* Kynesim Ltd -- h

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Rhodri James
Meta): pass then you get the prints from MyMeta.__instancecheck__(). The isinstance() still returns True, though, and I don't know why. Then again, your definition of MyMeta is really weird. f = Foo() b = Bar() print(isinstance(f, (Bar, Foo))) -- Rhodri James *-* Kynesim Ltd

<    1   2   3   4   5   6   7   8   9   10   >