Re: Questions about XML processing?

2020-11-08 Thread Hernán De Angelis
On 2020-11-07 20:03, Dieter Maurer wrote: Hernán De Angelis wrote at 2020-11-6 21:54 +0100: ... However, the hard thing to do here is to get those only when tagC/note/title/string='value'. I was expecting to find a way of specifying a certain construction in square brackets, like [@string='valu

Re: Questions about XML processing?

2020-11-07 Thread Dieter Maurer
Hernán De Angelis wrote at 2020-11-6 21:54 +0100: > ... >However, the hard thing to do here is to get those only when >tagC/note/title/string='value'. I was expecting to find a way of >specifying a certain construction in square brackets, like >[@string='value'] or [@/tagC/note/title/string='value'

Re: Questions about XML processing?

2020-11-07 Thread Hernán De Angelis
No, it is XML metadata. I also believe there should be a better way using [@...] expressions in the path. H. Den lör 7 nov. 2020 13:14Shaozhong SHI skrev: > Hi, Hernan, > > Did you try to parse GML? > > Surely, there can be very concise and smart ways to do these things. > > Regards, > > David

Re: Questions about XML processing?

2020-11-07 Thread Shaozhong SHI
Hi, Hernan, Did you try to parse GML? Surely, there can be very concise and smart ways to do these things. Regards, David On Fri, 6 Nov 2020 at 20:57, Hernán De Angelis wrote: > Thank you Terry, Dan and Dieter for encouraging me to post here. I have > already solved the problem albeit with a

Re: Questions about XML processing?

2020-11-06 Thread Hernán De Angelis
Thank you Terry, Dan and Dieter for encouraging me to post here. I have already solved the problem albeit with a not so efficient solution. Perhaps, it is useful to present it here anyway in case some light can be added to this. My job is to parse a complicated XML (iso metadata) and pick up v

Re: Questions about XML processing?

2020-11-06 Thread Terry Reedy
On 11/6/2020 11:17 AM, Hernán De Angelis wrote: I am confronting some XML parsing challenges and would like to ask some questions to more knowledgeable Python users. Apparently there exists a group for such questions but that list (xml-sig) has apparently not received (or archived) posts since

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
On 8/2/20 5:38 PM, o1bigtenor wrote: > On Sun, Aug 2, 2020 at 2:08 PM Dennis Lee Bieber > wrote: >> On Sat, 1 Aug 2020 19:24:41 -0500, o1bigtenor >> declaimed the following: >> >>> It is very disappointing - - - -suggests that thinking outside the space of >>> one year is somehow deprecated. Fru

Re: questions re: calendar module

2020-08-02 Thread o1bigtenor
On Sun, Aug 2, 2020 at 2:08 PM Dennis Lee Bieber wrote: > > On Sat, 1 Aug 2020 19:24:41 -0500, o1bigtenor > declaimed the following: > > > > >It is very disappointing - - - -suggests that thinking outside the space of > >one year is somehow deprecated. Frustrated when what you do demands > >that

Re: questions re: calendar module

2020-08-02 Thread o1bigtenor
On Sun, Aug 2, 2020 at 2:28 PM Richard Damon wrote: > > On 8/2/20 12:58 PM, Dennis Lee Bieber wrote: > > Yet follows what most /print/ calendars contain (though some companies > > put the last four months of the current year in a 4-up page, before doing > > one month per page for the new yea

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
On 8/2/20 12:58 PM, Dennis Lee Bieber wrote: > Yet follows what most /print/ calendars contain (though some companies > put the last four months of the current year in a 4-up page, before doing > one month per page for the new year). "Daily planner" journals also tend to > cover just one year

Re: questions re: calendar module

2020-08-02 Thread Peter Otten
Richard Damon wrote: > I would likely just build the formatter to start by assuming 6 week > months, and then near the end, after stacking the side by side months, > see if it can be trimmed out (easier to remove at the end then add if > needed) If you like some itertools gymnastics: you can form

Re: questions re: calendar module

2020-08-02 Thread Richard Damon
On 8/2/20 7:26 AM, o1bigtenor wrote: > The differences become very relevant for formatting. A month that has > 4 weeks takes a different amount of vertical space than a month that > has 6 weeks. The only month that has only 4 weeks would be Febuary, on non-lead years, that starts on Sunday (or wha

Re: questions re: calendar module

2020-08-02 Thread 2QdxY4RzWzUUiLuE
On 2020-08-02 at 06:26:10 -0500, o1bigtenor wrote: > On Sat, Aug 1, 2020 at 11:33 PM dn via Python-list > wrote: > > The fact that some months have fewer, or more, weeks to include, is > > largely irrelevant. The solution is a standard "merge" algorithm. (us > > 'silver surfers' cut our teeth o

Re: questions re: calendar module

2020-08-02 Thread o1bigtenor
On Sat, Aug 1, 2020 at 11:33 PM dn via Python-list wrote: > > On 02/08/2020 12:24, o1bigtenor wrote: > > On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list > > wrote: > >> On 01/08/2020 23:36, o1bigtenor wrote: > >>> On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list > >>> mailto:python-list@python

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:42, o1bigtenor wrote: On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/07/2020

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 02/08/2020 12:24, o1bigtenor wrote: On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regularly work i

Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 7:24 PM o1bigtenor wrote: > > On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list > wrote: > > > > On 01/08/2020 23:36, o1bigtenor wrote: > > > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list > > > mailto:python-list@python.org>> wrote: > > > > > > On 31/07/2020 02:52,

Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:29 PM dn via Python-list wrote: > > On 01/08/2020 23:36, o1bigtenor wrote: > > On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list > > mailto:python-list@python.org>> wrote: > > > > On 31/07/2020 02:52, o1bigtenor wrote: > > > I regularly work in planning through mu

Re: questions re: calendar module

2020-08-01 Thread dn via Python-list
On 01/08/2020 23:36, o1bigtenor wrote: On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list mailto:python-list@python.org>> wrote: On 31/07/2020 02:52, o1bigtenor wrote: > I regularly work in planning through multiple years at once. > This means that I like to have a lot of stuff ava

Re: questions re: calendar module

2020-08-01 Thread William Ray Wing via Python-list
> On Aug 1, 2020, at 10:35 AM, o1bigtenor wrote: > > On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor wrote: >> >>> On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote: >>> >>> o1bigtenor wrote: >>> >>> import calendar >>> print (calendar.calendar(2024,1,1,2,8)) >>> I

Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 9:29 AM o1bigtenor wrote: > > On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote: > > > > o1bigtenor wrote: > > > > import calendar > > print (calendar.calendar(2024,1,1,2,8)) > > > > > I would like to show something like 2024 through the end of 20

Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 6:58 AM Peter Otten <__pete...@web.de> wrote: > > o1bigtenor wrote: > > import calendar > print (calendar.calendar(2024,1,1,2,8)) > > > I would like to show something like 2024 through the end of 2028. > > print("\n".join(cd.calendar(year) for year in range(2024, 20

Re: questions re: calendar module

2020-08-01 Thread Peter Otten
o1bigtenor wrote: import calendar print (calendar.calendar(2024,1,1,2,8)) > I would like to show something like 2024 through the end of 2028. print("\n".join(cd.calendar(year) for year in range(2024, 2029))) -- https://mail.python.org/mailman/listinfo/python-list

Re: questions re: calendar module

2020-08-01 Thread o1bigtenor
On Sat, Aug 1, 2020 at 1:29 AM dn via Python-list wrote: > On 31/07/2020 02:52, o1bigtenor wrote: > > I regularly work in planning through multiple years at once. > > This means that I like to have a lot of stuff available in a calendar > > function. > > Python seems to be locked when I need to d

Re: questions re: calendar module

2020-07-31 Thread dn via Python-list
On 31/07/2020 02:52, o1bigtenor wrote: I regularly work in planning through multiple years at once. This means that I like to have a lot of stuff available in a calendar function. Python seems to be locked when I need to display more than 1 year at a time. I don't see a way to display something l

Re: questions:

2020-04-01 Thread DL Neil via Python-list
On 2/04/20 6:49 AM, anson freer wrote: Will Anaconda2, Python2, jupyter and many applications I have for python harm the 3.8.2? should I be in Python Tutor and in this one(current email)at the same time? Or is it one or the other not both I want to learn how to use PDF to read files that have rac

Re: Questions about the IO modules and C-api

2019-06-03 Thread eryk sun
On 6/2/19, Windson Yang wrote: > > f = open('myfile, 'a+b') This is missing the closing quote around 'myfile'. > I added a printf statement at the beginning of _io_open_impl Repeatedly rebuilding the interpreter sounds like a frustrating learning experience, IMO. Use a debugger such as gdb

Re: Questions about the IO modules and C-api

2019-06-02 Thread Thomas Jollans
On 03/06/2019 04:02, Windson Yang wrote: > I have some questions about the IO modules. > > 1. My script: > > f = open('myfile, 'a+b') > f.close() > > I added a printf statement at the beginning of _io_open_impl >

Re: Questions on Instance methods

2019-04-22 Thread dieter
Arup Rakshit writes: > ... > As you saw from documentation link, those are just words kind of spec. > Which source you recommend to read which explains these concepts more with > example codes. I cannot help you much with this -- I am much turned towards spec[ification] like documentation and ha

Re: Questions on Instance methods

2019-04-21 Thread eryk sun
On 4/21/19, Arup Rakshit wrote: > > I am reading https://docs.python.org/3/reference/index.html now, and it > seems like saying what Python can do, but not going deep to explain it > to a new comers most of the time. The guide to Python descriptors may help. https://docs.python.org/3/howto/descr

Re: Questions on Instance methods

2019-04-21 Thread Arup Rakshit
Hello Dieter, Thanks for taking time to explain this. I understood it half way, but that is my problem. I need to spend some more months to feel in home I guess. As you saw from documentation link, those are just words kind of spec. Which source you recommend to read which explains these conce

Re: Questions on Instance methods

2019-04-19 Thread dieter
Arup Rakshit writes: >>When an instance method object is created by retrieving a class method >> object from a class or instance, its __self__ attribute is the class itself, >> and its __func__ attribute is the function object underlying the class >> method. > > Here I have 2 questions: >

Re: Questions about weakref

2018-10-16 Thread Thomas Jollans
On 2018-10-16 11:10, Frank Millman wrote: > Hi all > > I have some questions about using weakrefs. > > My first question is whether weakrefs are the correct tool for my > situation. My use-case is not mentioned in the docs, so maybe it is not > intended to be used this way. > > I have a lot of o

Re: Questions about `locals` builtin

2018-02-28 Thread Chris Angelico
On Wed, Feb 28, 2018 at 10:59 PM, Steven D'Aprano wrote: > On Wed, 28 Feb 2018 18:01:42 +1100, Chris Angelico wrote: > >> If you really want a list of ALL the local names in a function, you can >> look at its __code__ object, which has a tuple of variable names: >> >> print(func1.__code__.co_varna

Re: Questions about `locals` builtin

2018-02-28 Thread Chris Angelico
On Wed, Feb 28, 2018 at 10:58 PM, Steven D'Aprano wrote: > On Wed, 28 Feb 2018 18:04:11 +1100, Chris Angelico wrote: >> But if you know that >> there's only a handful of variables that you'd actually want to do that >> to, you can simply put those into an object of some form, and then >> mutate th

Re: Questions about `locals` builtin

2018-02-28 Thread Steven D'Aprano
On Wed, 28 Feb 2018 18:01:42 +1100, Chris Angelico wrote: > If you really want a list of ALL the local names in a function, you can > look at its __code__ object, which has a tuple of variable names: > > print(func1.__code__.co_varnames) > > That information is static to the function, as it is i

Re: Questions about `locals` builtin

2018-02-28 Thread Steven D'Aprano
On Wed, 28 Feb 2018 18:04:11 +1100, Chris Angelico wrote: > On Wed, Feb 28, 2018 at 5:54 PM, dieter wrote: [...] >> I am still working with Python 2 (Python 3 may behave differently). >> There, during debugging, I would sometimes like to change the value of >> variables (I know that the variable

Re: Questions about `locals` builtin

2018-02-27 Thread Chris Angelico
On Wed, Feb 28, 2018 at 5:54 PM, dieter wrote: > Ned Batchelder writes: >> On 2/27/18 3:52 AM, Kirill Balunov wrote: >>> a. Is this restriction for locals desirable in the implementation of >>> CPython in Python 3? >>> b. Or is it the result of temporary fixes for Python 2? >> >> My understandi

Re: Questions about `locals` builtin

2018-02-27 Thread Chris Angelico
On Tue, Feb 27, 2018 at 5:55 AM, Kirill Balunov wrote: > 2. The documentation has a note that "The contents of this dictionary > should not be modified". Which implies that it is a read only mapping. So > the question why it is `dict` instead of `types.MappingProxyType`? A dict is smaller and fas

Re: Questions about `locals` builtin

2018-02-27 Thread dieter
Ned Batchelder writes: > On 2/27/18 3:52 AM, Kirill Balunov wrote: >> a. Is this restriction for locals desirable in the implementation of >> CPython in Python 3? >> b. Or is it the result of temporary fixes for Python 2? > > My understanding is that the behavior of locals() is determined mostly

Re: Questions about `locals` builtin

2018-02-27 Thread dieter
Kirill Balunov writes: > 2018-02-27 2:57 GMT+03:00 Terry Reedy : > >> The point of point 3 is that terminology and details would likely be >> different if Python were freshly designed more or less as it is today, and >> some things only make more or less sense in historical context. Learn what >>

Re: Questions about `locals` builtin

2018-02-27 Thread Kirill Balunov
2018-02-27 14:59 GMT+03:00 Ned Batchelder : > On 2/27/18 3:52 AM, Kirill Balunov wrote: > >> a. Is this restriction for locals desirable in the implementation of >> CPython in Python 3? >> b. Or is it the result of temporary fixes for Python 2? >> > > My understanding is that the behavior of lo

Re: Questions about `locals` builtin

2018-02-27 Thread Ned Batchelder
On 2/27/18 3:52 AM, Kirill Balunov wrote: a. Is this restriction for locals desirable in the implementation of CPython in Python 3? b. Or is it the result of temporary fixes for Python 2? My understanding is that the behavior of locals() is determined mostly by what is convenient for the imp

Re: Questions about `locals` builtin

2018-02-27 Thread Kirill Balunov
2018-02-27 2:57 GMT+03:00 Terry Reedy : > The point of point 3 is that terminology and details would likely be > different if Python were freshly designed more or less as it is today, and > some things only make more or less sense in historical context. Learn what > you need to know to write code

Re: Questions about `locals` builtin

2018-02-27 Thread Steven D'Aprano
On Mon, 26 Feb 2018 17:05:46 -0800, Dan Stromberg wrote: [...] > I don't have IronPython handy, but according my (quite possibly flawed) > test program, locals() is a copy on CPython 3, CPython 2, Pypy3, Pypy, > Jython and MicroPython. > > I didn't see any interpreters that returned the namespace

Re: Questions about `locals` builtin

2018-02-26 Thread dieter
Kirill Balunov writes: > I am a little bit confused with `locals` builtin in these moments: > > 1. The documentation says that _free varaibles_ are returned, which seems > incorrect description. In my mind the term free variable refers to > variables used in a function that are not local variables

Re: Questions about `locals` builtin

2018-02-26 Thread Dan Stromberg
On Mon, Feb 26, 2018 at 4:25 PM, Steven D'Aprano wrote: > On Mon, 26 Feb 2018 21:55:35 +0300, Kirill Balunov wrote: >> 2. The documentation has a note that "The contents of this dictionary >> should not be modified". Which implies that it is a read only mapping. >> So the question why it is `dict`

Re: Questions about `locals` builtin

2018-02-26 Thread Steven D'Aprano
On Mon, 26 Feb 2018 21:55:35 +0300, Kirill Balunov wrote: > Hi, > > I am a little bit confused with `locals` builtin in these moments: > > 1. The documentation says that _free varaibles_ are returned, which > seems incorrect description. I can't answer that, sorry. > 2. The documentation has

Re: Questions about `locals` builtin

2018-02-26 Thread Terry Reedy
On 2/26/2018 1:55 PM, Kirill Balunov wrote: Hi, I am a little bit confused with `locals` builtin in these moments: 1. The documentation says that _free varaibles_ are returned, which seems incorrect description. In my mind the term free variable refers to variables used in a function that are n

Re: Questions.

2017-09-09 Thread breamoreboy
On Saturday, September 9, 2017 at 4:09:24 AM UTC+1, boB Stepp wrote: > On Fri, Sep 8, 2017 at 9:54 PM, Michael Torrie wrote: > > On 09/08/2017 08:35 PM, V Vishwanathan wrote: > >> Hi, From what I see in the recent 4/5 digests, this forum seems to be for > >> advanced > >> > >> and professional pro

Re: Questions.

2017-09-08 Thread boB Stepp
On Fri, Sep 8, 2017 at 9:54 PM, Michael Torrie wrote: > On 09/08/2017 08:35 PM, V Vishwanathan wrote: >> Hi, From what I see in the recent 4/5 digests, this forum seems to be for >> advanced >> >> and professional programmers. >> >> So wondering if a newbie can post some questions to understand e

Re: Questions.

2017-09-08 Thread Skip Montanaro
> Hi, From what I see in the recent 4/5 digests, this forum seems to be for > advanced and professional programmers. > > So wondering if a newbie can post some questions to understand errors in his > code or will it look silly? While there are professional programmers here, and some questions ex

Re: Questions.

2017-09-08 Thread Michael Torrie
On 09/08/2017 08:35 PM, V Vishwanathan wrote: > Hi, From what I see in the recent 4/5 digests, this forum seems to be for > advanced > > and professional programmers. > > So wondering if a newbie can post some questions to understand errors in his > code > > or will it look silly? Yes you may

Re: Questions about API documentation

2017-03-08 Thread dieter
selphi...@gmail.com writes: > I am trying to understand how to write good API documentation. I have read > “7. Documenting Python” in the python developers guide [1] and skimmed the > Doc-SIG email archives, but I still have some questions and I would > appreciate your help. (Whenever I refer to

Re: Questions about API documentation

2017-03-07 Thread Steven D'Aprano
On Tue, 07 Mar 2017 17:06:03 -0800, selphiron wrote: > Hello, > > I am trying to understand how to write good API documentation. Nice questions! > 1) How much should I (or a documentation author in general) go into > detail? I don’t want to bore experienced users, but I don’t want to > scare b

Re: Questions on Pickle and Shelve

2015-11-06 Thread Peter Otten
Virgil Stokes wrote: > Here is snippet of Python (vers. 2.7.10) code that bothers me. > > import cPickle as pickle > > print "Pickle lists:" > dogs = ['Rover','King','Spot','Rufus'] > cats = ['Mimi','Misty','Sasha'] > > with open('pickle.dat', 'wb') as pfile: > pickle.dump(dogs, pfile) >

Re: Questions on Pickle and Shelve

2015-11-06 Thread Chris Warrick
On 6 November 2015 at 12:53, Virgil Stokes wrote: > Here is snippet of Python (vers. 2.7.10) code that bothers me. > > [snip bad code] > > 1) Which (the pickle or shelve code) takes less total RAM, if dogs and cats > were very large? > 2) When the last shelve.open is given, is the entire content

Re: Questions on Pandas

2015-06-25 Thread Steven D'Aprano
On Fri, 26 Jun 2015 02:34 pm, Tommy C wrote: > Hi there, I have a number of questions related to the Pandas exercises > found from the book, Python for Data Analysis by Wes McKinney. > Particularly, these exercises are from Chapter 6 of the book. It'd be much > appreciated if you could answer the

Re: re Questions

2014-01-26 Thread Tim Chase
On 2014-01-26 12:15, Roy Smith wrote: > > The set [A-z] is equivalent to > > [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] > > I'm inclined to suggest the regex compiler should issue a warning > for this. > > I've never seen a character range other than A-Z, a-z, or 0-9. > Well,

Re: re Questions

2014-01-26 Thread Mark Lawrence
On 26/01/2014 17:25, Chris Angelico wrote: On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith wrote: In article , Chris Angelico wrote: The set [A-z] is equivalent to [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] I'm inclined to suggest the regex compiler should issue a warning f

Re: re Questions

2014-01-26 Thread Mark Lawrence
On 26/01/2014 17:15, Blake Adams wrote: On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote: On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote: If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'. However, when I run t

Re: re Questions

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 4:15 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> The set [A-z] is equivalent to >> [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] > > I'm inclined to suggest the regex compiler should issue a warning for > this. > > I've never seen a ch

Re: re Questions

2014-01-26 Thread Blake Adams
On Sunday, January 26, 2014 12:08:01 PM UTC-5, Chris Angelico wrote: > On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote: > > > If I want to set up a match replicating the '\w' pattern I would assume > > that would be done with '[A-z0-9_]'. However, when I run the following: > > > > > > re.f

Re: re Questions

2014-01-26 Thread Blake Adams
On Sunday, January 26, 2014 12:06:59 PM UTC-5, larry@gmail.com wrote: > On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams wrote: > > > Im pretty new to Python and understand most of the basics of Python re but > > am stumped by a unexpected matching dynamics. > > > > > > If I want to set up a m

Re: re Questions

2014-01-26 Thread Roy Smith
In article , Chris Angelico wrote: > The set [A-z] is equivalent to > [ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz] I'm inclined to suggest the regex compiler should issue a warning for this. I've never seen a character range other than A-Z, a-z, or 0-9. Well, I suppose A-F

Re: re Questions

2014-01-26 Thread Chris Angelico
On Mon, Jan 27, 2014 at 3:59 AM, Blake Adams wrote: > If I want to set up a match replicating the '\w' pattern I would assume that > would be done with '[A-z0-9_]'. However, when I run the following: > > re.findall('[A-z0-9_]','^;z %C\@0~_') it matches ['^', 'z', 'C', '\\', '0', > '_']. I woul

Re: re Questions

2014-01-26 Thread Larry Martell
On Sun, Jan 26, 2014 at 9:59 AM, Blake Adams wrote: > Im pretty new to Python and understand most of the basics of Python re but am > stumped by a unexpected matching dynamics. > > If I want to set up a match replicating the '\w' pattern I would assume that > would be done with '[A-z0-9_]'. How

re Questions

2014-01-26 Thread Blake Adams
Im pretty new to Python and understand most of the basics of Python re but am stumped by a unexpected matching dynamics. If I want to set up a match replicating the '\w' pattern I would assume that would be done with '[A-z0-9_]'. However, when I run the following: re.findall('[A-z0-9_]','^;z %

Re: Questions on "import" and "datetime"

2013-06-12 Thread Yunfei Dai
On Monday, June 10, 2013 9:10:16 PM UTC+2, Dave Angel wrote: > On 06/10/2013 01:01 PM, Zachary Ware wrote: > > > On Mon, Jun 10, 2013 at 10:37 AM, Yunfei Dai > > wrote: > > >> Hi all, > > > > > > Hi Yunfei, > > > > > >> > > >> I have some questions on "import": > > >> > > >> 1."from date

Re: Questions on "import" and "datetime"

2013-06-12 Thread Yunfei Dai
On Monday, June 10, 2013 7:01:30 PM UTC+2, Zachary Ware wrote: > On Mon, Jun 10, 2013 at 10:37 AM, Yunfei Dai > wrote: > > > Hi all, > > > > Hi Yunfei, > > > > > > > > I have some questions on "import": > > > > > > 1."from datetime import datetime" works well. But I am confused why "imp

Re: Questions on "import" and "datetime"

2013-06-10 Thread Dave Angel
On 06/10/2013 01:01 PM, Zachary Ware wrote: On Mon, Jun 10, 2013 at 10:37 AM, Yunfei Dai wrote: Hi all, Hi Yunfei, I have some questions on "import": 1."from datetime import datetime" works well. But I am confused why "import datetime.datetime" leads to importerror. "from xlrd import ope

Re: Questions on "import" and "datetime"

2013-06-10 Thread Zachary Ware
On Mon, Jun 10, 2013 at 10:37 AM, Yunfei Dai wrote: > Hi all, Hi Yunfei, > > I have some questions on "import": > > 1."from datetime import datetime" works well. But I am confused why "import > datetime.datetime" leads to importerror. "from xlrd import open_workbook" > could be replaced by "fr

Re: Questions on __slots__

2012-05-19 Thread Charles Hixson
On 05/19/2012 06:39 AM, Adam Tauno Williams wrote: On Fri, 2012-05-18 at 09:53 -0700, Charles Hixson wrote: Does __slots__ make access to variables more efficient? Absolutely, yes. If one uses property() to create a few read-only pseudo-variables, does that negate the efficiency

Re: Questions on __slots__

2012-05-19 Thread Adam Tauno Williams
On Fri, 2012-05-18 at 09:53 -0700, Charles Hixson wrote: > Does __slots__ make access to variables more efficient? Absolutely, yes. > If one uses property() to create a few read-only pseudo-variables, does > that negate the efficiency advantages of using __slots__? > (Somehow I feel the documen

Re: Questions about the use of descriptors.

2012-03-15 Thread Ian Kelly
On Thu, Mar 15, 2012 at 11:32 AM, Steven W. Orr wrote: > Question 1: > > I have a class A with one attribute and I define __get__ and __set__ for > that class. Then I create another class B that uses it. > > Why does B require that the instance of A be a class variable in B and not > created as an

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread HoneyMonster
On Sun, 29 Jan 2012 14:01:01 -0500, Terry Reedy wrote: > On 1/29/2012 12:57 PM, HoneyMonster wrote: >> I am new to Python (Python 2.7 on Linux). Research indicates that: >> >> a) "Compiling" Python modules into intermediate bytecode marginally >> improves load time. > > The improvement is larger

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Cousin Stanley
This short article provides some basic information about .pyc and .pyo files http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html -- Stanley C. Kitching Human Being Phoenix, Arizona -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about "compiled" Python (beginner)

2012-01-29 Thread Terry Reedy
On 1/29/2012 12:57 PM, HoneyMonster wrote: I am new to Python (Python 2.7 on Linux). Research indicates that: a) "Compiling" Python modules into intermediate bytecode marginally improves load time. The improvement is larger the larger the file. You may notice that .pyc files are only created

Re: Questions regarding the daemon module.

2012-01-28 Thread Ben Finney
David Lambert writes: > I was looking for a simple way to daemonize a Python process, and found: > > http://www.python.org/dev/peps/pep-3143/ > > I used easy_install to add this package (I thought), but when I attempted > to use the example in the above link, I got the error: > > > AttributeError

Re: Questions regarding the daemon module.

2012-01-28 Thread Chris Rebert
On Sat, Jan 28, 2012 at 5:54 AM, David Lambert wrote: > I was looking for a simple way to daemonize a Python process, and found: > > http://www.python.org/dev/peps/pep-3143/ > > I used easy_install to add this package (I thought), but when I attempted to > use the example in the above link, I got

Re: Questions about LISP and Python.

2011-12-08 Thread Ben Finney
MRAB writes: > GvR isn't our leader, we are his followers. There's a difference. :-) +1 QotW -- \ “Guaranteed to work throughout its useful life.” —packaging for | `\ clockwork toy, Hong Kong | _o__)

Re: Questions about LISP and Python.

2011-12-08 Thread MRAB
On 08/12/2011 04:10, Rick Johnson wrote: [snip] I believe this community has a cancer. A cancer that is rotting us from the inside. A cancer that has metastasis and is spreading like wild fire. The problem with a cancer is not that it rots, but that it grows uncontrollably. *Inquisitive Joe a

Re: Questions about LISP and Python.

2011-12-08 Thread Matt Joiner
Guido is too busy secretly pouring his cruelty and malice into a master ring to answer trolls. Help yourself to a lesser ring on your way out. On Dec 8, 2011 10:14 PM, "Andrea Crotti" wrote: > On 12/08/2011 04:10 AM, Rick Johnson wrote: > >> ... >> >> Why has GvR not admonished the atrocious beha

Re: Questions about LISP and Python.

2011-12-08 Thread Chris Angelico
On Thu, Dec 8, 2011 at 10:10 PM, Andrea Crotti wrote: > Supposing even that Guido resigns, why do you think that the power should go > to you? > Power is not something that you can claim for, you have to earn the right, > and > ranting doesn't normally buy anything ;) Power is something you creat

Re: Questions about LISP and Python.

2011-12-08 Thread Andrea Crotti
On 12/08/2011 04:10 AM, Rick Johnson wrote: ... Why has GvR not admonished the atrocious behavior of some people in this community? Why has GvR not admitted publicly the hideous state of IDLE and Tkinter? Where is the rally call? Where is the community spirit? The future of Pythin is in your han

Re: Questions about LISP and Python.

2011-12-07 Thread Rick Johnson
On Dec 6, 9:52 pm, alex23 wrote: > (snip rambling nonsense) Alex, i hope you are being theatrical with all this. If not, i fear you may be putting too much stress on your heart. Please calm down. > The months in which you don't post are an absolute goddamn > _delight_ I am working on Python4000

Re: Questions about LISP and Python.

2011-12-07 Thread Rick Johnson
On Dec 6, 10:58 am, Ian Kelly wrote: (snip... beautiful retort) Ian you make some damn good points and i could not help but laugh hysterically at your dissection of Xah's tutorial. I don't 100% agree with everything Mr. Lee rants about, like for instance, documents needing to hyper link every po

Re: Questions about LISP and Python.

2011-12-07 Thread Neil Cerutti
On 2011-12-07, Terry Reedy wrote: > It does not pretend that surrounding statements with > parentheses turns them into expressions. > ;-) I like being in a sexpression. Aww YEH! -- (Neil Cerutti) -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about LISP and Python.

2011-12-07 Thread Terry Reedy
On 12/7/2011 5:14 AM, Andrea Crotti wrote: On 12/06/2011 04:36 AM, Xah Lee wrote: i don't like python, and i prefer emacs lisp. The primary reason is that python is not functional, especially with python 3. The python community is full of fanatics with their drivels. In that respect, it's not un

Re: Questions about LISP and Python.

2011-12-07 Thread Andrea Crotti
On 12/06/2011 04:36 AM, Xah Lee wrote: i don't like python, and i prefer emacs lisp. The primary reason is that python is not functional, especially with python 3. The python community is full of fanatics with their drivels. In that respect, it's not unlike Common Lisp community and Scheme lisp c

Re: Questions about LISP and Python.

2011-12-06 Thread Ian Kelly
On Tue, Dec 6, 2011 at 6:13 AM, Rick Johnson wrote: > I would say Mr. Lee does in fact find some usefulness of Python (as do > i) HOWEVER he also laments the asinities that plague the language, the > documentation, and especially, this community. > > Anyone who would take the time to write *articu

Re: Questions about LISP and Python.

2011-12-06 Thread Chris Angelico
On Wed, Dec 7, 2011 at 12:13 AM, Rick Johnson wrote: > This community is chalk full (from top to bottom!) of arrogant, tech > geeking, unix hacks who look down on the "outsiders" as excrement. I > believe it's high time for these folks to eat a big slice of humble > pie -- i just fear there is not

Re: Questions about LISP and Python.

2011-12-06 Thread Rick Johnson
On Dec 5, 11:10 pm, Chris Angelico wrote: > On Tue, Dec 6, 2011 at 3:36 PM, Xah Lee wrote: > > i don't like python, and i prefer emacs lisp. The primary reason is > > that python is not functional, especially with python 3. The python > > community is full of fanatics with their drivels. In that

Re: Questions about LISP and Python.

2011-12-06 Thread Alex Mizrahi
i don't like python, and i prefer emacs lisp. The primary reason is that python is not functional, especially with python 3. The python community is full of fanatics with their drivels. In that respect, it's not unlike Common Lisp community and Scheme lisp community. What functional programming

Re: Questions about LISP and Python.

2011-12-05 Thread Matt Joiner
This guy is an even better troll than that 8 guy. His spelling is equally bad. His essays make some good points, but I don't see why he doesn't shut his trap and move on. ಠ_ಠ On Tue, Dec 6, 2011 at 6:02 PM, alex23 wrote: > On Dec 6, 2:36 pm, Xah Lee wrote: >> The python community is full

Re: Questions about LISP and Python.

2011-12-05 Thread alex23
On Dec 6, 2:36 pm, Xah Lee wrote: > The python community is full of fanatics with their drivels. You do know that you could just fuck right off and leave us to it, yes? In general, it's the person who is shrilly imposing their minority opinion on a disinterested audience that deserves the title

Re: Questions about LISP and Python.

2011-12-05 Thread Chris Angelico
On Tue, Dec 6, 2011 at 3:36 PM, Xah Lee wrote: > i don't like python, and i prefer emacs lisp. The primary reason is > that python is not functional, especially with python 3. The python > community is full of fanatics with their drivels. In that respect, > it's not unlike Common Lisp community an

Re: Questions about LISP and Python.

2011-12-05 Thread Xah Lee
On Dec 5, 4:31 am, Tim Bradshaw wrote: > On 2011-12-05 11:51:11 +, Xah Lee said: > > > python has more readible syntax, more modern computer language > > concepts, and more robust libraries. These qualities in turn made it > > popular. > > Yet you still post here: why? i don't like python, an

Re: questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-23 Thread Amirouche B.
On Aug 22, 5:41 pm, Stephen Hansen wrote: > > 3) object's type is type : object.__class__ is type > > 4) type parent object is object : type.__bases__ == (object,) > > Saying "type" and "parent" and the like for new-style classes is > something of a misnomer. For "type" and "object", these things

Re: questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-23 Thread Amirouche B.
On Aug 22, 1:57 pm, Steven D'Aprano wrote: > The relationship between type and object is somewhat special, and needs to > be bootstrapped by the CPython virtual machine. Since you are talking about CPython, I'm wondering how it is bootstraped since you can easly reference PyType in PyObject tha

  1   2   3   4   >