Remove root handler from logger

2012-05-14 Thread Florian Lindner
Hello, I configure my logging on application startup like that: logging.basicConfig(level = logging.DEBUG, format=FORMAT, filename = logfile) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter(FORMAT)) logging.getLogger().addHandler(ch) In one module of my application I want a logge

RE: Dealing with the __str__ method in classes with lots of attributes

2012-05-14 Thread Andreas Tawn
> p.s. Is Python seeing a lot of use at Ubisoft or is this just for personal > interest (or > perhaps both)? We do use Python a fair bit, mostly for build systems and data mining, but also because it's the built-in script language for Motionbuilder. -- http://mail.python.org/mailman/listinfo/py

Re: Remove root handler from logger

2012-05-14 Thread Jean-Michel Pichavant
Florian Lindner wrote: Hello, I configure my logging on application startup like that: logging.basicConfig(level = logging.DEBUG, format=FORMAT, filename = logfile) ch = logging.StreamHandler() ch.setFormatter(logging.Formatter(FORMAT)) logging.getLogger().addHandler(ch) In one module of my a

Re: How to call and execute C code in Python?

2012-05-14 Thread Michael Torrie
On 05/13/2012 11:27 AM, Mark Lawrence wrote: > Stefan, you appear to have a lot to do with Cython. It would be polite > to mention this when replying. > Why? Do you think this is some sort of weird conflict of interest? As anyone who follows this list for several years would know, Cython is a

Re: How to call and execute C code in Python?

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 12:36 AM, Michael Torrie wrote: > On 05/13/2012 11:27 AM, Mark Lawrence wrote: >> Stefan, you appear to have a lot to do with Cython. It would be polite >> to mention this when replying. > > Why?  Do you think this is some sort of weird conflict of interest?  As > anyone wh

Extracting DB schema (newbie Q)

2012-05-14 Thread Steve Sawyer
Brand-new to Python (that's a warning, folks) Trying to write a routine to import a CSV file into a SQL Server table. To ensure that I convert the data from the CSV appropriately, I"m executing a query that gives me the schema (data column names, data types and sizes) from the target table. What

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 2:01 AM, Steve Sawyer wrote: > Brand-new to Python (that's a warning, folks) It's one we're familiar with :) Welcome! > Trying to write a routine to import a CSV file into a SQL Server > table. To ensure that I convert the data from the CSV appropriately, > I"m executing

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Jean-Michel Pichavant
Steve Sawyer wrote: Brand-new to Python (that's a warning, folks) Trying to write a routine to import a CSV file into a SQL Server table. To ensure that I convert the data from the CSV appropriately, I"m executing a query that gives me the schema (data column names, data types and sizes) from th

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread John Gordon
In Steve Sawyer writes: > What I think I want to do is to construct a dictionary using the > column names as the index value, and a list containing the various > attributes (data type, lenghth, precision). If you're using just the column name as the dictionary key, make sure there are no dupli

Re: Dealing with the __str__ method in classes with lots of attributes

2012-05-14 Thread Karl Knechtel
On Sat, May 12, 2012 at 9:10 AM, Ethan Furman wrote: > > Firstly, __slots__ is a tuple. I object: conceptually, the "slots" of a class are set in stone, but the `__slots__` attribute of a class object is just an attribute, and any iterable (as long as it yields valid identifier names) can be used

Re: Good data structure for finding date intervals including a given date

2012-05-14 Thread Karl Knechtel
On Sat, May 12, 2012 at 10:18 AM, Jean-Daniel wrote: >> Since you say "intervals" in plural here, I assume that they can overlap? > > Yes, > > For instance, there are the following intervals : > [[1, 10], > [4, 7], > [6, 15], > [11, 17]] > > asking for the intervals including  5, the returned valu

Re: Good data structure for finding date intervals including a given date

2012-05-14 Thread Christian Heimes
Am 12.05.2012 14:17, schrieb Jean-Daniel: > Hello, > > I have a long list of n date intervals that gets added or suppressed > intervals regularly. I am looking for a fast way to find the intervals > containing a given date, without having to check all intervals (less > than O(n)). > > Do you know

Re: dynamically selecting a class to instantiate based on the object attributes.

2012-05-14 Thread Karl Knechtel
On Wed, May 9, 2012 at 7:02 AM, J. Mwebaze wrote: > > During object instantiaton, i would like to use  the specific class, that > corresponds to the version of the class that was used to create the object. I don't understand; "the version of the class that was used to create" **what** object? We'

tkinter: is there a way to switch a widget's master?

2012-05-14 Thread Frederic Rentsch
Hi there, I would like to prepare a bunch of info text widgets to be displayed in Toplevel windows at the user's command (when ever he needs directions). I know how to remove and restore widgets without destroying them in between. The problem with a Toplevel is that it is a master that comes and g

Re: dynamically selecting a class to instantiate based on the object attributes.

2012-05-14 Thread Ian Kelly
On Wed, May 9, 2012 at 5:02 AM, J. Mwebaze wrote: > > I have a  bunch of objects of the same type. Each object has a version > attribute and this refers to source code that was used to make the object. > SouceCode is maintained in separate files. eg. > myclass_01.py, myclass_02.py, myclass_03.py, 

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Steve Sawyer
Thanks, John. >What are you trying that isn't working? Typical newbie trick - trying to make things more complicated than they are. I didn't realize that syntax would establish the key/value pairs of the dictionary - I thought that would only allow you to establish the value to correspond to a spe

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread Chris Angelico
On Tue, May 15, 2012 at 5:09 AM, Steve Sawyer wrote: > Thanks - now, given my query that returns the table structure, this > works fine: > > table_dict = {} > table_specs = cursor.execute(query_string) > for row in table_specs: >        row_dict = {} >        row_dict['type'] = row.DataType >    

Re-raised exceptions in 2.7.3 -- stack trace missing

2012-05-14 Thread Oliver Beattie
Hi there I'm tying to investigate a bit of a weird problem here. Basically, I've just upgraded Python (from 2.7.2 -> 2.7.3) by way of an OS upgrade (Ubuntu), and now all the tracebacks I'm getting sent from my web app are looking like this: http://dpaste.org/EgKJp/ As you can see, Django is co

Re: which book?

2012-05-14 Thread Miki Tebeka
> I am going to learn python for some plot issues. which book or sources, do > you recommend please? The tutorial is pretty good if you already know how to program. I also heard a lot of good things on "Python Essential Reference". -- http://mail.python.org/mailman/listinfo/python-list

Re: PyTextile Question

2012-05-14 Thread Josh English
On Monday, May 7, 2012 6:13:28 AM UTC-7, dinkyp...@gmail.com wrote: > > Below is a test script that shows one way I've dealt with this issue in the > past by reformatting paragraphs to remove embedded line breaks. YMMV. > > import re, textile > ... Wow. Thank you. This works. I'm trying to fig

Instrumenting a class to see how it is used

2012-05-14 Thread Paul Moore
I'm trying to reverse-engineer some pretty complex code. One thing that would help me a lot is if I could instrument a key class, so that I'd get a report of when and how each method was called and any properties or attributes were accessed during a typical run. I could do this relatively easil

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-14 Thread james hedley
> i have not banned anything, or even alluded to it, whatsoever. i asked that > one specific mail not be commented upon OK, sorry if I misunderstood, but that's still suppression in my book. > reading your accounts strewn about is interesting, what exactly are *your* > motives? My motives ar

Re: Python ABAQUS debugging problem.

2012-05-14 Thread Mahendra
On May 10, 9:31 am, Mahendra wrote: > Dear all, >             I am learning to use python script for running ABAQUS > (commerical finite element program). I am having a bug in the > following chunk of code and am not sure what it is. I have three loops > in my code. The first two loops work fine.

Re: which book?

2012-05-14 Thread d . poreh
On Wednesday, May 9, 2012 7:13:54 AM UTC-7, Miki Tebeka wrote: > > I am going to learn python for some plot issues. which book or sources, do > > you recommend please? > The tutorial is pretty good if you already know how to program. > I also heard a lot of good things on "Python Essential Referen

Re: Alternative to subprocess in order to not wait for calling commands to complete

2012-05-14 Thread Adam Skutt
On May 10, 12:07 pm, ks wrote: > Hi All, > > From within one Python program, I would like to invoke three other > Python programs. Usually I would use the subprocess module to invoke > these sequentially. I now have a use case in which I must invoke the > first one (not wait for it to complete), t

Python ABAQUS debugging problem.

2012-05-14 Thread Mahendra
Dear all, I am learning to use python script for running ABAQUS (commerical finite element program). I am having a bug in the following chunk of code and am not sure what it is. I have three loops in my code. The first two loops work fine. The third loop is a combination of loop 1 and l

Re: "pakistani girls" "pakistani girls lahore" "pakistani girls phone numbers" "pakistani girls mobile number" "pakistani girls wallpapers" "pakistani girls cell numbers" on www.epakistanigirls.blogsp

2012-05-14 Thread Maha Jabeen
fuck you dude http://numbersofgirlsinpakistan.blogspot.com/ http://numbersofgirlsinpakistan.blogspot.com/ http://numbersofgirlsinpakistan.blogspot.com/ http://numbersofgirlsinpakistan.blogspot.com/ http://numbersofgirlsinpakistan.blogspot.com/ http://numbersofgirlsinpakistan.blogspot.com/ http://nu

Re: Instrumenting a class to see how it is used

2012-05-14 Thread Michele Simionato
This may get you started (warning: not really tested). $ echo instr.py from warnings import warn oget = object.__getattribute__ tget = type.__getattribute__ class Instr(object): class __metaclass__(type): def __getattribute__(cls, name): clsname = tget(cls, '__na

Alternative to subprocess in order to not wait for calling commands to complete

2012-05-14 Thread ks
Hi All, >From within one Python program, I would like to invoke three other Python programs. Usually I would use the subprocess module to invoke these sequentially. I now have a use case in which I must invoke the first one (not wait for it to complete), then invoke the second (similarly not wait

Clicking a sub menu item

2012-05-14 Thread googlewellwisher
Hello, Im a newbie to automation testing.Im using python scripting in selenium to automate a website. Now im facing a difficulty in clicking a submenu item.I have 5 buttons in the main menu.I am able to click each of the menu button using self.driver.find_element_by_id("MainMenuButton1").click()

Re: parallel subprocess.getoutput

2012-05-14 Thread Adam Skutt
On May 11, 8:04 am, Jaroslav Dobrek wrote: > Hello, > > I wrote the following code for using egrep on many large files: > > MY_DIR = '/my/path/to/dir' > FILES = os.listdir(MY_DIR) > > def grep(regex): >     i = 0 >     l = len(FILES) >     output = [] >     while i < l: >         command = "egrep

parallel subprocess.getoutput

2012-05-14 Thread Jaroslav Dobrek
Hello, I wrote the following code for using egrep on many large files: MY_DIR = '/my/path/to/dir' FILES = os.listdir(MY_DIR) def grep(regex): i = 0 l = len(FILES) output = [] while i < l: command = "egrep " + '"' + regex + '" ' + MY_DIR + '/' + FILES[i] result = s

Newby Python Programming Question

2012-05-14 Thread Coyote
Folks, I am migrating to Python after a 20+ year career writing IDL programs exclusively. I have a really simple question that I can't find the answer to in any of the books and tutorials I have been reading to get up to speed. I have two programs. The first is in a file I named file_utils.py:

Re: parallel subprocess.getoutput

2012-05-14 Thread Jaroslav Dobrek
Sorry, for code-historical reasons this was unnecessarily complicated. Should be: MY_DIR = '/my/path/to/dir' FILES = os.listdir(MY_DIR) def grep(regex): output = [] for f in FILES: command = "egrep " + '"' + regex + '" ' + MY_DIR + '/' + f result = subprocess.getoutput(c

specify end of line character for readline

2012-05-14 Thread Jason
Is there any way to specify the end of line character to use in file.readline() ? I would like to use '\r\n' as the end of line and allow either \r or \n by itself within the line. Thanks, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: which book?

2012-05-14 Thread darnold
On May 10, 4:58 am, d.po...@gmail.com wrote: > On Wednesday, May 9, 2012 7:13:54 AM UTC-7, Miki Tebeka wrote: > > > I am going to learn python for some plot issues. which book or sources, > > > do you recommend please? > > The tutorial is pretty good if you already know how to program. > > I also

Sharing Data in Python

2012-05-14 Thread raunakgup90
I have some Pickled data, which is stored on disk, and it is about 100 MB in size. When my python program is executed, the picked data is loaded using the cPickle module, and all that works fine. If I execute the python multiple times using python main.py for example, each python process will

Re: Newby Python Programming Question

2012-05-14 Thread Maarten
On Friday, May 11, 2012 5:25:20 PM UTC+2, Coyote wrote: > I am migrating to Python after a 20+ year career writing IDL programs > exclusively. I have a really simple question that I can't find the answer to > in any of the books and tutorials I have been reading to get up to speed. Welcome here

Re: Scrapy - importing files from local, rather than www

2012-05-14 Thread leomcallister
You can try running Python's web server on the folder (python -m SimpleHTTPServer) and point Scrapy to it. On Monday, May 7, 2012 4:57:22 AM UTC-3, nbw wrote: > Hi everyone, I'm new to Python (loving it!) and Scrapy. I have a > question I just can't seem to get my head around. I can get a simple

Re: Newby Python Programming Question

2012-05-14 Thread Coyote
Maarten writes: > I do recommend you read http://docs.python.org/howto/doanddont.html as a > starting point to avoid learning some bad habits, especially on importing. > You probably already found > https://www.cfa.harvard.edu/~jbattat/computer/python/science/idl-numpy.html Yikes! I'm sure tha

Re: Newby Python Programming Question

2012-05-14 Thread CM
On May 11, 11:25 am, Coyote wrote: > Folks, > > I am migrating to Python after a 20+ year career writing IDL programs > exclusively. I have a really simple question that I can't find the answer to > in any of the books and tutorials I have been reading to get up to speed. > > I have two programs

%d not working in re at Python 2.7?

2012-05-14 Thread vacu
I am frustrated to see %d not working in my Python 2.7 re.search, like this example: >>> (re.search('%d', "asdfdsf78asdfdf")).group(0) Traceback (most recent call last): File "", line 1, in AttributeError: 'NoneType' object has no attribute 'group' \d works fine: >>> (re.search('\d+', "asdfd

Re: Newby Python Programming Question

2012-05-14 Thread Coyote
CM writes: > I don't know Spyder IDE, but I don't think this should happen; could > there just be a simple mistake? Because you first refer to the .py > file as 'file_utils.py' but then you refer to the file as > 'pwd.py'...which is also the name of your function. Room for > confusion...so could

tiny script has memory leak

2012-05-14 Thread gry
sys.version --> '2.6 (r26:66714, Feb 21 2009, 02:16:04) \n[GCC 4.3.2 [gcc-4_3-branch revision 141291]] I thought this script would be very lean and fast, but with a large value for n (like 15), it uses 26G of virtural memory, and things start to crumble. #!/usr/bin/env python '''write a file o

Re: Sharing Data in Python

2012-05-14 Thread Miki Tebeka
> How can I make it so, all new python process share this data, so it is only > loaded a single time into memory? You can have one process as server and client ask for parts of data. You might be able to do something smart with mmap but I can't think of a way. I Linux systems, if you first load t

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-14 Thread anthony
On Thursday, May 10, 2012 3:06:47 AM UTC-5, james hedley wrote: > > i have not banned anything, or even alluded to it, whatsoever. i asked that > > one specific mail not be commented upon > > OK, sorry if I misunderstood, but that's still suppression in my book. James, how can you realistically

Python web-framework+db with the widest scalability?

2012-05-14 Thread Alec Taylor
I am building a project requiring high performance and scalability, entailing: • Role-based authentication with API-key licensing to access data of specific users • API exposed with REST (XML, JSON), XMLRPC, JSONRPC and SOAP • "Easily" configurable getters and setters to create APIs accessing the

Re: Python web-framework+db with the widest scalability?

2012-05-14 Thread elektrrrus
Hi, From my experience while NoSQL databases are very fast and scalable, there is lack of _good_ support for popular frameworks. I've try with django and mongoengine, but results was poor. In my company we're building now large api-driven application with django and postgresql as a base. Django

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Josh McGee
% On Friday, May 11, 2012 11:58:01 AM UTC-7, vacu wrote: > I am frustrated to see %d not working in my Python 2.7 re.search, like > this example: > > >>> (re.search('%d', "asdfdsf78asdfdf")).group(0) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'NoneType' object

Hashability questions

2012-05-14 Thread Bob Grommes
Noob alert: writing my first Python class library. I have a straightforward class called Utility that lives in Utility.py. I'm trying to get a handle on best practices for fleshing out a library. As such, I've done the following for starters: def __str__(self): return str(type(self)) #

Are there any instrumentation widgets for wxpython or tkinter?

2012-05-14 Thread Sverre
I searched for widgets used for PLC automation or lab instrumentation like gauges, led's etc. in the net, but didn't found anything because of those massive link spam sites. In the case there isn't any solution, with which toolkit would it be easiest to build gauges? -- http://mail.python.org/mail

Re: Extracting DB schema (newbie Q)

2012-05-14 Thread james hedley
On Monday, 14 May 2012 17:01:49 UTC+1, Steve Sawyer wrote: > Brand-new to Python (that's a warning, folks) > > Trying to write a routine to import a CSV file into a SQL Server > table. To ensure that I convert the data from the CSV appropriately, > I"m executing a query that gives me the schema (

Yet another "split string by spaces preserving single quotes" problem

2012-05-14 Thread Massi
Hi everyone, I know this question has been asked thousands of times, but in my case I have an additional requirement to be satisfied. I need to handle substrings in the form 'string with spaces':'another string with spaces' as a single token; I mean, if I have this string: s ="This is a 'simple te

Re: which book?

2012-05-14 Thread Mark Lawrence
On 10/05/2012 10:58, d.po...@gmail.com wrote: On Wednesday, May 9, 2012 7:13:54 AM UTC-7, Miki Tebeka wrote: I am going to learn python for some plot issues. which book or sources, do you recommend please? The tutorial is pretty good if you already know how to program. I also heard a lot of go

Re: Need to get Tags and Values from Dom

2012-05-14 Thread james hedley
On Monday, 14 May 2012 01:50:23 UTC+1, TommyVee wrote: > I have a very simple XML document that I need to "walk", and I'm using > xml.dom.minidom. No attributes, just lots of nested tags and associated > values. All I'm looking to do is iterate through each of the highest > sibling nodes, che

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Tim Chase
On 05/11/12 13:58, vacu wrote: > I am frustrated to see %d not working in my Python 2.7 re.search, like > this example: > (re.search('%d', "asdfdsf78asdfdf")).group(0) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'NoneType' object has no attribute 'group' >

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Benjamin Kaplan
On May 14, 2012 7:06 PM, "vacu" wrote: > > I am frustrated to see %d not working in my Python 2.7 re.search, like > this example: > > >>> (re.search('%d', "asdfdsf78asdfdf")).group(0) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'NoneType' object has no attribute

Re: Hashability questions

2012-05-14 Thread Chris Kaynor
On Sun, May 13, 2012 at 12:11 PM, Bob Grommes wrote: > Noob alert: writing my first Python class library. > > I have a straightforward class called Utility that lives in Utility.py. > > I'm trying to get a handle on best practices for fleshing out a library.  As > such, I've done the following fo

Re: Open Source: you're doing it wrong - the Pyjamas hijack

2012-05-14 Thread Mark Lawrence
On 12/05/2012 08:10, anth...@xtfx.me wrote: On Thursday, May 10, 2012 3:06:47 AM UTC-5, james hedley wrote: My nose and my stomach give me a very strong feeling that something is very, very wrong with the pyjamas project. I've personally never used it, but given the adverse publicity I would

Re: Hashability questions

2012-05-14 Thread Chris Rebert
On Sun, May 13, 2012 at 12:11 PM, Bob Grommes wrote: > Noob alert: writing my first Python class library. > > I have a straightforward class called Utility that lives in Utility.py. > > I'm trying to get a handle on best practices for fleshing out a library.  As > such, I've done the following fo

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Vacu
Thanks Tim, it is my mis-understanding of usage of %d in Python. After reading it carefully, it should be used in re.scan. The reason I made this dump mistake is because I got a script from our expert and I am totally new on Python, before reading your email, I hadn't a doubt it is wrong usage and

Re: Need to get Tags and Values from Dom

2012-05-14 Thread TommyVee
"james hedley" wrote in message news:11852803.89.1337001575700.JavaMail.geo-discussion-forums@vbmd2... On Monday, 14 May 2012 01:50:23 UTC+1, TommyVee wrote: I have a very simple XML document that I need to "walk", and I'm using xml.dom.minidom. No attributes, just lots of nested tags and as

Re: tiny script has memory leak

2012-05-14 Thread Ian Kelly
On Fri, May 11, 2012 at 3:29 PM, gry wrote: > sys.version --> '2.6 (r26:66714, Feb 21 2009, 02:16:04) \n[GCC 4.3.2 > [gcc-4_3-branch revision 141291]] > I thought this script would be very lean and fast, but with a large > value for n (like 15), it uses 26G of virtural memory, and things > sta

Re: Yet another "split string by spaces preserving single quotes" problem

2012-05-14 Thread Tim Chase
On 05/13/12 16:14, Massi wrote: > Hi everyone, > I know this question has been asked thousands of times, but in my case > I have an additional requirement to be satisfied. I need to handle > substrings in the form 'string with spaces':'another string with > spaces' as a single token; I mean, if I h

Re: tiny script has memory leak

2012-05-14 Thread Chris Angelico
On Sat, May 12, 2012 at 7:29 AM, gry wrote: > f = open(sys.argv[1], 'w') What are you passing as the file name argument? Could that device be the cause of your memory usage spike? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Hashability questions

2012-05-14 Thread Dave Angel
On 05/14/2012 07:38 PM, Chris Kaynor wrote: > On Sun, May 13, 2012 at 12:11 PM, Bob Grommes wrote: >> >> >> The rule is that, if two objects return different results from >> __hash__, they should never compare equal. The opposite rule also >> holds true: if two objects compare equal, they should

Re: Hashability questions

2012-05-14 Thread alex23
On May 14, 5:11 am, Bob Grommes wrote: > Obviously there is some sort of default implementation of __hash__() > at work and my implementation of _eq_() has somehow broken it. > Can anyone explain what's going on? It looks like this has changed between Python 2 and 3: "If a class does not define

Re: Hashability questions

2012-05-14 Thread Christian Heimes
Am 13.05.2012 21:11, schrieb Bob Grommes: > Noob alert: writing my first Python class library. > > I have a straightforward class called Utility that lives in Utility.py. > > I'm trying to get a handle on best practices for fleshing out a library. As > such, I've done the following for starters

Re: Newby Python Programming Question

2012-05-14 Thread Chris Angelico
On Sat, May 12, 2012 at 8:25 AM, Coyote wrote: > I've been playing around with a couple of IDEs because I liked the one I used > with IDL and I wanted to use something similar for Python. The IDLDE was an > Eclipse variant, but I've tried installing Eclipse before for something else > and I'm p

Re: Newby Python Programming Question

2012-05-14 Thread Simon Cropper
On 15/05/12 12:18, Chris Angelico wrote: On Sat, May 12, 2012 at 8:25 AM, Coyote wrote: I've been playing around with a couple of IDEs because I liked the one I used with IDL and I wanted to use something similar for Python. The IDLDE was an Eclipse variant, but I've tried installing Eclipse

Re: Hashability questions

2012-05-14 Thread Ian Kelly
On Mon, May 14, 2012 at 7:50 PM, Christian Heimes wrote: > Am 13.05.2012 21:11, schrieb Bob Grommes: >> Noob alert: writing my first Python class library. >> >> I have a straightforward class called Utility that lives in Utility.py. >> >> I'm trying to get a handle on best practices for fleshing o

Re: Need to get Tags and Values from Dom

2012-05-14 Thread Stefan Behnel
TommyVee, 15.05.2012 01:51: > Confused? That's an understatement. Part of the problem is that it's been > a long time since I learned DOM and now I'm trying to cram to get this > program done. Thus my recommendation to use ElementTree. Why go the complicated route when you can just get your code

Re: specify end of line character for readline

2012-05-14 Thread Ian Kelly
On Fri, May 11, 2012 at 1:32 PM, Jason wrote: > Is there any way to specify the end of line character to use in > file.readline() ? > > I would like to use '\r\n' as the end of line and allow either \r or \n by > itself within the line. In Python 3 you can pass the argument newline='\r\n' to th