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
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
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
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
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
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
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
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
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
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
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
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
[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
stead.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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 ;-)
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
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
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
hould help you figure out what information is available when.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
ad, you would have found that worked too.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
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
=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
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
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
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
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
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
Try self.fib(...) instead of fib(self, ...) both times.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
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
.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
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
spaces will probably be more enthusiastic.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
--
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
find many and varied ways of coming back to bite you?
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
#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
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
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
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
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
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
ust be what's responsible for the True result. Logically the
problem must be to do with your MyzMeta class then. I have no idea what.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 04/11/2019 22:23, Peter J. Holzer wrote:
On 2019-11-04 14:54:23 +, Rhodri James wrote:
On 04/11/2019 14:33, Veek M wrote:
__metaclass__ = whatever; # is python2.x syntax
But not Python3: see PEP 3115
Doesn't "X is python2.x syntax" imply "X is not python3 syntax
would you want to do this? What
exactly does "at the same time" mean here?
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 06/11/2019 09:51, Spencer Du wrote:
On Tuesday, 5 November 2019 19:44:46 UTC+1, Rhodri James wrote:
On 05/11/2019 18:33, Spencer Du wrote:
I want to execute at least two python files at once when imported but
I dont know how to do this. Currently I can only import each file one
after
On 06/11/2019 11:42, Rhodri James wrote:
On 06/11/2019 09:51, Spencer Du wrote:
On Tuesday, 5 November 2019 19:44:46 UTC+1, Rhodri James wrote:
On 05/11/2019 18:33, Spencer Du wrote:
I want to execute at least two python files at once when imported but
I dont know how to do this. Currently I
, but still requires a
lot of careful thought. For example you've asserted that the modules
you want to import simultaneously, but you also need to consider the
import mechanism itself.
Put 1 and 2 together, and multi-threaded import sounds like a nightmare.
--
Rhodri James *-* Kynesi
is probably right, but this is a
toy example and just as easily written with lambdas if you're that
worried about using up names.
-10 from me.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
ke that comes with Visual
Studio, for example, and use it in preference to the IDE when I can.
Yes, it's a hassle, but it's a hassle you're going to go through anyway.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
o tell!)
Trying to work cross-platform with NMake/GNU make is every bit as horrid
as you're imagining when you start getting clever, and I haven't tried
doing it for years. Generally when I'm working on both Windows and
Linux, Cygwin is involved anyway so I just use GNU mak
eemed
that worthwhile.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
The original idea of the shebang line invoking env, as far
I recall, was that you'd get the "proper" system python3 wherever it had
been put rather than something random and possibly malicious. I guess
that means to go for your first option.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
scope *excluding
globals.*" (my emphasis.)
MyVar is a global here, so nonlocal explicitly doesn't pick it up.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
al_variable = n
love_my_global(3) # prints 'It was 5'
show_my_global() # prints '3'
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
wn about this, and demand that we use either all tabs or all
spaces for our indentation. That's what you've fallen foul off; there
must be a mix of tabs and spaces in that line!
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 05/12/2019 19:30, Rhodri James wrote:
On 05/12/2019 18:49, RobH wrote:
Update:
I did python3 Internet.py
and now only get this error:
pi@raspberrypi:~/Downloads $ python3 Internet.py
File "Internet.py", line 24
font = ImageFont.truetype( 'Minec
..
I'm afraid this is a text-only mailing list, so your screenshot has been
stripped off before any of us could see it. Please could you copy and
paste the text of the error message you receive.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
an individual machine) to each service. So do that, using whatever
digits you have left after the unique machine number.
* Mash these two numbers into a single ten digit identifier.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
rt of space before deleting the object, for example, which might
not happen until your script terminates.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 10/12/2019 19:00, R.Wieser wrote:
MRAB,
You merely disabled the mark-and-sweep collector.
Nope. Go check the docs on "gc"
Yep. Go and check the docs on "gc" *carefully*
*plonk*
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
's an implementation detail of your computer.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
have further-reaching implications for those
implementations. I can't speak to the details; the only other
implementation I use is Micropython, and I don't use that often enough
to have cared about the details of garbage collection beyond noting that
it's different to CPython.
--
Rho
It
doesn't. This happens to be the behaviour in CPython, but other
implementations vary as Chris has explained several times now.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
aw it. Could you copy and paste (DON'T
retype!) the error instead, so we can all read it?
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
for that.
c) I would much prefer it if you didn't top-post, but interleaved your
replies like I've done here. I find it hard to follow top-posted
messages because they reverse the normal flow of conversation.
On Wed, Dec 18, 2019 at 11:39 PM Rhodri James wrote:
On 18/12/2019 0
7;hexdump.py': [Errno 2] No such file or directory
user@USERnoMacBook-Air LibraBrowser %
Huh. You've done a "pip3 install hexdump" so I don't know what might be
happening here. Sorry.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
you are far more likely than me to
recognise which of them are relevant to your circumstances.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
ft utterly irrelevant to me and those like me.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
s -- or lack of OSes -- which have no graphical
interface).
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 08/01/2020 18:08, many people wrote lots of stuff...
Folks, could we pick one list and have the discussion there, rather than
on both python-list and python-ideas? Getting *four* copies of Andrew's
emails is a tad distracting :-)
--
Rhodri James *-* Kynesim Ltd
--
https://mail.pytho
quire that behaviour.
It's horses for courses, as ever.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
input,
converts it to a string (stripping a trailing newline), and returns
that. When EOF is read, EOFError is raised.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
ile "", line 1, in
t = time.clock()
AttributeError: module 'time' has no attribute 'clock'
It is correct, there is no time.clock() function. The documentation is
here: https://docs.python.org/3/library/time.html
--
Rhodri James *-* Kynesim Ltd
--
on the interactive command
line or a look in the documents will tell you that strings indeed do not
have a loads_data() method.
I don't know what library you are intending to use, but you need to open
your file with that first.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
d to pay the cost of a replacement project, which will accrue its own
technical debt...
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 12/02/2020 17:46, Python wrote:
On Wed, Feb 12, 2020 at 01:16:03PM +, Rhodri James wrote:
On 12/02/2020 00:53, Python wrote:
In pretty much every job I've ever worked at, funding work (e.g. with
humans to do it) with exactly and precisely the resources required is
basically impos
On 19/02/2020 14:22, Duram via Python-list wrote:
I have a drawing in a .gif file with (a,b) pixels and want to paperprint
it in a position (x,y), what would be the code?
What have you tried?
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 20/02/2020 15:08, Duram wrote:
On 19/02/2020 12:17, Rhodri James wrote:
On 19/02/2020 14:22, Duram via Python-list wrote:
I have a drawing in a .gif file with (a,b) pixels and want to
paperprint it in a position (x,y), what would be the code?
What have you tried?
Nothing, I did not find
ccasions when you want it, but
more often you should be working in UTC not local time.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
you have a global class instance hanging around, which is not
actually any better than a global dictionary.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
or me since get_it(piece) returns the error:
builtins.TypeError: get_it() takes no arguments
It works for me (pace sticking something in GetIt.seen to avoid getting
a KeyError). You aren't muddling up the class name and instance name
are you?
--
Rhodri James *-* Kynesim Lt
from threading disasters by itself, though it will make it
easier to protect it as you need.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
media app." Email works exceedingly well
for this sort of thing, despite Google's antics.
+10
The best response to "This system breaks when I abuse it" is almost
always "Well stop abusing it then."
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
act. I think the second version is more readable (and the
third version, where you factored out the common lookup is better still).
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
ance is created.
Try running this code:
class first:
print("from first")
Just that. No instantiation, no "first()", nothing else. Just the
class suite itself.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
On 19/03/2020 14:47, Peter J. Holzer wrote:
On 2020-03-19 14:24:35 +, Rhodri James wrote:
On 19/03/2020 13:00, Peter J. Holzer wrote:
It's more compact, especially, if "d" isn't a one-character variable,
but an expression:
fname, lname = db[people].employe
.
--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list
201 - 300 of 855 matches
Mail list logo