tement is outside of that scope. Shifting the print statement
right four spaces should do the trick.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist -
k not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
meone point me in the right direction
Will this https://docs.python.org/3/library/email-examples.html at least
get you going?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
value to a list of ints?
You are trying to increment the first element of count which is itself a
list containing one element. You actually need:-
count[0][0] +=1
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Unit forms a part of the Python Standard
Library as of Python version 2.1." so for the latest version see
https://docs.python.org/3/library/unittest.html
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our
o for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 03/03/2015 23:09, Phil wrote:
On 03/03/15 17:46, Mark Lawrence wrote:
You are trying to increment the first element of count which is itself a
list containing one element. You actually need:-
count[0][0] +=1
Thank you Lawrence, Alan, and Danny,
The solution is embarrassingly obvious
calls when debugging.
About time we threw in the use of the interactive interpreter for trying
code snippets as well, just for good measure :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
_
Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
istas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
n 2 (or earlier Python 3) help output. In Python 3
strings are always unicode, so that last line has gone.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tu
other? What's wrong with this?
def f(i, n):
values = []
for x in range(i, n+1, 1):
values.append(x**2)
return values
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mar
If zero based indexing is an issue I'd just write:-
values = [None]
to start with.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@pytho
simply becomes.
print 'DSB "HI;" %s' % Stat['Vbatt']
I'll leave you to come back with the next problem as I haven't worked
out what the solution is yet :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do
On 15/03/2015 17:40, Mark Lawrence wrote:
On 15/03/2015 16:46, Doug Basberg wrote:
Nothing because it was in a completely unnecessary attachment (some
people won't even receive it), so here's the code.
Stat = {'Vbatt': 51.24, 'Ichrg': 6.75}
print ' SOLA
ven if not expected). I must turn off that relay or harm
may occur. Thanks, Doug
https://docs.python.org/3/library/atexit.html
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
change course
to take effect.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ode compare to the bisect module
https://docs.python.org/3/library/bisect.html#module-bisect ?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.or
as good as any, so if
it fits your mind set, use it :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscripti
else :
row += rowInc
col += colInc
if row < 0 or row > 7 or col < 0 or col > 7 :
return False
return False
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
_
ld do the trick. However, I can't figure out how to use next for
finding in two 2d arrays.
-From my understanding, for this use, b needs to be a list. However,
each line is unique, so it could be a set if necessary.
Thanks in advance.
Best,
Kale
--
My fellow Pythonistas, ask not w
r you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 29/03/2015 02:32, Juan C. wrote:
On Sat, Mar 28, 2015 at 10:26 PM Mark Lawrence
wrote:
If your classes are small put them in one source file, which is clearly
simpler than your proposed structure. Why over-engineer something if
there is no need to?
Well, my classes won't be that small
ot what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
nfusing errors later.
As Peter said, I'm using __main__.py so that I can invoke the the app like
'python pycinema' in the console. A bunch of people recommend this approach.
On Sun, Mar 29, 2015 at 11:31 AM Mark Lawrence
wrote:
No.
We're talking Python, not Java. Some modules
hink
you need a lambda function?
[x**2 for x in range(10)]
should do the trick.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe
ing things but there
are other options. As an example you might like to see the pairwise
function here http://pythonhosted.org//more-itertools/api.html with the
code available on pypi if you'd like to play.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you
ired items, overlapping, from the original
>>> take(4, pairwise(count()))
[(0, 1), (1, 2), (2, 3), (3, 4)]
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor
On 01/04/2015 14:16, Steven D'Aprano wrote:
On Wed, Apr 01, 2015 at 12:06:33PM +0100, Mark Lawrence wrote:
In which case I'll stick with the more-itertools pairwise() function
which I pointed out on another thread just yesterday. From
http://pythonhosted.org//more-itertools/api.html
Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
you please stop top posting, it's extremely irritating trying to
follow fairly long threads like this, thanks.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor mai
On 01/04/2015 18:20, Roel Schroeven wrote:
Mark Lawrence schreef:
On 01/04/2015 11:50, Alan Gauld wrote:
On 01/04/15 11:04, Wolfgang Maier wrote:
On 04/01/2015 11:04 AM, Alan Gauld wrote:
On 01/04/15 05:50, Jim Mooney wrote:
s = [1,2,3,4,5,6,7,8]
list(zip(*[iter(s)]*2))
[(1, 2), (3, 4), (5
On 04/04/2015 17:49, boB Stepp wrote:
Windows 7, Python 3.4.3
This code snippet is "Example 7-13" on page 383 from "Programming
Python, 4th ed." by Mark Lutz :
import sys
from tkinter import *
widget = Button(None,
text='Hello event world!',
t that to an int (or some
other numeric type) before you can add it to your total.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscri
its" or "license" for more information.
>>> d = {'a':'123'}
>>> def func(s=d['a']):
... print s
...
>>> func()
123
Emile
Dreadful advice. There have always have been and always will be
questions from newbies as they do
tely after the call
to list(), that makes p a tuple.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscripti
t seems to be similar in purpose
yet it is different to your style above (no parens for example)?
https://docs.python.org/3/library/re.html#module-contents re.X and
re.VERBOSE are together.
--
My fellow Pythonistas, ask not what our language can do f
understand it
I have to write certain text into the command prompt (I’m using windows 10). It
tells me that python -m is not recognised.
Can anyone help please
Regards
Mark Anderson
Sent from Mail for Windows 10
___
Tutor maillist - Tutor@python.org
To
On 28/10/17 21:43, Mark Anderson wrote:
Hello, I am currently doing an online course to learn Python. Generally ive
followed it well and am enjoying my first go at programming. However the
description of how to get modules from PyPi has left me confused. Ive only
recently downloaded python so
Hi
In short I am trying to download a third party package that is recommended for
a program I am writing on the course.
The text is
C:\Users\marka> python -m pip "Pyglet"
'python' is not recognized as an internal or external command,
operable program or batch file.
Ho
Apologies I missed a word out (added below) but error message the same anyway
Sent from Mail for Windows 10
From: Mark Anderson
Sent: 29 October 2017 07:57
To: tutor@python.org
Subject: RE: [Tutor] confused about Pypi
Hi
In short I am trying to download a third party package that is
the quotes, there's
loads of hits for linux and its variants, mac and windows.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubs
On 18/11/17 18:03, adam ghering wrote:
I have what seems like two responses but there are no text at all in the body
of the messages.
Is there a way I am supposed to see these?
Best,
From: Tutor on behalf of Mark Lawrence
Sent: Saturday, November 18, 2017
assignment is
and show us the code that you have written, then we give you hints on
how to proceed.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor
be 0.
Example:
Input: 10 5 11 4 2 8 10 7 4 3 6
Output: 17
Kind Regards Jeroen van de Ven (beginner)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist -
k not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
= '2018'
>>> monthdate = '0211' # skipping the input code.
>>> from datetime import datetime
>>> datetime.strptime(year + monthdate, '%Y%m%d')
datetime.datetime(2018, 2, 11, 0, 0)
>>> datetime.strptime(year + month
language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
nto a pandas DataFrame" so
you just have to assign the return value from the call to a variable.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@
is a
keyword in Python, but that doesn't happen, anyone else having this
problem Anyone know what I should do or look for
The colon is missing.
def func():
...
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our lang
nth gets input, yet produces the traceback when a
valid day and month is input.
God Bless:
James Lundy
jalu...@computer.org<mailto:jalu...@computer.org>
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
__
2.7 and 3.6 are chalk and cheese.
Nothing could be further from the truth and has regrettably been one of
the reasons for the dreadfully slow uptake of Python 3.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark
On 05/04/18 09:39, Alan Gauld via Tutor wrote:
On 05/04/18 04:02, Mark Lawrence wrote:
Python 3.6 has more functionality than 2.7 by definition, but your
comment implies, at least to me, that 2.7 and 3.6 are chalk and cheese.
Nothing could be further from the truth and has regrettably been one
my.com/software/BeautifulSoup/bs4/doc/
should fit the bill. Both are installable with pip and are regarded as
best of breed.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor mai
view controller
pattern. First hit on google
https://www.tomdalling.com/blog/software-design/model-view-controller-explained/
seems as good as any.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
tas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
thon.org/3/library/stdtypes.html#typesseq
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription opti
ng functions)
The interpreter returned this error:
*RuntimeError: maximum recursion depth exceeded while calling a Python
object*
After calling crawl() and create_jobs() a bunch of times?
How can I resolve this?
Thanks
Just a quick glance but crawl calls create_jobs which calls crawl...
--
My
fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Tiger", "SuperLion", "Cow", "Panda"]
animals_lol = []
for animal in animals:
animals_lol.append((animal, len(animal)))
print(animals_lol)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 28/09/18 20:03, Rahul Koparde wrote:
How to install twilio module in python?
pip
I'll let you do the rest of the research.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Law
Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 09/10/18 17:10, Alan Gauld via Tutor wrote:
On 09/10/18 13:45, Chip Wachob wrote:
Another related question. How do I know I want to do dir(int) vs.. I
don't know dir(long)?
Because you want to convert the byte array into an int.
And there is no long in Python...
Really? :)
mark
e out with the Python 3 book you
reference above, presumably because he was losing cash.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To
language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ou," + new_food)
Also, colons and spaces are good practices when using input boxes, such as
food_1=raw_input("Sushi: ")
Please don't top post as it makes reading long threads really irritating.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what
a problem with this?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.
added for security reasons.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.pytho
. String methods
https://docs.python.org/3/library/stdtypes.html#string-methods
Any advance on five anybody?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist
language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 29/11/2018 02:04, Avi Gross wrote:
[another massive snip]
Please take this some place else as I see no place on this *TUTOR* list
for your ramblings.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
s the problem and either the complete traceback or the error
message.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or c
On 05/12/2018 16:22, Avi Gross wrote:
[huge snip]
Please take yourself to another forum, your ramblings have no place on
the *PYTHON TUTOR* mailing list.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
. Failing that send a large cheque to
the PSF and no doubt somebody will help you out.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To
Indentation is only
significant if it starts at the beginning of a statement.
Hope this helps
Bob gailer
Big +1 from me :-)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
On 25/12/2018 00:45, Avi Gross wrote:
Please go away as you are so boring :-(
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To
On 26/12/2018 00:00, Avi Gross wrote:
[Long enough that some should neither read nor comment on.]
PLEASE GO AWAY YOU ARE REALLY IRRITATING.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
On 30/12/2018 17:26, Avi Gross wrote:
Replying to Steve's points. Again, it was not a serious design and said so
but was an ACADEMIC exploration of what could be done. I fully agree with
Steve that it is probably not a great idea to do this but note the original
request might not have been a grea
istas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
t top post here as it's so damn irritating when reading long
threads.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
On 06/02/2019 18:51, ingo janssen wrote:
On 06/02/2019 19:07, Mark Lawrence wrote:
That's going to a lot of work slicing and dicing the input lists.
Perhaps a chunked recipe like this
https://more-itertools.readthedocs.io/en/stable/api.html#more_itertools.chunked
would be better.
utf:
fiter = iter(lines)
line = next(fiter)
outf.write(line)
for line in fiter:
if "Void" not in line and "Disconnected" not in line and "Error"
not in line: # probably a simpler way of writing this but I'm knackered :-)
outf.write(l
at the problem might be or how to investigate
further would be very much appreciated.
Cheers,
Alex
Just to follow up there are some useful tips in this
https://mail.python.org/pipermail/python-list/2019-February/739643.html
as to how to debug these type of problems.
--
My fellow Pythoni
2500 times ?
Set a breakpoint on the first line after the loop, please see
https://code.visualstudio.com/docs/python/debugging#_invoking-a-breakpoint-in-code
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Law
curses before you try using the Python wrapper?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
lendar.html?
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
, THURSDAY, FRIDAY, SATURDAY, and
SUNDAY are provided for convenience. For example, to set the first
weekday to Sunday:
import calendar
calendar.setfirstweekday(calendar.SUNDAY)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark
please let us know
and we'll get you sorted :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
any help would be appreciated,
thanks
Mark
City of Glasgow College | Scottish Charity Number SCO36198 | VAT Number
59677128 DISCLAIMER :- This email, together with any attachments, may be
confidential and the subject of legal privilege. If you are not the intended
recipient, please notify the se
out
https://docs.python.org/3/library/collections.html#collections.defaultdict
as I think it's right up your street. Examples are given at the link :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Law
eck this https://www.youtube.com/watch?v=EiOglTERPEo out. If
that doesn't answer your question please ask again.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Curses is a pun on the term "cursor optimization". It is a library of
functions that manage an application's display on character-cell
terminals (e.g., VT100).
On Mon, 2009-10-12 at 17:13 -0500, Luke Paireepinart wrote:
> Not sure what curses means but that module only works on Unix. It does
> do
e presence of these two characters as an indication that
the file is a script, and tries to execute that script using the
interpreter specified by the rest of the first line in the file.
Mark
On Mon, 2009-10-12 at 14:49 -0700, Katt wrote:
> Hello all,
>
> Numerous times I see the follo
authenticated based on the key pair. Check out ssh-copy-id.
Mark
On Fri, 2009-10-16 at 13:45 -0600, Nathan Farrar wrote:
> I'm trying to automate the collection of data to remote devices over
> ssh via pexpect. I had originally attempted (with limited success) to
> use paramiko, however
The split method in the "re" module does what you want here.
This is a method on compiled re_patterns, so first you construct
a regular expression that matches any of the desired separators:
>>> s = "spam;egg mail"
>>> x_re = re.compile(r'[; ]')
>>> s.split("; ")
['spam;egg ma
1001 - 1100 of 1119 matches
Mail list logo