python and parsing an xml file

2011-02-21 Thread Matt Funk
, but that error out with: xml.parsers.expat.ExpatError: junk after document element: line 19, column 0 Anyway, if anyone can give me advice of point me somewhere i'd greatly appreciate it. thanks matt -- http://mail.python.org/mailman/listinfo/python-list

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
Hi Terry, On 2/21/2011 11:22 AM, Terry Reedy wrote: > On 2/21/2011 12:30 PM, Matt Funk wrote: >> Hi, >> I was wondering if someone had some advice: >> I want to create a set of xml input files to my code that look as >> follows: > > Why? mmmh. not sure how to answ

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
t for examples or obtain keys? I really appreciate your help thanks matt On 2/21/2011 10:43 AM, Stefan Behnel wrote: > Matt Funk, 21.02.2011 18:30: >> I want to create a set of xml input files to my code that look as >> follows: >> >> >> >> &g

Re: python and parsing an xml file

2011-02-21 Thread Matt Funk
error: AttributeError: no such child: catalog matt On 2/21/2011 3:28 PM, Stefan Behnel wrote: > Matt Funk, 21.02.2011 23:07: >> thank you for your advice. >> I am running into an issue though (which is likely a newbie problem): >> >> My xml file looks lik

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
-config-file) will suit my needs. Again, thanks for the time and effort you put in to answer my questions (and, in Stefan's case for writing tools and making them available to everyone) and pointing me in the better direction. matt On 2/22/2011 4:01 AM, Ian wrote: > On 21/02/2011 22:08, M

Re: python and parsing an xml file

2011-02-22 Thread Matt Funk
One thing i forgot, in case anyone is at this point: the reason i chose ConfigObj over ConfigParser is that it allows subsections. matt On 2/22/2011 4:01 AM, Ian wrote: > On 21/02/2011 22:08, Matt Funk wrote: >>> Why? >> mmmh. not sure how to answer this question exact

+Hi+

2010-04-07 Thread Matt Burson
http://sites.google.com/site/fgu45ythjg/rfea8i -- Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: hex question

2010-06-25 Thread Matt McCredie
x27;abcdef' If you are interested in printing the hex values, you could so something like this: >>> h = '\x0a\xa8\x19\x0b' >>> for c in h: ... print "0x%02x" % ord(c), ... 0x0a 0xa8 0x19 0x0b Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespace problem?

2010-07-01 Thread Matt McCredie
me modified version that doesn't fail. My guess is that the "if True" is actually something else, and it isn't being interpreted as "True". As such, "fws_last_col" never gets assigned, and thus never gets created. You can fix that by assigning fws_last_col to an appropriate default value before the for loop. But what do I know, that is just a guess. Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Code generator and visitor pattern

2010-07-15 Thread Matt McCredie
Karsten Wutzke web.de> writes: > So, what is the de facto method in Python to handle source code generation? Take a look at the NodeVisitor class in the ast module in python 2.6+. The visitor pattern is implemented in the python standard library. Matt -- http://mail.python.org/m

Re: easy question on parsing python: "is not None"

2010-08-12 Thread Matt Schinckel
ps and spam" > True > >>> a = "spam, eggs, chips and spam" > >>> b = "spam, eggs, chips and spam" > >>> a is b > False but: >>> a = "hello" >>> b = "hello" >>> a is b True Ooh, that loo

Re: message box in Tkinter

2010-08-17 Thread Matt Saxton
On Tue, 17 Aug 2010 04:02:23 -0700 (PDT) Jah_Alarm wrote: > > When I try importing messagebox from Tkinter i get an error message > that this module doesn't exist. > I believe what you want is Tkinter.Message -- Matt Saxton -- http://mail.python.org/mailman/listinfo/python-list

Restart the interactive python shell like in IDLE

2009-06-10 Thread Matt Burson
like this as opposed to having to exit the shell and then start it up again to refresh it. -- Matt -- http://mail.python.org/mailman/listinfo/python-list

How to exclude "import"s from PyDoc

2009-08-26 Thread Matt Bellis
. FUNCTIONS acos(...) acos(x) Return the arc cosine (measured in radians) of x. asin(...) asin(x) Return the arc sine (measured in radians) of x. . . . snip Anyone know the best way to get PyDoc to ignore this (or other) imported module(s)? Than

Re: How to exclude "import"s from PyDoc

2009-08-28 Thread Matt Bellis
Hi Diez, Thanks for the heads up. I'll give epydoc a shot. Matt > > >    Anyone know the best way to getPyDocto ignore this (or other) > > imported module(s)? > > Don't know aboutpydoc, but epydoc (which generates much nicer docs > imho) can be force

Re: Reversing a List

2010-09-01 Thread Matt Saxton
s there a way to append to > the front of the list directly? > TIA, > beno The insert() method can do this, i.e. >>> cols.insert(0, 'Delete') -- Matt Saxton -- http://mail.python.org/mailman/listinfo/python-list

Plone Conference 2010 schedule published

2010-09-27 Thread Matt Hamilton
visit http://ploneconf2010.org. -- Matt Hamilton ma...@netsight.co.uk Netsight Internet Solutions, Ltd. Business Vision on the Internet http://www.netsight.co.uk +44 (0)117 9090901 Web Design | Zope/Plone Development and Cons

MealWell

2010-10-09 Thread Matt Tibbals
MealWell supports Matt Tibbals, pedophile. He is working to legalize sex with children over the age of 2. -- http://mail.python.org/mailman/listinfo/python-list

Re: Substitute a mock object for the metaclass of a class

2017-03-13 Thread Matt Wheeler
'Foo', unittest.mock.ANY, unittest.mock.ANY) > When I try to add the stub_metaclass side_effect in to my code I get `TypeError: __new__() missing 2 required positional arguments: 'bases' and 'namespace'` ... which seems quite reasonable, an

Re: Substitute a mock object for the metaclass of a class

2017-03-13 Thread Matt Wheeler
A small correction... On Mon, 13 Mar 2017 at 22:36 Matt Wheeler wrote: > ``` > from unittest.mock import patch > > import lorem > > > @patch('lorem.type') > def test_things(mocktype): > lorem.quux(metameta.Foo()) > > lorem.return_value.assert

Re: How to update python from 3.5.2 to 3.5.3 on Linux

2017-05-03 Thread Matt Ruffalo
On 2017-05-03 12:43, Thomas Nyberg wrote: > On 05/03/2017 11:47 AM, Wolfgang Maier wrote: >> On 03.05.2017 17:11, Thomas Nyberg wrote: >>> On 05/03/2017 11:04 AM, Daiyue Weng wrote: nope, I was thinking it might be good to update to 3.5.3 for security reasons? >>> (CCing back in pyth

Re: Logging function calls without changing code

2017-05-24 Thread Matt Wheeler
og the arguments passed to the functions (you didn't say that) things get a bit more complex, but it's still certainly achievable. If you actually need to wrap the class in place for testing you might look into combining something like the above with the mock library. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Finding the name of an object's source file

2017-06-06 Thread Matt Wheeler
ively, without using inspect, we can get around `Object.__module__` being a string by importing it as a string: >>> import importlib, os >>> importlib.import_module(os.path.split.__module__).__file__ '/Users/matt/.pyenv/versions/3.6.0/lib/python3.6/posixpath.py' -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: API Help

2017-06-14 Thread Matt Wheeler
{"warehouseCode":"AB-1-CA","quantityAvailable":1.0},{"warehouseCode":"WA-1-US","quantityAvailable":0.0},{"warehouseCode":"PO-1-CA","quantityAvailable":0.00000}]}] >>> json.loads(s) [{u&#

Re: Google Sheets API Error

2017-06-17 Thread Matt Wheeler
your intention has been mangled somewhere along the way, and in any case the code seems to be missing parts. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
uld be more appropriate) > -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: is @ operator popular now?

2017-07-15 Thread Matt Wheeler
aps it should also be listed at https://docs.python.org/3.6/genindex-Symbols.html -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: @lru_cache on functions with no arguments

2017-08-01 Thread Matt Wheeler
un, maintaining the interface would trump simplicity for the simple case). I've not investigated the Django codebase, so I don't know if my guesses line up with it exactly, but it should be quite easy to construct a grep or sed script to scan the source to find out :) -- -- Matt Wheeler

Re: @lru_cache on functions with no arguments

2017-08-01 Thread Matt Wheeler
On Tue, 1 Aug 2017 at 12:53 Thomas Nyberg wrote: > On 08/01/2017 01:06 PM, Matt Wheeler wrote: > > A function which is moderately expensive to run, that will always return > > the same result if run again in the same process, and which will not be > > needed in every sessio

Re: Subclassing dict to modify values

2017-08-02 Thread Matt Wheeler
tions-abstract-base-classes All of the mixin methods (the ones defined for you) will call the abstract methods you override. -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed new syntax

2017-08-10 Thread Matt Wheeler
nk you.) > > [x + 1 for x in (0, 1, 2, 999, 3, 4) if x < 5] > [1, 2, 3, 4, 5] > How about these? > > [x + y for x in (0, 1, 2, 999, 3, 4) while x < 5 for y in (100, 200)] > [100, 200, 101, 201, 102, 202] > [x + y for x in (0, 1, 2, 999, 3, 4) if x < 5 for y i

Re: Send mouse clicks to minimized window

2017-08-28 Thread Matt Wheeler
window-manager level automation tool (and will also solve the focus problem for you). [0] https://github.com/pywinauto/pywinauto -- -- Matt Wheeler http://funkyh.at -- https://mail.python.org/mailman/listinfo/python-list

Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
I have been working on a python script that separates mailing addresses into different components. Here is my code: inFile = "directory" outFile = "directory" inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCi

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 18:44:16 UTC-5, Jason Friedman wrote: > outHandler.write("FarmID\tAddress\tStreetNum\tStreetName\tSufType\tDir\tCity\tProvince\tPostalCode") > > > > ... >   > FarmID  Address > > 1       1067 Niagara Stone Rd, Niagara-On-The-Lake, ON L0S 1J0 > > 2       4260 Mountai

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 19:40:26 UTC-5, Steven D'Aprano wrote: > On Sun, 26 Jan 2014 13:46:21 -0800, matt.s.marotta wrote: > > > > > I have been working on a python script that separates mailing addresses > > > into different components. > > > > > > Here is my code: > > > > > > inFile

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 20:56:01 UTC-5, Chris Angelico wrote: > On Mon, Jan 27, 2014 at 12:15 PM, wrote: > > > I`m not reading and writing to the same file, I just changed the actual > > paths to directory. > > > > For next time, say "directory1" and "directory2" to preserve the fact >

Re: Unwanted Spaces and Iterative Loop

2014-01-26 Thread matt . s . marotta
On Sunday, 26 January 2014 21:00:35 UTC-5, Jason Friedman wrote: > I`m not reading and writing to the same file, I just changed the actual paths > to directory. > > > > This is for a school assignment, and we haven`t been taught any of the stuff > you`re talking about.  Although I appreciate

Remove unwanted characters from column

2014-01-26 Thread matt . s . marotta
School assignment is to create a tab separated output with the original given addresses in one column and then the addresses split into other columns (ex, columns for city, postal code, street suffix). Here is my code: inHandler = open(inFile, 'r') outHandler = open(outFile, 'w') outHandler.wri

Re: Remove unwanted characters from column

2014-01-27 Thread matt . s . marotta
On Monday, 27 January 2014 00:24:11 UTC-5, Dave Angel wrote: > matt.s.maro...@gmail.com Wrote in message: > > > School assignment is to create a tab separated output with the original > > given addresses in one column and then the addresses split into other > > columns (ex, columns for city, po

Re: Remove unwanted characters from column

2014-01-27 Thread matt . s . marotta
On Monday, 27 January 2014 08:54:20 UTC-5, Steven D'Aprano wrote: > On Mon, 27 Jan 2014 05:32:08 -0800, matt.s.marotta wrote: > > > > > The code that I used is the proper way that we were supposed to complete > > > the assignment. All I need now is an 'if...then' statement to get rid > > > o

Re: Remove unwanted characters from column

2014-01-27 Thread matt . s . marotta
On Monday, 27 January 2014 09:57:32 UTC-5, Chris Angelico wrote: > On Tue, Jan 28, 2014 at 1:23 AM, wrote: > > > If the farmID < 10: > > remove one character from the address column > > Elif farmID > 10: > > remove two characters from the address column > > What if farmID == 10? > > ChrisA Ok

minidom, drilling down to a low node in one line?

2009-01-16 Thread Matt Brown - nyc
uot;example.xml") xmldoc.getElementsByTagName("grammar:ref:p:") _ Any input or direction is appreciated. Thanks! Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and GUI

2007-05-27 Thread Matt van de Werken
brad wrote: > Kevin Walzer wrote: > >> 2. wxPython is big, harder to learn than Tkinter, but looks good on >> Mac, Windows, and *Nix. It will require users to install a lot of >> extra stuff (or you'll have to bundle the extra stuff). > > PyInstaller builds binaries beautifully from raw py sour

Re: gui application on cross platform

2007-05-28 Thread Matt van de Werken
james_027 wrote: > Hi, > > I am using delphi to develop gui application, and wish to make a shift > to python. here are some of my question/concern... > > 1. is python develop gui application a cross platform? just like java > swing? > 2. delphi makes things easy for me like coding for a specific

Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
h is: Traceback (most recent call last): File "test.py", line 10, in s = info['serverVersion'] TypeError: list indices must be integers If anyone has any idea what is going on here, I would appreciate the help. I've spent a few hours over the past two days trying to figure this little quirk out, but to no avail. Matt Fielding IT Technician Rockstar New England -- http://mail.python.org/mailman/listinfo/python-list

RE: Unable to lookup keys in dictionary

2008-08-12 Thread Matt Fielding (R* New England)
.disconnect() except P4Exception: for e in p4.errors: print e Matt Fielding IT Technician Rockstar New England From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Matt Fielding (R* New England) Sent: Tuesday,

Version numbers in Standard Library

2019-03-01 Thread Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] via Python-list
o according to git blame. In tarfile.py, the version string was last changed 12 years ago. But in both, the modules were edited in 2018 so they haven't been static for a decade. Are those strings there just for historic purposes? Not a big deal, I was just wondering. Thanks, Matt -- Matt Tho

<    3   4   5   6   7   8