On 25 Jun 2019 15:50, stephen.m.sm...@comcast.net wrote:
Introduction:
I have written a 'program' that does some reasonable screen scraping off of
a specific website. The program has gotten too large so I have tried to
segment it into logical pieces (tkinter logic as a start) but I am having
pr
On 16 Jul 2019 23:31, Daniel Bosah wrote:
Hi all,
I have a problem trying to match items in a dict and pandas series in
Python.
I have a dict ( called city_dict )of cities and city_id's ; for each city (
which is a key in the dict ), a unique city_id is a value in that dict.
So for example,
Ooops, forgot to 'reply all'
-- Forwarded message ------
From: Albert-Jan Roskam
Date: 28 Jun 2019 21:31
Subject: Re: [Tutor] Unexpected result when running flask application.
To: Cameron Simpson
Cc:
On 20 Jun 2019 00:56, Cameron Simpson wrote:
On 19Jun2019 09:54,
On 7 Apr 2019 14:07, Peter Otten <__pete...@web.de> wrote:
Diana Katz wrote:
> 1) Can you use python from excel? Or just export to excel?
> 2) I am trying to see if there's a way using python to automate all of
> this work that I need to do. I have to collect quarterly segment data for
> hundre
On 21 Mar 2019 12:11, Alan Gauld via Tutor wrote:
On 21/03/19 00:28, Chris Roy-Smith wrote:
> Yes I knew that buttons need a function to do anything.
>
> I was hoping that the wheel didn't need re-inventing.
===>> A few are available:
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/b
On 13 Mar 2019 18:14, Alan Gauld via Tutor wrote:
On 11/03/2019 16:10, Diana Katz wrote:
> What is the best way to ..program using python - that could recognize
> a 3D object and then rank drawings of the object as to which are more
> accurate.
===>> check this out:
https://pytorch.org/tutor
On 28 Feb 2019 15:45, nathan tech wrote:
Hi there,
I recently started working on a backup program, and the one big feature
everyone wants in backup programs is the ability to schedule backups, right?
but I'm thinking, should I do this?
==》 this might interest you: https://docs.python.org/3/
On 8 Feb 2019 19:18, Chip Wachob wrote:
Hello,
I've been off working on other projects, but I'm finally back to the
project that so many here have helped me work through. Thank you to the
group at large.
So, this leads me to my question for today.
I'm not sure what the "correct" term is for
On 10 Nov 2018 01:03, Steven D'Aprano wrote:
On Thu, Nov 08, 2018 at 11:34:35AM -0500, Avi Gross wrote:
> An interesting discussion that is outside the scope of a group like this is
> HOW malicious things can be done and perhaps how to avoid them.
>
Isn't the rule, simply:
this_is_stupid = e
On 8 Nov 2018 17:34, Avi Gross wrote:
> What can you do to minimize risks in such > situations?
ast.literal_eval, with a smallish maximum string length?
https://docs.python.org/3/library/ast.html.
(That's exactly the only ast function that know! :-)
From: Tutor on behalf of
Alan Gauld via Tutor
Sent: Thursday, November 8, 2018 10:49 AM
To: tutor@python.org
Subject: Re: [Tutor] Regex for Filesystem path (Asad)
On 08/11/2018 02:55, Asad wrote:
> Why is it putting \ this breaks the unix path it should be:
>
> /a/b/c/d/test/2
On 7 Nov 2018 20:36, Mats Wichmann wrote:
Not sure what you're after, but what's wrong with just setting them?
Parent.avar = "a class var"
Hi Alan, Mats,
I should have mentioned that the code is part of a function sql_to_hdf5. So it
should be able to convert an *arbitrary* Sql server table
Hi,
Background: In my code I use sqlalchemy to read SQL server data. I want to
write that data to HDF5 using pytables (see 'declaring a column descriptor':
https://www.pytables.org/usersguide/tutorials.html). My question is not about
pytables or sqlalchemy per se, but I thought it would be info
On 19 Oct 2018 18:09, Pat Martin wrote:
TLDR; How do you figure out if code is inefficient (if it isn't necessarily
obvious) and how do you find a more efficient
-
Hi, check this: https://docs.python.org/3/library/profile.html. Also, the
timeit module is handy for smaller snippets.
_
From: eryk sun
Sent: Monday, October 15, 2018 12:10 PM
To: tutor@python.org
Cc: sjeik_ap...@hotmail.com
Subject: Re: [Tutor] what does the forward slash mean in this function
signature?
On Mon, Oct 15, 2018 at 6:00 AM Albert-Jan Roskam
wrote:
>
> In Python 3.6 (Windows) I often
Hello,
In Python 3.6 (Windows) I often see a forward slash in a function signature,
see below. What does it mean? I vaguely remember reading something about new
possbilities in python 3, something like "def foo(x, *, y)". Perhaps it's
related to that?
>>> help({}.fromkeys)
Help on built-in f
From: Tutor on behalf of
Peter Otten <__pete...@web.de>
Sent: Monday, August 27, 2018 6:43 PM
To: tutor@python.org
Subject: Re: [Tutor] need help generating table of contents
Albert-Jan Roskam wrote:
>
> From: Tutor on behalf
> of Peter Otten <__pete...@web.de> Se
From: Tutor on behalf of
Peter Otten <__pete...@web.de>
Sent: Friday, August 24, 2018 3:55 PM
To: tutor@python.org
> The following reshuffle of your code seems to work:
>
> print('\r\n** Table of contents\r\n')
> pattern = '/Title \((.+?)\).+?/Page ([0-9]+)(?:\s+/Count ([0-9]+))?'
>
> def pr
Hello,
I have Ghostscript files with a table of contents (toc) and I would like to use
this info to generate a human-readable toc. The problem is: I can't get the
(nested) hierarchy right.
import re
toc = """\
[ /PageMode /UseOutlines
/Page 1
/View [/XYZ null null 0]
/DOCVIEW pdfmark
[ /
On 21 Aug 2018 15:10, Glenn Schultz via Tutor wrote:
All,
I have a project pthon(3.7) I have followed the python setup instructions. I
get a dist folder with the correct files. Now, I would like to install locally
from my local machine (note I am not using virtual enviroment as our firewall
On 27 Jul 2018 06:34, boB Stepp wrote:
I am near the end of reading "Documenting Python Code: A Complete
Guide" by James Mertz, found at
https://realpython.com/documenting-python-code/ This has led me to a
few questions:
(1) The author claims that reStructuredText is the official Python
doc
Op 11 mei 2018 21:43 schreef Neil Cerutti :
On 2018-05-10, Albert-Jan Roskam wrote:
> If a punctuation symbol is in your string: Replace that symbol
> with an empty string.
>
>=>>> maybe something like
>
> import re
> no_interpunction = re.sub("[
Verzonden vanaf mijn Samsung Galaxy-smartphone.
Oorspronkelijk bericht
Van: boB Stepp
Datum: 10-05-18 21:53 (GMT+08:00)
Aan: tutor
Onderwerp: Re: [Tutor] Iteration issues
On Wed, May 9, 2018 at 6:27 PM, Roger Lea Scherer wrote:
> Hello, again.
>
> I want to count words in
On Apr 28, 2018 06:54, Glenn Schultz wrote:
>
> All,
>
> I have the following set-up (below) which will be used to call data from
> multiple sectors. There is a sql query (transact sql) and connection. This
> works fine. However, I would like to parametrize the query so I can enter
> differ
On Apr 21, 2018 09:06, Peter Otten <__pete...@web.de> wrote:
>
> Glen wrote:
>
> > Thank you for your comprehensive reply. It was very helpful!
> > Just to clarify one point, is it not possible to search for a node
> > directly in the element / elementTree or do you first need to pull the
> > data
0:58:51PM +0100, Alan Gauld via Tutor wrote:
> > >>> On01/04/18 20:20, Albert-Jan Roskam wrote:
> > >>>> fmt="%Y-%m-%d %H:%M\n"
> > >>>> f.write(now.strftime(fmt))
> > >>>> Lately I've been using forma
On Mar 30, 2018 10:39, Alan Gauld via Tutor wrote:
>
> On 30/03/18 03:48, Pat Martin wrote:
>
> > the "right" way to do it in python?
>
> More or less, a couple of comments below...
>
> > def Main():
>
> Python function names begin with a lowercase letter by convention.
>
> > """Run if run as
Op 29 mrt. 2018 21:06 schreef "Shall, Sydney" :
>
> I have a problem with a specific test, I think.
>
> I use a Mac with OS X 10.13.3
> I use Anaconda with Python 3.5
>
> I have been writing tests for a Class that I have written. I am not
> finished yet, but there are already nearly 400 tests. The
On Feb 27, 2018 09:50, Alan Gauld via Tutor wrote:
>
> On 27/02/18 05:13, Cameron Simpson wrote:
>
> > hard to debug when you do. That's not to say you shouldn't use them, but
> > many
> > people use them for far too much.
>
>
> > Finally, you could also consider not using a regexp for this part
On Jan 10, 2018 19:32, Peter Otten <__pete...@web.de> wrote:
>
> Albert-Jan Roskam wrote:
>
> > Why does following the line (in #3)
>
> > # 3-
> > class Meta(type):
> > def __new__(cls, name, b
On Jan 10, 2018 18:57, Steven D'Aprano wrote:
>
> On Wed, Jan 10, 2018 at 04:08:04PM +0000, Albert-Jan Roskam wrote:
>
> > In another thread on this list I was reminded of
> > types.SimpleNamespace. This is nice, but I wanted to create a bag
> > class with cons
On Jan 11, 2018 03:47, Steven D'Aprano wrote:
>
> On Wed, Jan 10, 2018 at 08:02:24PM -0600, boB Stepp wrote:
>
> > I am still puzzling over things from the thread, "Why does
> > os.path.realpath('test_main.py') give different results for unittest
> > than for testing statement in interpreter?" T
Hi,
In another thread on this list I was reminded of types.SimpleNamespace. This is
nice, but I wanted to create a bag class with constants that are read-only. My
main question is about example #3 below (example #2 just illustrates my thought
process). Is this a use case to a metaclass? Or can
From: eryk sun
Sent: Wednesday, January 10, 2018 3:56 AM
To: tutor@python.org
Cc: Albert-Jan Roskam
Subject: Re: [Tutor] Why does os.path.realpath('test_main.py') give different
results for unittest than for testing statement in interpreter?
On Tue, Jan 9, 2018 at 2:48 PM, Albert-
From: Tutor on behalf of
Steven D'Aprano
Sent: Tuesday, January 9, 2018 8:47 AM
To: tutor@python.org
Subject: Re: [Tutor] Why does os.path.realpath('test_main.py') give different
results for unittest than for testing statement in interpreter?
> The Python 3.5 source code for os.path.realpat
On Jan 7, 2018 09:08, Steven D'Aprano wrote:
>
> On Sun, Jan 07, 2018 at 12:49:59AM -0600, boB Stepp wrote:
>
> > Win7, Python 3.6.2
> >
> > If I run a unit test with the following embedded:
> >
> > print('realpath =', os.path.realpath('test_main.py'))
> >
> > I get the following in my test outpu
Op 23 dec. 2017 09:47 schreef Peter Hodges :
>
> Hi. I downloaded Python 3.6 from the python site, then followed online
> directions for pip to install numpy (in users? —user was in the example).
> When I start IDLE in the Python 3.6 in Applications and then type import
> numpy as np I get the f
On Dec 21, 2017 09:58, Tim Cordsen via Tutor wrote:
>
> Hello everybody,
> I am doing a python online class and I am lost. The "teacher" is a little
> chaotic and doesn't provide his code, so everyone must type on their own.
>
> Now the class reached a point where I am lost. It is about doing a s
Op 23 dec. 2017 09:47 schreef Peter Hodges :
>
> Hi. I downloaded Python 3.6 from the python site, then followed online
> directions for pip to install numpy (in users? —user was in the example).
> When I start IDLE in the Python 3.6 in Applications and then type import
> numpy as np I get the f
Op 12 dec. 2017 10:52 schreef Steven D'Aprano :
>
> On Mon, Dec 11, 2017 at 02:04:59PM +, adil gourinda wrote:
> > Hi
> > Please I have two questions:
> >
> > 1) Why restructuredtext's documentation is not included as a part of
> > the official Python's documentation?
>
> Because RestructuredT
On Oct 16, 2017 15:12, Neil Cerutti wrote:
>
> On 2017-10-15, boB Stepp wrote:
> > Some things I am still pondering:
> >
> > 1) If I adopt the incremental approach to creating and
> > initializing the working db, then it seems that the list,
> > "sql_scripts", should not be hard-coded into the
(sorry for top-posting)
Perhaps this? https://pythonhosted.org/psutil/
From: Tutor on behalf of
Michael C
Sent: Tuesday, October 3, 2017 9:30:43 PM
To: python tutor
Subject: [Tutor] ctypes wintypes
Hi all:
I am trying to create SYSTEM_INFO structure and MEMOR
Hi,
I often read messages to this list from my Android from the mobile Hotmail
page. On other occasions I would read from my browser, from a Windows or a
Linux desktop. Howver, Hotmail pretty much sucks when it comes to obeying the
posting style [1]. It's even worse than Yahoo mail, which I've
Dear Mats, Peter and Eryk,
THANK YOU for your replies. What a wealth of information!
Have a great weekend!
Albert-Jan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
From: Tutor on behalf of
Peter Otten <__pete...@web.de>
Sent: Monday, September 25, 2017 2:59 PM
To: tutor@python.org
Subject: Re: [Tutor] logging to cmd.exe
Albert-Jan Roskam wrote:
> Hi,
>
>
> With Python 3.5 under Windows I am using the logging module to
From: Tutor on behalf of
Mark Lawrence via Tutor
Sent: Monday, September 25, 2017 4:19 PM
To: tutor@python.org
Subject: Re: [Tutor] logging to cmd.exe
On 25/09/2017 14:20, Albert-Jan Roskam wrote:
> Hi,
>
>
> With Python 3.5 under Windows I am using the logging module to
Hi,
With Python 3.5 under Windows I am using the logging module to log messages to
stdout (and to a file), but this occasionally causes logging errors because
some characters cannot be represented in the codepage used by cmd.exe (cp850,
aka OEM codepage, I think). What is the best way to preve
(sorry for top posting)
There are various SQL abstraction layers for this. I have only used Sqlalchemy.
This package has two APIs: query and ORM. You might want to look at the query
API. This is closer to SQL than ORM. You can use straight(obj) to inspect the
SQL that's emitted
From: Tutor on behalf of GMX
Sent: Monday, September 11, 2017 9:38 AM
To: tutor@python.org
Subject: [Tutor] How to create an object in database only if the object is not
already there?
Now when I create a Course object like this:
>>> Course(title=‘A new course’)
An object is create in
From: Tutor [tutor-bounces+sjeik_appie=hotmail@python.org] on behalf of
Alan Gauld via Tutor [tutor@python.org]
Sent: Tuesday, July 4, 2017 8:37 AM
To: tutor@python.org
Subject: Re: [Tutor] [Python2.7] Convert (2,188,1) into (188,1)
On 28/06/17 16:48,
my_plot.grid(row=0, column=0) # use grid here
button = Button (root, text="quit", fg='red', command=root.quit)
button.grid(row=1, column=0)
root.mainloop()
From: Pooja Bhalode
Sent: Sunday, February 26, 2017 3:47:37 PM
To: Albert-Jan Roskam
Subje
(Sorry for top-posting)
Hi, I recently ran into the same problem when I wanted to embed an interactive
Matplotlib choropleth in my Tkinter app. I solved it by creating a separate
class MyPlot for plot + toolbar (it inherited from Tkinter.Frame). MyPlot
internally uses the pack geometry manager
Hi,
Why does the call to str() below return '1' and not 'one'? Should I implement
__new__ because int is immutable? I have a datafile that contains values and an
associated metadata file with the associated labels. I need to recode the
values. Because just using the values is a bit error prone
Hi,
I have created a grid of Tkinter Entry object that looks a bit like a sheet in
MS Excel. The data come from a pandas.DataFrame. I use a nested loop, one for
rows and one for cols. Inside the loop, I create the Entry instances which I
also grid() right away.
This works nicely, though a litt
From: Tutor on behalf of
Steven D'Aprano
Sent: Thursday, September 1, 2016 1:24 AM
To: tutor@python.org
Subject: Re: [Tutor] __init__
On Wed, Aug 31, 2016 at 06:35:44PM +0000, Albert-Jan Roskam wrote:
>
> >In Python 3, old-style classes are gone. Even in Python 2, they'
>In Python 3, old-style classes are gone. Even in Python 2, they're
>discouraged.
This suggests that old-style classes are still used, even in Python 3, doesn't
it?
albertjan@debian:~$ python3.5
Python 3.5.0 (default, Apr 13 2016, 20:39:27)
[GCC 4.9.2] on linux
Type "help", "copyright", "cred
Hi,
I have a Tkinter program where I can fire up a commandline program which could
run for quite a while (let's say 15 minutes or more). While the program is
running, I would like to show the output that I normally see in the terminal
(actually, the target platform is windows but now I am on Li
> Date: Thu, 9 Jun 2016 03:57:21 +1000
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] Urgent: unicode problems writing CSV file
>
> On Wed, Jun 08, 2016 at 01:18:11PM -0400, Alex Hall wrote:
>>
>> csvWriter.writerow([info.encode("utf8") if type(info)is unicode else
(sorry for top-posting)
I liked
https://www.packtpub.com/application-development/python-testing-beginners-guide
though perhaps it was a bit too basic. It covers forest, unit test, nose.
> Date: Thu, 19 May 2016 12:34:27 -0700
> From: carr...@tjc.com
> To: tutor@python.org
> Subject: [Tutor] Get
> From: oscar.j.benja...@gmail.com
> Date: Thu, 14 Apr 2016 21:34:39 +0100
> Subject: Re: [Tutor] question about __copy__ and __deepcopy__
> To: sjeik_ap...@hotmail.com
> CC: tutor@python.org
>
> On 14 April 2016 at 20:38, Albert-Jan Roskam wrote:
> > Hi,
> >
> Date: Fri, 15 Apr 2016 16:30:16 +1000
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] question about __copy__ and __deepcopy__
>
> On Thu, Apr 14, 2016 at 07:38:31PM +, Albert-Jan Roskam wrote:
> > Hi,
> >
> > Lately I hav
Hi,
Lately I have been using the "mutable namedtuple" shown below a lot. I found
it somewhere on StackOverflow or ActiveState or something.
In its original form, it only had an __init__ method. I noticed that copying
Record objects sometimes failed. So I implemented __copy__ and __deepcopy__,
I
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Sat, 2 Apr 2016 09:08:04 +0100
> Subject: Re: [Tutor] Alan G Week 10 warmup assignment help
>
> On 02/04/16 02:21, Daniella Sapozhnikova wrote:
> > I changed the file to this:
>
> > DATA = {2: 7493945,
> > 76: 4654320,
> .
> Date: Mon, 21 Mar 2016 02:50:17 +1100
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] __str__ vs. sys.displayhook
>
> On Sun, Mar 20, 2016 at 01:53:04PM +, Albert-Jan Roskam wrote:
>> Hi,
>>
Hi,
The other day I was playing with this to make a convenient string version of a
named tuple:
>>> from collections import namedtuple as nt
>>> Record = nt("Record", "x y z")
>>> Record.__str__ = lambda self: "| %s |" % " | ".join([item + ": " +
>>> str(getattr(self, item)) for item in self._f
< snip lots of useful info >
Hi all,
Thanks a lot for all your replies. I am whole lot wiser now :)
Best wishes,
Albert-Jan
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription optio
> From: eryk...@gmail.com
> Date: Sun, 13 Mar 2016 13:58:46 -0500
> Subject: Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???
> To: tutor@python.org
> CC: sjeik_ap...@hotmail.com
>
> On Sun, Mar 13, 2016 at 3:14 AM, Albert-Jan R
> Date: Sun, 13 Mar 2016 19:19:55 -0500
> From: robertvst...@gmail.com
> To: tutor@python.org
> Subject: Re: [Tutor] Pmw/Tkinter question
>
> I just cannot leave this problem alone; however, I *do* believe I have
> found the correct way to do what Albert-Jan desires within the
> publicly accessib
> Date: Sat, 12 Mar 2016 23:08:20 -0600
> Subject: Re: [Tutor] Pmw/Tkinter question
> From: robertvst...@gmail.com
> To: sjeik_ap...@hotmail.com
> CC: tutor@python.org
>
> On Sat, Mar 12, 2016 at 2:17 AM, Albert-Jan Roskam
> wrote:
> From: eryk...@gmail.com
> Date: Sun, 13 Mar 2016 01:39:11 -0600
> To: tutor@python.org
> Subject: Re: [Tutor] Changing the interpreter prompt symbol from ">>>" to ???
>
> On Sat, Mar 12, 2016 at 12:46 AM, boB Stepp wrote:
> > I did with the non-printing control character, but not with '\u25ba
> From: d...@hashcollision.org
> Date: Sat, 12 Mar 2016 18:34:02 -0800
> To: robertvst...@gmail.com
> Subject: Re: [Tutor] OT: (Continuous) integration testing: Can a solo
> developer with very limited resources truly do this?
> CC: tutor@python.org
>
> On Sat, Mar 12, 2016 at 10:10 AM, boB Ste
> To: tutor@python.org
> From: __pete...@web.de
> Date: Sat, 12 Mar 2016 10:28:36 +0100
> Subject: Re: [Tutor] Pmw/Tkinter question
>
> Albert-Jan Roskam wrote:
>
> > Hello,
> >
> > Below is a slightly modified example about Pmw/Tkinter from
> > ht
Hello,
Below is a slightly modified example about Pmw/Tkinter from
http://pmw.sourceforge.net/doc/howtouse.html.
I changed the geometry manager from 'pack' to 'grid', because I use that in all
other parts of my program.
The problem is, 'broccoli' won't display nicely under vege_menu. I want it t
> Date: Thu, 3 Mar 2016 15:54:56 -0600
> From: da...@graniteweb.com
> To: tutor@python.org
> Subject: Re: [Tutor] Recommendations for best tool to write/run Python :p:
>
> * Alan Gauld [2016-03-03 11:02]:
> > On 03/03/16 09:31, Thomas C. Hicks wrote:
> > > On 03/03/2016 02:26 AM, Lisa Hasler Wate
> From: oscar.j.benja...@gmail.com
> Date: Fri, 29 Jan 2016 16:32:57 +
> Subject: Re: [Tutor] lc_ctype and re.LOCALE
> To: sjeik_ap...@hotmail.com
> CC: tutor@python.org
>
> On 28 January 2016 at 20:23, Albert-Jan Roskam
> wrote:
> >
> > Out of curi
> From: eryk...@gmail.com
> Date: Fri, 29 Jan 2016 07:14:07 -0600
> Subject: Re: [Tutor] lc_ctype and re.LOCALE
> To: tutor@python.org
> CC: sjeik_ap...@hotmail.com
>
> On Thu, Jan 28, 2016 at 2:23 PM, Albert-Jan Roskam
> wrote:
> > Out of curiosity, I wrote the t
> Subject: Re: [Tutor] lc_ctype and re.LOCALE
> > To: sjeik_ap...@hotmail.com
> > CC: tutor@python.org
> >
> > On 28 January 2016 at 20:23, Albert-Jan Roskam
> > wrote:
> > >
> > > Out of curiosity, I wrote the throw-away script below to find
> Date: Fri, 29 Jan 2016 14:50:57 +
> Subject: [Tutor] http://www.rmunn.com/sqlalchemy-tutorial/tutorial.html
sorry, I did not intend to send this to Python Tutor (the link is awesome,
though)
___
Tutor ma
from sqlalchemy import *
db = create_engine('sqlite:///joindemo.db')
db.echo = True
metadata = BoundMetaData(db)
users = Table('users', metadata, autoload=True)
emails = Table('emails', metadata, autoload=True)
# These are the empty classes that will become our data classes
class User(object
> Date: Wed, 27 Jan 2016 02:24:35 +1100
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> On Sun, Jan 24, 2016 at 07:47:47PM +, Albert-Jan Roskam wrote:
>
>>&
Hi,
Out of curiosity, I wrote the throw-away script below to find a character that
is classified (--> LC_CTYPE) as digit in one locale, but not in another.
I ran it with 5000 locale combinations in Python 2 but did not find any
(somebody shut down my computer!). I just modified the code so it al
> To: tutor@python.org
> From: __pete...@web.de
> Date: Sun, 24 Jan 2016 11:22:19 +0100
> Subject: Re: [Tutor] Change datatype for specific columns in an 2D array &
> computing the mean
> How do you want to convert the second and third column to int? Are A4 and B2
> hex numbers? Then try
>
>
> From: oscar.j.benja...@gmail.com
> Date: Thu, 21 Jan 2016 11:02:40 +
> To: ben+pyt...@benfinney.id.au
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
> CC: tutor@python.org
>
> On 21 January 2016 at 09:19, Ben Finney wrote:
> > Albert-Jan Roskam
> To: tutor@python.org
> From: ben+pyt...@benfinney.id.au
> Date: Fri, 22 Jan 2016 04:12:08 +1100
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> Ben Finney writes:
>
> > Oscar Benjamin writes:
> >
> > > According to a narrow definition of indexed access. I would say that
> > >
> Date: Fri, 22 Jan 2016 11:00:00 +1100
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> Further thoughts on your question...
>
>
> On Wed, Jan 20, 2016 at 01:33:17PM +, Albert-Jan Roskam wrote
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Fri, 22 Jan 2016 00:12:18 +
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> On 22/01/16 00:00, Steven D'Aprano wrote:
>
> > Also, you have a problem -- what happens if the incomplete postcode is
> > missing t
> To: tutor@python.org
> From: breamore...@yahoo.co.uk
> Date: Thu, 21 Jan 2016 21:02:03 +
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> On 20/01/2016 13:33, Albert-Jan Roskam wrote:
> > Hi,
> >
> > Like the subject says: Why is an
> Date: Thu, 21 Jan 2016 12:00:29 +1100
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] Why is an OrderedDict not sliceable?
>
> On Wed, Jan 20, 2016 at 01:33:17PM +, Albert-Jan Roskam wrote:
> > Hi,
> >
> > Like the sub
Hi,
Like the subject says: Why is an OrderedDict not sliceable? (From the
collections library). Was that an intentional omission, or a mistake? [1]
Background: I do not use OrderedDict very often, but I thought I could use it
to look up street and city names using postcodes ([0-9]{4} [a-z]{2} f
regex more
> > readable (!):
> >>>> re.sub(r"_1$", "", "V01_1")
> > 'V01'
>
>
> Hi Albert-Jan Roskam,
>
> Here's a minor counterpoint to using regexes here: they're sometimes a
> bit too powerful. Yes, cert
> To: tutor@python.org
> From: cmgcom...@gmail.com
> Date: Thu, 14 Jan 2016 09:37:02 +0530
> Subject: Re: [Tutor] me, my arm, my availability ...
>
> take care, get well soon,
>
> regards
>
> CMG
>
> On Thursday 14 January 2016 02:17 AM, Laura Creighton wrote:
> > I fell recently. Ought to b
> From: eryk...@gmail.com
> Date: Thu, 14 Jan 2016 04:42:57 -0600
> Subject: Re: [Tutor] Question about the memory manager
> To: tutor@python.org
> CC: sjeik_ap...@hotmail.com
>
> On Thu, Jan 14, 2016 at 3:03 AM, Albert-Jan Roskam
> wrote:
> >
> > These two p
> To: tutor@python.org
> From: __pete...@web.de
> Date: Fri, 15 Jan 2016 17:37:25 +0100
> Subject: Re: [Tutor] str.strip strange result...?
>
> Jignesh Sutar wrote:
>
> > #python2.7
> >
> s="V01_1"
> s.strip("_1")
> > 'V0'
> >
> >
> > Wouldn't you expect the result to be "V01" ?
>
>
Subject: Re: [Tutor] Question about the memory manager
> > To: sjeik_ap...@hotmail.com
> > CC: tutor@python.org
> >
> > [Albert-Jan Roskam ]
> > > I just found a neat trick to free up an emergency stash of memory in
> > > a funtion that overrides sys.excep
> From: tim.pet...@gmail.com
> Date: Sun, 10 Jan 2016 10:54:10 -0600
> Subject: Re: [Tutor] Question about the memory manager
> To: sjeik_ap...@hotmail.com
> CC: tutor@python.org
>
> [Albert-Jan Roskam ]
> > I just found a neat trick to free up an emergency stash of m
> To: tutor@python.org
> From: __pete...@web.de
> Date: Sun, 10 Jan 2016 18:29:06 +0100
> Subject: Re: [Tutor] Question about the memory manager
>
> Albert-Jan Roskam wrote:
>
> > Hi,
> >
> > I just found a neat trick to free up an emergency stash of
Hi,
I just found a neat trick to free up an emergency stash of memory in a funtion
that overrides sys.excepthook. The rationale is that all exceptions, including
MemoryErrors will be logged.
The code is below. My question: is that memory *guaranteed* to be freed right
after the 'del' statement?
Hi all,
Thanks a lot for your replies!
> Date: Wed, 25 Nov 2015 05:19:57 +1100
> From: st...@pearwood.info
> To: tutor@python.org
> Subject: Re: [Tutor] a class that may not be instantiated
>
> On Tue, Nov 24, 2015 at 03:36:21PM +, Albert-Jan Roskam wrote:
> >
Hi,
I have two classes with a number of methods that are the same, so I want to
define a super class that holds these methods. But the super class (below
called _Generic) should not be instantiated, because it serves no purpose other
than the DRY principle. I raise a NotImplementedError in case
(Sorry for top-posting)
Could it be related to this?
https://www.emailonacid.com/blog/article/industry-news/could_yahoo_and_aols_dmarc_policies_destroy_your_deliverability
Albert-Jan
> To: tutor@python.org
> From: alan.ga...@btinternet.com
> Date: Sun, 15 Nov 2015 00:08:37 +
> Subject: [Tut
1 - 100 of 552 matches
Mail list logo