Re: New to Programming - XML Processing

2015-03-31 Thread Andrew Farrell
You should follow Rustom's advice before just diving into the blog post I linked to. Otherwise you risk blindly following things and losing your bearings when you run into bugs. On Tue, Mar 31, 2015 at 11:17 PM, Rustom Mody wrote: > On Wednesday, April 1, 2015 at 8:57:15 AM UTC+5:30, catperson w

Re: New to Programming - XML Processing

2015-03-31 Thread Andrew Farrell
> I am new to programming, though not new to computers. One quick tip: when starting a new project, it is sometimes is useful to see if others have done the same thing and use their approach to guide yours. In your case, googling "Garmin Forerunner xml python" results in this blog post which is re

Re: New to Programming - XML Processing

2015-03-31 Thread Rustom Mody
On Wednesday, April 1, 2015 at 8:57:15 AM UTC+5:30, catperson wrote: > I'm hoping with enough reading I can experiment and work my way > through the problem and end up with a hopefully clear understanding of > the ElementTree module and Dictionairies. Also: If you are not familiar with dictionar

Re: New to Programming - XML Processing

2015-03-31 Thread Rustom Mody
On Wednesday, April 1, 2015 at 8:57:15 AM UTC+5:30, catperson wrote: > I am new to programming, though not new to computers. I'm looking to > teach myself Python 3 and am working my way through a tutorial. At > the point I'm at in the tutorial I am tasked with parsing out an XML > file created wi

Re: New to Programming - XML Processing

2015-03-31 Thread Ben Finney
catperson writes: > I am new to programming, though not new to computers. I'm looking to > teach myself Python 3 and am working my way through a tutorial. Congratulations! Python 3 is a fine language to be your first. Which tutorial are you following? It may be relevant. > At the point I'm at

Re: OT Intuitionism+Platonism+Mysticism => CS (was Deep comparison of dicts...)

2015-03-31 Thread Rustom Mody
On Saturday, March 21, 2015 at 11:58:43 AM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > > However I am talking some historical facts, viz: Because some nuts did > > the 20th century equivalent of: "Break each others' heads about how > > many angels can dance on the head of a pin" therefore

New to Programming - XML Processing

2015-03-31 Thread catperson
I am new to programming, though not new to computers. I'm looking to teach myself Python 3 and am working my way through a tutorial. At the point I'm at in the tutorial I am tasked with parsing out an XML file created with a Garmin Forerunner and am just having a terrible time getting my head aro

Re: Automation of Windows app?

2015-03-31 Thread alex23
On 23/03/2015 1:43 PM, Michael Torrie wrote: As near as I can tell the standard go-to utility for this is a program called AutoIt. https://www.autoitscript.com/site/autoit/ Nothing to do with Python, and its scripting language is maybe not that appealing to many, but it does the job, and does i

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread Ian Kelly
On Mar 31, 2015 5:16 PM, wrote: > Holy hell, dude, you've been arguing about this for nearly two weeks now. > > Let it go. That's rather an exaggeration. I've made seven posts to this thread up until now, the first of which was six days ago, not two weeks. I don't think that's excessive. I sugge

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread Chris Angelico
On Wed, Apr 1, 2015 at 10:10 AM, wrote: > Holy hell, dude, you've been arguing about this for nearly two weeks now. > > Let it go. Not sure you understand the nature of language debates. They can't hold it back any more! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread sohcahtoa82
On Tuesday, March 31, 2015 at 12:24:53 AM UTC-7, Ian wrote: > On Sun, Mar 29, 2015 at 4:41 AM, Thomas 'PointedEars' Lahn > wrote: > > Ian Kelly wrote: > > > >> […] Thomas 'PointedEars' Lahn […] wrote: > >>> Ian Kelly wrote: > >> Why should the burden of proof be on me in the first place? > > > > B

Re: Quick question, if you please

2015-03-31 Thread John Gordon
In John Kelly writes: > I received Python with another install and my update software keeps > signaling I need to install a newer version, and once I do, the older > version is still there, so I keep getting told I need to update. Should > I be able to uninstall the old version each time? Yes,

Re: Project, how to debug

2015-03-31 Thread Andrew Farrell
points of general advice: - As noted by Chris, you first need to figure out what the code is *supposed* to do. - Have a notebook and pencil next to you as you are working through this so that you can make notes and draw out the structure of things. - Write down the general structure of the code on

Re: Lockfile hanling

2015-03-31 Thread Ian Kelly
On Tue, Mar 31, 2015 at 1:59 PM, Christian Gollwitzer wrote: > Am 31.03.15 um 21:17 schrieb Ian Kelly: >> flock locks are per-process; they won't help for synchronizing access >> between competing threads in the same process. >> > > Ok. But if it is really all in one process, then a classical mute

Re: Lockfile hanling

2015-03-31 Thread Christian Gollwitzer
Am 31.03.15 um 21:17 schrieb Ian Kelly: On Tue, Mar 31, 2015 at 12:58 PM, Christian Gollwitzer wrote: Am 31.03.15 um 16:50 schrieb Ervin Hegedüs: there is an app, written in Python, which stores few bytes of datas in a single file. The application uses threads. Every thread can modify the fil

Re: Error in processing JSON files in Python

2015-03-31 Thread Denis McMahon
On Mon, 30 Mar 2015 14:27:14 -0700, Karthik Sharma wrote: > I have the following python program to read a set of JSON files do some > processing on it and dump them back to the same folder. However When I > run the below program and then try to see the output of the JSON file > using > > `cat fil

Re: Lockfile hanling

2015-03-31 Thread Ian Kelly
On Tue, Mar 31, 2015 at 12:58 PM, Christian Gollwitzer wrote: > Am 31.03.15 um 16:50 schrieb Ervin Hegedüs: >> >> there is an app, written in Python, which stores few bytes of >> datas in a single file. The application uses threads. Every >> thread can modify the file, but only one at a time. I'm

Re: Lockfile hanling

2015-03-31 Thread Christian Gollwitzer
Am 31.03.15 um 16:50 schrieb Ervin Hegedüs: there is an app, written in Python, which stores few bytes of datas in a single file. The application uses threads. Every thread can modify the file, but only one at a time. I'm using a lock file to prevent the multiple access. Here is the lock method:

Re: Logging Custom Levels?

2015-03-31 Thread Jean-Michel Pichavant
- Original Message - > From: "Didymus" > To: python-list@python.org > Sent: Tuesday, 31 March, 2015 5:20:52 PM > Subject: Logging Custom Levels? > > Hi, > > I've create a Python file called "log.py" and placed in the custom > levels: > > # Performance Debug... > logging.addLevelName(PDE

Re: Quick question, if you please

2015-03-31 Thread Russell Owen
On 3/31/15 10:09 AM, John Kelly wrote: Pythonites, I received Python with another install and my update software keeps signaling I need to install a newer version, and once I do, the older version is still there, so I keep getting told I need to update. Should I be able to uninstall the old vers

Quick question, if you please

2015-03-31 Thread John Kelly
Pythonites, I received Python with another install and my update software keeps signaling I need to install a newer version, and once I do, the older version is still there, so I keep getting told I need to update. Should I be able to uninstall the old version each time? Thanks for your kind att

Re: Lockfile hanling

2015-03-31 Thread Ervin Hegedüs
Hi Matthew, On Tue, Mar 31, 2015 at 11:50:06AM -0400, Matthew Ruffalo wrote: > On 2015-03-31 10:50, Ervin Hegedüs wrote: > > there is an app, written in Python, which stores few bytes of > > datas in a single file. The application uses threads. Every > > thread can modify the file, but only one at

Re: Lockfile hanling

2015-03-31 Thread Matthew Ruffalo
On 2015-03-31 10:50, Ervin Hegedüs wrote: > there is an app, written in Python, which stores few bytes of > datas in a single file. The application uses threads. Every > thread can modify the file, but only one at a time. I'm using a > lock file to prevent the multiple access. > > ... > > How can I

Re: Lockfile hanling

2015-03-31 Thread Ervin Hegedüs
Hi Skip, On Tue, Mar 31, 2015 at 10:19:27AM -0500, Skip Montanaro wrote: > > sorry - at the end of the function there is a close() method to a > > file, after the thread passes the modifications: > > > > try: > > os.remove(self.lockfile) > > except: > > syslog.syslog(syslog

Re: generator/coroutine terminology

2015-03-31 Thread Chris Angelico
On Wed, Apr 1, 2015 at 2:03 AM, Albert van der Horst wrote: > class Squares: > def __init__(self): > self.i = 0 > def __next__(self): > self.i += 1 > return self.i**2 > def __iter__(self): > return self > > albert@cherry:/tmp$ python > Python 2.6.6 (r266

Logging Custom Levels?

2015-03-31 Thread Didymus
Hi, I've create a Python file called "log.py" and placed in the custom levels: # Performance Debug... logging.addLevelName(PDEBUG_NUM, "PDEBUG") def pdebug(self, message, *args, **kws): """ Performance Debug Message Level """ self.log(PDEBUG_NUM, message, *args, **kws) logging.

Re: Lockfile hanling

2015-03-31 Thread Skip Montanaro
> sorry - at the end of the function there is a close() method to a > file, after the thread passes the modifications: > > try: > os.remove(self.lockfile) > except: > syslog.syslog(syslog.LOG_DEBUG, "Sync error: " + > str(sys.exc_info()[1])) Hmmm... Still not seeing os.clo

Re: Lockfile hanling

2015-03-31 Thread Ervin Hegedüs
Hi Skip, thanks for the reply, On Tue, Mar 31, 2015 at 09:55:57AM -0500, Skip Montanaro wrote: > On Tue, Mar 31, 2015 at 9:50 AM, Ervin Hegedüs wrote: > > After few weeks the process > > reaches the number if max fd's. > > > > How can I prevent or avoid this issue? What's the correct way to > >

Re: generator/coroutine terminology

2015-03-31 Thread Albert van der Horst
In article , Dave Angel wrote: >On 03/31/2015 09:18 AM, Albert van der Horst wrote: >> In article <55062bda$0$12998$c3e8da3$54964...@news.astraweb.com>, >> Steven D'Aprano wrote: > >>> >>> The biggest difference is syntactic. Here's an iterator which returns a >>> never-ending sequence of squar

Re: Lockfile hanling

2015-03-31 Thread Skip Montanaro
On Tue, Mar 31, 2015 at 9:50 AM, Ervin Hegedüs wrote: > After few weeks the process > reaches the number if max fd's. > > How can I prevent or avoid this issue? What's the correct way to > handle the lockfile in Python? Ervin, You need to close the files you open. I don't see that happening in y

Lockfile hanling

2015-03-31 Thread Ervin Hegedüs
Hello, there is an app, written in Python, which stores few bytes of datas in a single file. The application uses threads. Every thread can modify the file, but only one at a time. I'm using a lock file to prevent the multiple access. Here is the lock method: while True: try: f

Re: How to handle file in Whoosh?

2015-03-31 Thread Peter Otten
subhabrata.bane...@gmail.com wrote: > I am trying to build a search engine, I started with Whoosh. The tutorial and web based materials are fine. Web has sizable question and answers. The initial experiments seem going fine. But I want to handle files located in various parts of my machine. I f

Re: generator/coroutine terminology

2015-03-31 Thread Dave Angel
On 03/31/2015 09:18 AM, Albert van der Horst wrote: In article <55062bda$0$12998$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: The biggest difference is syntactic. Here's an iterator which returns a never-ending sequence of squared numbers 1, 4, 9, 16, ... class Squares:

How to handle file in Whoosh?

2015-03-31 Thread subhabrata . banerji
I am trying to build a search engine, I started with Whoosh. The tutorial and web based materials are fine. Web has sizable question and answers. The initial experiments seem going fine. But I want to handle files located in various parts of my machine. I found "from whoosh.filedb.filestore impo

Re: generator/coroutine terminology

2015-03-31 Thread Albert van der Horst
In article <55062bda$0$12998$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >Marko Rauhamaa wrote: > >> Chris Angelico : >> >>> On Sun, Mar 15, 2015 at 9:15 AM, Marko Rauhamaa wrote: Is it necessary/useful for a Python application programmer to be conscious of the differen

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-03-31 Thread Dave Angel
On 03/31/2015 07:00 AM, Saran A wrote: > @DaveA: This is a homework assignment. Is it possible that you could provide me with some snippets or guidance on where to place your suggestions (for your TO DOs 2,3,4,5)? > On Monday, March 30, 2015 at 2:36:02 PM UTC-4, Dave Angel wrote: I

Python regex exercise

2015-03-31 Thread Robert Clove
Hi All, Do anyone have good links to python regex or other python problems for beginners but with solution. Please mail me. Regards -- https://mail.python.org/mailman/listinfo/python-list

Re: generator/coroutine terminology

2015-03-31 Thread Albert van der Horst
In article <83d579c1-ab61-4a3d-a834-e65d28eac...@googlegroups.com>, Rustom Mody wrote: >On Saturday, March 14, 2015 at 8:59:22 PM UTC+5:30, Rustom Mody wrote: >> On Saturday, March 14, 2015 at 11:34:27 AM UTC+5:30, Steven D'Aprano wrote: >> > >> > A generator (function) may be a function which re

Re: Project, how to debug

2015-03-31 Thread Robert Clove
On Tue, Mar 31, 2015 at 5:19 PM, Peter Otten <__pete...@web.de> wrote: > Robert Clove wrote: > > > Hi All, > > > > I am facing a problem. > > I have been given a project written in python and asked to debug it. > > I have not been given the flow they said understand and debug. > > > > Can someone

Re: Project, how to debug

2015-03-31 Thread Chris Angelico
On Tue, Mar 31, 2015 at 10:23 PM, Robert Clove wrote: > > I am facing a problem. > I have been given a project written in python and asked to debug it. > I have not been given the flow they said understand and debug. > > Can someone suggest me how to debug it in Wings IDE. > Project have approx 10

Re: Project, how to debug

2015-03-31 Thread Peter Otten
Robert Clove wrote: > Hi All, > > I am facing a problem. > I have been given a project written in python and asked to debug it. > I have not been given the flow they said understand and debug. > > Can someone suggest me how to debug it in Wings IDE. Are those specific bugs that you are supposed

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread Jean-Michel Pichavant
- Original Message - > From: "Terry Reedy" > To: python-list@python.org > Sent: Wednesday, 18 March, 2015 10:47:40 PM > Subject: Re: A simple single line, triple-quoted comment is giving syntax > error. Why? > > On 3/18/2015 3:53 PM, Thomas 'PointedEars' Lahn wrote: > > > I must strongl

Project, how to debug

2015-03-31 Thread Robert Clove
Hi All, I am facing a problem. I have been given a project written in python and asked to debug it. I have not been given the flow they said understand and debug. Can someone suggest me how to debug it in Wings IDE. Project have approx 10 files. Regards -- https://mail.python.org/mailman/listin

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-03-31 Thread Saran A
On Monday, March 30, 2015 at 2:36:02 PM UTC-4, Dave Angel wrote: > On 03/30/2015 12:45 PM, Saran A wrote: > > On Sunday, March 29, 2015 at 10:04:45 PM UTC-4, Chris Angelico wrote: > >> On Mon, Mar 30, 2015 at 12:08 PM, Paul Rubin > >> wrote: > >>> Saran Ahluwalia writes: > cross-platform...

Re: Using csv DictWriter - add a extra field

2015-03-31 Thread Peter Otten
Victor Hooi wrote: > Aha, yeah, I can add the connection_id as another field in the inner dict > - the only drawback is that the data is duplicated twice. However, I > suppose even if it's not elegant, it does work. The elegance lies in its simplicity, so it's still my personal favourite. > Howe

Re: Using csv DictWriter - add a extra field

2015-03-31 Thread Victor Hooi
Hi, Aha, yeah, I can add the connection_id as another field in the inner dict - the only drawback is that the data is duplicated twice. However, I suppose even if it's not elegant, it does work. However, that ChainMap does look interesting =). And yes, I am actually using Python 3.x (mainly be

Re: Using csv DictWriter - add a extra field

2015-03-31 Thread Peter Otten
Victor Hooi wrote: > Hi, > > I have a dict named "connections", with items like the following: > > In [18]: connections > Out[18]: > {'3424234': {'end_timestamp': datetime.datetime(2015, 3, 25, 5, 31, 30, > {406000, tzinfo=datetime.timezone(datetime.timedelta(-1, 61200))), > 'ip_address': '10.

Re: A simple single line, triple-quoted comment is giving syntax error. Why?

2015-03-31 Thread Ian Kelly
On Sun, Mar 29, 2015 at 4:41 AM, Thomas 'PointedEars' Lahn wrote: > Ian Kelly wrote: > >> […] Thomas 'PointedEars' Lahn […] wrote: >>> Ian Kelly wrote: >> Why should the burden of proof be on me in the first place? > > Because *you* made the claim that “STRING+” could be part of an AST in this > w

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-31 Thread David MacIver
On 31 March 2015 at 02:51, Paul Rubin wrote: > David MacIver writes: > > Hypothesis is based on Quickcheck > > (https://wiki.haskell.org/Introduction_to_QuickCheck2) > > This is great. Have you looked at the Erlang version of Quickcheck? It > may have aspects more directly applicable to Python

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-31 Thread David MacIver
On 31 March 2015 at 02:46, Terry Reedy wrote: > On 3/30/2015 4:46 PM, David MacIver wrote: > >> On 30 March 2015 at 22:37, Terry Reedy > > wrote: >> > > https://www.python.org/dev/__peps/pep-0484/ >> >> proposes the