Re: [Tutor] recursion depth

2014-01-09 Thread Dave Angel
On Thu, 9 Jan 2014 13:02:30 -0500, Keith Winston wrote: Well, hopefully this is plain text. It all looks the same to me, so if gmail switches back, it might go unnoticed for a while. Sorry for the incessant hassle. That looks great, thanks. -- DaveA _

Re: [Tutor] Python & Django

2014-01-09 Thread Emile van Sebille
On 01/09/2014 01:13 AM, Rafael Knuth wrote: Hej there, I am very interested to hear your opinion on which version of Python to use in conjunction with Django. Currently, I am taking a class at Udemy and they recommend using Python 2.7 with Django 1.6. because both versions work well with each ot

Re: [Tutor] recursion depth

2014-01-09 Thread Keith Winston
On Thu, Jan 9, 2014 at 5:41 AM, Steven D'Aprano wrote: > > Keith, if you are able, and would be so kind, you'll help solve this > issue for Dave if you configure your mail client to turn so-called "rich > text" or formatted text off, at least for this mailing list. Well, hopefully this is plain t

Re: [Tutor] recursion depth

2014-01-09 Thread Dave Angel
On Thu, 9 Jan 2014 21:41:41 +1100, Steven D'Aprano wrote: I presume that your question is aimed at Keith. Yes, Keith's emails have a HTML part and a text part. A half-decent mail client should be able to read the text part even if the HTML part exists. But I believe you're reading this fro

Re: [Tutor] XML parsing when elements contain foreign characters

2014-01-09 Thread Stefan Behnel
Garry Bettle, 09.01.2014 09:50: > I'm trying to parse some XML and I'm struggling to reference elements that > contain foreign characters. I skipped over Steven's response and he apparently invested quite a bit of time in writing it up so nicely, so I can happily agree and just add one little comm

Re: [Tutor] arrangement of datafile

2014-01-09 Thread Peter Otten
Amrita Kumari wrote: > On 17th Dec. I posted one question, how to arrange datafile in a > particular fashion so that I can have only residue no. and chemical > shift value of the atom as: > 1 H=nil > 2 H=8.8500 > 3 H=8.7530 > 4 H=7.9100 > 5 H=7.4450 > > Peter has replied to this mail

Re: [Tutor] Fwd: arrangement of datafile

2014-01-09 Thread Dave Angel
On Thu, 9 Jan 2014 14:51:21 +0800, Amrita Kumari wrote: days), I tried this code which you suggested (by saving it in a file): import csv with open('19162.csv') as f: reader = csv.reader(f) for row in reader: print(row) row[0] = int(row[0]) key,value = item.split('=

Re: [Tutor] Fwd: arrangement of datafile

2014-01-09 Thread Evans Anyokwu
First, the error message means 'item' is missing. You will need to assign your row as the item. And if you want nil where there is no value, then use if statement to check there is something otherwise make that empty value 'nil'. Sorry, gotta run my train just arrived. __

Re: [Tutor] XML parsing when elements contain foreign characters

2014-01-09 Thread Steven D'Aprano
On Thu, Jan 09, 2014 at 09:50:24AM +0100, Garry Bettle wrote: > I'm trying to parse some XML and I'm struggling to reference elements that > contain foreign characters. I see from your use of print that you're using Python 2. That means that strings '' are actually byte-strings, not text-strings

Re: [Tutor] help

2014-01-09 Thread Alan Gauld
On 09/01/14 08:52, Tihomir Zjajic wrote: Please, can you help me convert this code from python 3 to python 2.6 The main gotchas are that 1) input in Python 3 -> raw_input() in Python 2 2) print (XXX) in Python 3 -> print XXX in Python 2 Start from there then read any error messages and fix as

Re: [Tutor] Python function argument passing problem

2014-01-09 Thread Alan Gauld
On 09/01/14 00:33, Manoj Rout wrote: I have been working with python from last couple of weeks. As I am new to python I have a problem with my work. So can you please look into the below code. with open('C:\\Users\\Manoj\\Desktop\\XMC1100_rm_v1.0.6_SVD.xml','r') as xmlfile: sv

Re: [Tutor] help

2014-01-09 Thread Steven D'Aprano
On Thu, Jan 09, 2014 at 09:52:04AM +0100, Tihomir Zjajic wrote: > Please, can you help me convert this code from python 3 to python 2.6 Change input() to raw_input(). That will make it compatible with Python 2.6. But that is not the cause of the error you get. The error that you get is that your

Re: [Tutor] recursion depth

2014-01-09 Thread Steven D'Aprano
On Wed, Jan 08, 2014 at 06:16:03PM -0500, Dave Angel wrote: > On Wed, 8 Jan 2014 16:23:06 -0500, eryksun wrote: > >On Wed, Jan 8, 2014 at 3:25 PM, Keith Winston > wrote: > >> I've been playing with recursion, it's very satisfying. > >> > >> However, it appears that even if I sys.setrecursionlimi

[Tutor] help

2014-01-09 Thread Tihomir Zjajic
Please, can you help me convert this code from python 3 to python 2.6 g = input("Enter a vrs_drv:") vrs_drv = int(g) def vrs_drv(): vrs_drv = input("Enter a vrs_drv:") if vrs_drv == "21": return("1") if vrs_drv == "22": return("2") if vrs_drv == "41": return("4")

Re: [Tutor] Fwd: arrangement of datafile

2014-01-09 Thread Amrita Kumari
Hi, Sorry for delay in reply(as internet was very slow from past two days), I tried this code which you suggested (by saving it in a file): import csv with open('19162.csv') as f: reader = csv.reader(f) for row in reader: print(row) row[0] = int(row[0]) key,value = item.sp

[Tutor] Python & Django

2014-01-09 Thread Rafael Knuth
Hej there, I am very interested to hear your opinion on which version of Python to use in conjunction with Django. Currently, I am taking a class at Udemy and they recommend using Python 2.7 with Django 1.6. because both versions work well with each other. Over the last few months I got pretty mu

[Tutor] XML parsing when elements contain foreign characters

2014-01-09 Thread Garry Bettle
Howdy all, Have you hear the news? Happy New Year! Hope someone can help. I know this is a tutor list so please feel free to send me somewhere else. I'm trying to parse some XML and I'm struggling to reference elements that contain foreign characters. Code so far: # -*- coding: utf-8 -*- from