Re: using split function

2006-11-07 Thread [EMAIL PROTECTED]
Thanks a lot, I am done with that part. But now I am facing another problem. I am using the code given below where A is a matrix and row is a sequence. But it gives following error: error-- A[a,:]=row ValueError: setting an array element with a sequence. --code---

Re: shutil: permission denied errors on windows

2006-11-07 Thread [EMAIL PROTECTED]
Antoine De Groote schrieb: > Yes it's strange, I never had the problem before, either. It seems now > to be only the case for folders. A very simple > > shutil.copy('a', 'b') > > already fails with the error message. > > I reinstalled Python, but that didn't change anything... > > Regards, > anto

Help with installing soappy module on Python 2.4.3 (windows machine)

2006-11-07 Thread [EMAIL PROTECTED]
Hi Folks, I want to install the SOAPpy module on my windows box. I have python 2.4.3 Can you help me with the steps and the URL from where can I get the download..?? TIA. Regards, Asrarahmed -- http://mail.python.org/mailman/listinfo/python-list

Re: Plot pkg - Multiple Y axes?

2006-11-07 Thread [EMAIL PROTECTED]
You can try matplotlib. It allows multiple plots in one window. To get the correct rendering of the axis layout needs probably some handwork, but it should be possible. Two axis are not a problem at all. Got through the examples and take a look at the wiki cookbook. All is available at http://matpl

Re: sound processing modules in python - anyone?

2006-11-07 Thread [EMAIL PROTECTED]
Hi, you might want to take a look at pyaudio. A module to read and write audio files. It is based on numpy and wraps the libsndfile library to use it from python. With the capabilites of numpy and scipy you probably have all you need. Here's a link to pyaudio http://www.ar.media.kyoto-u.ac.jp/mem

changing sequence to array

2006-11-07 Thread [EMAIL PROTECTED]
Hi, I am using the code given below where A is a matrix and row is a sequence. But it gives following error: error-- A[a,:]=row ValueError: setting an array element with a sequence. --code #!/usr/bin/python import numpy file1 = open('matrix.txt', 'r')

assigning a sequence to an array

2006-11-07 Thread [EMAIL PROTECTED]
Hi, I am using "A[a,:]=row" in python, where A is a matrix and row is a sequence. But it gives following error: error-- A[a,:]=row ValueError: setting an array element with a sequence. Is there a way to change type of sequence to array so that this situation could be handled tha

Re: E-Commerce Partner Program

2006-11-08 Thread [EMAIL PROTECTED]
to do it is what Im after a simple test program will work. https://sourceforge.net/project/showfiles.php?group_id=156455 http://www.dexrow.com [EMAIL PROTECTED] wrote: > Just thought that I'd let you know that PricePlay.com has launched an > awesome Partner Program for all the

Re: E-Commerce Partner Program

2006-11-08 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Just thought that I'd let you know that PricePlay.com has launched an > awesome Partner Program for all the E-Commerce developers. All you > have to do is sign someone up and get paid. > > http://www.priceplay.com/corporate/partners/incentive/signu

Python/Django Lead Developer Needed in NYC

2006-11-08 Thread [EMAIL PROTECTED]
I hope job ads are ok in this group. It looks like my efforts to make python our base service oriented architecture technology and Django as the core web framework is coming through. I now need to hire a New York based developer to be the tech lead for much of this effort. I can't reveal the co

Re: assigning a sequence to an array

2006-11-08 Thread [EMAIL PROTECTED]
actually what i want to do is this: i have a file with following format: 1 2 3 9 2 3 4 4 I want to read it and then store the values into two matrices, s.t. A=[1 2;3 9] B=[2 3;4 4] any easier way of doing this? thanks Amit Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > Hi, > >

Python Jogos

2006-11-08 Thread [EMAIL PROTECTED]
Jogo da velha Jogo do galo Codigos em python kem me arranja -- http://mail.python.org/mailman/listinfo/python-list

Re: Character encoding

2006-11-08 Thread [EMAIL PROTECTED]
Dennis Lee Bieber wrote: > On 7 Nov 2006 11:34:32 -0800, "mp" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > I have html document titles with characters like >,  , and > > ‡. How do I sddecode a string with these values in Pyth

Python c-api and reusing python-objects: works only once

2006-11-08 Thread [EMAIL PROTECTED]
Hi! I'm trying to access python objects from c++. It works once. Second time it hangs. Does someone have any clue or some example code or pointer? Thanks! /Karim Here are some python classes: -- impo

Re: auto indent

2006-11-08 Thread [EMAIL PROTECTED]
M.N.Smadi wrote: > i have a script that is not indented properly. Is there > a way that i can have it auto indented. FWIW the Zeus for Windows IDE will fold Pyhon code: http://www.zeusedit.com/features.html With the code folded you can then select the folded line and using 'tab'/'shift tab'

Re: decorators

2006-11-08 Thread [EMAIL PROTECTED]
John Henry wrote: > I must be very thick. I keep reading about what decorators are and I > still don't have a good feel about it. See, for example: > > http://alex.dojotoolkit.org/?p=564 > > What exactly do I use decorators for? Metafunctions. Saying @mydecorator def foo(...): ... is just a

Re: Lists of lists and tuples, and finding things within them

2006-11-09 Thread [EMAIL PROTECTED]
Thanks Captain Obvious! Daniel Nogradi wrote: > > I have a program that keeps some of its data in a list of tuples. > > Sometimes, I want to be able to find that data out of the list. Here is > > the list in question: > > > > [('password01', 'unk'), ('host', 'dragonstone.org'), ('port', '1234')

Re: [OT] Py3K idea: why not drop the colon?

2006-11-09 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Paul Boddie wrote: > > Steve Holden wrote: > >> Paul Boddie wrote: > >>> http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-while-def-class-statements > >>> > >> I suppose it would be even better if that hyperlink actually took you to > >> section 1.4.

Re: comparing Unicode and string

2006-11-09 Thread [EMAIL PROTECTED]
Marc 'BlackJack' Rintsch wrote: > Why? Python strings are *byte strings* and bytes have values in the range > 0..255. Why would you restrict them to ASCII only? Because getting an exception when comparing a string with a unicode string is irritating. But I don't insist on my PEP. The example ju

Re: substring search without using built in utils

2006-11-10 Thread [EMAIL PROTECTED]
My lecture Mustafa Başer give me the same homework.But u have to check similar algorithm at c then you can manipulate the same functions for python.Cause other languages (except C#, java etc.) does not have a strong library as python.Or alternatively you can check the source codes too see beh

Re: how is python not the same as java?

2006-11-10 Thread [EMAIL PROTECTED]
gavino wrote: > both are interpreted oo langauges.. How are LANs (http://en.wikipedia.org/wiki/LAN) and porns stars (http://en.wikipedia.org/wiki/Gauge_%28porn_star%29) related to Java, Python, Programming paradigms and trolls? ask Gavino! -- http://mail.python.org/mailman/listinfo/python-l

Re: Newb: installing Jython on Windows XP ...

2006-11-10 Thread [EMAIL PROTECTED]
I haven't installed on cygwin or windows XP myself but you should be using "java jython-21". Note that there are two class files "jython-21.class" and "jython_21.class". Also make sure that the CLASSPATH includes the directory that has these two class files. Raghu. donkeyboy wrote: > All, > > I'

path.py and directory naming: trailing slash automatic?

2006-11-10 Thread [EMAIL PROTECTED]
Hi, I'm a big fan of path.py. One thing that I think is a good idea is for directories to automatically have a slash appended to them if it is not automatically added. Eg: from path import path dir = path('/some/dir') x = dir + "file" # should yield /some/dir/file I emailed the author of path

Modules, Packages and Developer Confusion. Oh My!

2006-11-10 Thread [EMAIL PROTECTED]
I think I'm still missing something in how python is handling packages and it's mixing me up. I have a package with three files (modules?) like so: OPS:\ __init__.py model.py search.py To hide more details of the package structure, I import model and search inside of __init__. It also seeme

Re: how is python not the same as java?

2006-11-10 Thread [EMAIL PROTECTED]
You can get educated in java through manpower for free just apply for a job(through thier online learning thing) but you can't add python to your plan. :( They have pearl, c, basic, cobol also but no python. https://sourceforge.net/project/showfiles.php?group_id=156455 gavino wrote: > both

logging

2006-11-12 Thread [EMAIL PROTECTED]
Hi all ! How to remove a logger ? There si no logging.removeLogger(name) method. I've a lot of objects that create loging. When objects are destroyed, associated logger are not. This create memory leak... Thanks for any idea. -- http://mail.python.org/mailman/listinfo/python-list

Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
Dear all, I am looking for a data structure to hold rectangles in a 2d space. Please point me to any module which does these operations: Insert a rectangle into a particular co-ordinate. Get the rectangle/s right/left/above/below side to a particular rectangle. Get all the rectangles within a b

Re: Jython compile errors ...

2006-11-13 Thread [EMAIL PROTECTED]
If you are looking for an example of jython there is one in embeded in csound blue. available from the csounds.com website I believe. I have used it under the new java framework. I am not far enough along to know if you are missing brackets {} exc and () and one ; but you can try getting the pyt

Re: Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
better answer. http://my.opera.com/yjfuk/blog/index.dml/tag/captcha https://sourceforge.net/project/showfiles.php?group_id=156455 http://www.dexrow.com [EMAIL PROTECTED] wrote: > Dear all, > I am looking for a data structure to hold rectangles in a 2d space. > Please point me to a

Re: Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I am looking for a data structure to hold rectangles in a 2d space. > > Please point me to any module which does these operations: > > Insert a rectangle into a particular co-ordinate. > > Get the rectangle/s

Re: logging

2006-11-13 Thread [EMAIL PROTECTED]
Diez B. Roggisch wote: > [EMAIL PROTECTED] wrote: > > > Hi all ! > > How to remove a logger ? > > There si no logging.removeLogger(name) method. > > I've a lot of objects that create loging. > > When objects are destroyed, associated logger are not. This

Re: Is python for me?

2006-11-13 Thread [EMAIL PROTECTED]
would recomend it. And most of these things will probably be fixed in Python 3000! Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > lennart <[EMAIL PROTECTED]> wrote: > >Hi, > > > >I'm planning to learn a language for 'client' software. Unt

Re: tab compleation input

2006-11-13 Thread [EMAIL PROTECTED]
On a gui on this would be a little bit easier but it's a completley diffrent realm when doing it in the console. It makes it a little more difficult when using stdin.readline() because you can only read line by line. Here is my implmentation. import sys validanswers = [ 'yes', 'no', 'maybe', 'tue

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread [EMAIL PROTECTED]
Michael Hobbs wrote: > No, old research does is not automatically invalidated, but > out-of-context research is. I'm sure there's research somewhere proving > that code written in ALL UPPERCASE is preferable, since it makes > punched-cards easier to read by humans. Python 1.0 may have been a nice >

__cmp__ between dissimilar objects

2006-11-13 Thread [EMAIL PROTECTED]
I have a class that has, as an attribute, an instance of datetime.datetime(). I would like to be able to compare my class directly to instances of datetime.datetime in addition to other instances of my class. The value used for the comparison in either case should be the value of the datetime att

to setattr or def setProp()

2006-11-13 Thread [EMAIL PROTECTED]
I have a class for rectangle and it has two points in its __slots__ . However, we can derive a number of properties like width, height, centerPoint etc from these two points. Now, I want to be able to set and get these properties directly from the instances. I can either def __setattr__ , __getattr

A memory leak involving builtin/pure-python inheritance.

2006-11-13 Thread [EMAIL PROTECTED]
Hi folks, Quick Synopsis: A test script demonstrates a memory leak when I use pythonic extensions of my builtin types, but if I use the builtin types themselves there is no memory leak. If you are interested in how builtin/pure-python inheritance interacts with the gc, maybe you can help me fix

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> When the rich comparison methods raise NotImplementedError, the > comparison logic inside the interpreter tries reversing the operands. Can you point me to a description of this algorithm? It doesn't seem to be described in the documentation for the rich comparison or __cmp__ methods... -Ben

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> why not just inherit from datetime instead? I'll probably do that in the next iteration. > or read footnote 4 under "supported operations" on this page for info on how > to > implement mixed-type comparisions: > > http://docs.python.org/lib/datetime-datetime.html OK. I added a 'timetuple

Re: Is python for me?

2006-11-14 Thread [EMAIL PROTECTED]
By large I mean an application with intensive operations, such as a fancy GUI maybe a couple of threads, accessing a database, etc. lennart wrote: > [EMAIL PROTECTED] schreef: > > > As stated above python is capable of all those things, however on > > larger applications like t

multi split function taking delimiter list

2006-11-14 Thread [EMAIL PROTECTED]
Hi, I'm looking for something like: multi_split( 'a:=b+c' , [':=','+'] ) returning: ['a', ':=', 'b', '+', 'c'] whats the python way to achieve this, preferably without regexp? Thanks. Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob | datetime question

2006-11-14 Thread [EMAIL PROTECTED]
On Nov 14, 4:22 pm, "Demel, Jeff" <[EMAIL PROTECTED]> wrote: > I'm having trouble finding exactly what I need by googling, so thought > I'd try to get a quick answer from the group. This seems like something > that should be dead simple. > > I need to

Re: __cmp__ between dissimilar objects

2006-11-14 Thread [EMAIL PROTECTED]
> >Can you point me to a description of this algorithm? It doesn't seem > >to be described in the documentation for the rich comparison or __cmp__ > >methods... > > PEP 207 > http://www.python.org/dev/peps/pep-0207/ So since I implemented __cmp__ instead of the rich comparison operators, Python f

reading csv problem

2006-11-14 Thread [EMAIL PROTECTED]
Hello, I use csv to take information from file. import csv reader = csv.reader(open('t.csv')) for row in reader: print row # it is perfectly OK - But If I use this code I have problem import csv reader = csv.reader(open('t.c

Re: reading csv problem

2006-11-15 Thread [EMAIL PROTECTED]
Thank you. On Nov 15, 1:33 pm, Cameron Walsh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > I use csv to take information from file. > > import csv > > reader = csv.reader(open('t.csv')) > > > fo

Re: How to pass an argument to a python program open in IDLE?

2006-11-15 Thread [EMAIL PROTECTED]
On Nov 15, 7:56 am, [EMAIL PROTECTED] wrote: > Hello, > > I have open a Python program in the IDLE, but when I select the "run > module" under "run" menu, it > does not allow me to pass an argument to my Python program! > How do you pass an argument to a Pyt

wrapping existing instance in new interface

2006-11-15 Thread [EMAIL PROTECTED]
I am writing a class that subclasses datetime.datetime in order to add a few specialized methods. So far the __init__ looks like this: class myDateTime(datetime.datetime): def __init__(self, time, *args, **kwargs): if isinstance(time, str): timeTuple, tzOffset = self.magic

More puzzling behavior while subclassing datetime

2006-11-15 Thread [EMAIL PROTECTED]
With assistance from Gabriel and Frederik (and a few old threads in c.l.p.) I've been making headway on my specialized datetime class. Now I'm puzzled by behavior I didn't expect while attempting to use some of the alternate datetime constructors. Specifically, it appears if I call GeneralizedTim

Re: More puzzling behavior while subclassing datetime

2006-11-16 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > With assistance from Gabriel and Frederik (and a few old threads in > c.l.p.) I've been making headway on my specialized datetime class. Now > I'm puzzled by behavior I didn't expect while attempting to use some of > the alternate datetime

Re: More puzzling behavior while subclassing datetime

2006-11-16 Thread [EMAIL PROTECTED]
> Yes. Consider: > > >>> def today(time=None, *args): > ... print "time = ", time, "args = ", args > ... > >>> today(2006, 11, 16) > time = 2006 args = (11, 16) > > To fix the issue you'll probably have to remove the time=None parameter from > GeneralizedTime.__new__() and instead extract it

Re: Is python for me?

2006-11-16 Thread [EMAIL PROTECTED]
Yes of course python can handle of these things, but have you actually compared them to something written in C? Even if the app was converted into bytecode, it's still not as fast as an executable, that's all I am saying. Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > >

Re: Python v PHP: fair comparison?

2006-11-16 Thread [EMAIL PROTECTED]
Luis M. González wrote: > Cameron Laird ha escrito: > > Perhaps it's timely to clarify the "newer" above: Guido > > made Python public in '89-90, and Rasmus showed PHP to > > others in '94-95. > > OK. But since when has python been considered a viable alternative for > web development? > As a gene

Re: problem with defining a global class instance

2006-11-16 Thread [EMAIL PROTECTED]
sharath B N wrote: > hi, > i am sort of newbie to python. I am trying to do a super Market > simulation with OOP in python. I have problems with using a class > instance as global... > def generate (... ,,...) > > " in this function i define the global variables " > global stock,stockManager,

itertools.count() as built-in

2006-05-28 Thread [EMAIL PROTECTED]
Is there any chance of itertools.count() ever becoming one of the built-in functions? It's a wonderful little function and I find myself importing it in every module I write. -Janto -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.count() as built-in

2006-05-28 Thread [EMAIL PROTECTED]
I have a project of around 6000 lines where I used count() 20 times. It has 14 modules, 10 of which I needed an explicit import. Many of the usages are of the form: for item, n in zip(items, count(N)): dostuff Around half of these are due to using pylab.subplot(x,y.n), which requires values for

Re: itertools.count() as built-in

2006-05-28 Thread [EMAIL PROTECTED]
Oh and I use repeat, chain and cycle quite a bit. But I don't mind importing them as they are usually limited to one module. -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools.count() as built-in

2006-05-29 Thread [EMAIL PROTECTED]
Oops. The messed-up version wasn't supposed to be messed-up. Two mistakes on one line. Which kinda proves my point :) I'd much rather use the count version than (1) or (2). (1) has the problem of having "incorrect" values the rest of the time in the loop and (2) is going to an extreme just to avoi

Re: itertools.count() as built-in

2006-05-29 Thread [EMAIL PROTECTED]
Zipping an xrange? I'm having trouble visualizing how you do that to avoid x*i+y. -Janto -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread [EMAIL PROTECTED]
Well thanks for the mathematical restatement of my problem. I had forgotten the proper terms. Searching on those terms generates some interesting results. However, none of the algo's I have checked will work with generated sequences, or iterable classes, as posited in my first post. While app

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread [EMAIL PROTECTED]
This would only work for combinations of identical sets, and also does not seem to work with generated sets, or iterators. Forgetting dice for a moment. Say I have 3 very long files, and i want to generate the combinations of lines in the files. This provides a well known iterator for the exampl

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread [EMAIL PROTECTED]
Scott David Daniels wrote: > This works with "iterables" (and produces), rather than "iterators", > which is vital to the operation. > > --Scott David Daniels > [EMAIL PROTECTED] Sorry, it doesn't. It works with strings. It doesn't work with file,

Strange behavior with iterables - is this a bug?

2006-05-30 Thread [EMAIL PROTECTED]
Ok, I am confused about this one. I'm not sure if it's a bug or a feature.. but >>> RESTART >>> f1 = open('word1.txt') >>> f2 = open('word2.txt') >>> f3 = open('word3.txt') >>> print [(i1.strip(),i2.strip(),i3.strip(),) for i1 in f1 for i2 in f2 for i3 >>> in f3]

Re: iterator? way of generating all possible combinations?

2006-05-30 Thread [EMAIL PROTECTED]
def __iter__(self): > self.file.seek(0) > for line in self.file: > nextpos = self.file.tell() > yield line > self.file.seek(nextpos) > > --Scott David Daniels > [EMAIL PROTECTED] Since I was doing this

how to print newline in xml?

2006-05-30 Thread [EMAIL PROTECTED]
I currently use xml.dom.minidom and ext to create a dom-tree which I would write to an xml-file. My intention is to create something like this: but I didn't find any possibility either to put comment directly behind a tag nor did I found how to put a new line like in example betw

Re: Strange behavior with iterables - is this a bug?

2006-05-30 Thread [EMAIL PROTECTED]
DOH!! thanks a lot. had to be something stupid on my part. Now I get it :) -- http://mail.python.org/mailman/listinfo/python-list

Re: iterator? way of generating all possible combinations?

2006-05-31 Thread [EMAIL PROTECTED]
Scott David Daniels wrote: > [EMAIL PROTECTED] wrote: > > Scott David Daniels wrote: > >> Sorry, "re-iterables". A file re-iterable is: > >> > >> class FileReIterable(object): ... > >> def __iter__(self): > >>

Re: Strange behavior with iterables - is this a bug?

2006-05-31 Thread [EMAIL PROTECTED]
Gary Herron wrote: > List comprehension is a great shortcut, but when the shortcut starts > causing trouble, better to go with the old ways. You need to reopen each > file each time you want to iterate through it. You should be able to > understand the difference between these two bits of code. >

Find the context of importer

2006-05-31 Thread [EMAIL PROTECTED]
I'm using Python in a scripting environment. The host application would pass in some objects so that the script can act on it. But there are a number of things I like to add to every script to make it a decent environment, for example, setting up exception hook to show error properly. I tried to fa

Re: Strange behavior with iterables - is this a bug?

2006-05-31 Thread [EMAIL PROTECTED]
rator/iterator to handle very large permutations. Gary Herron wrote: > [EMAIL PROTECTED] wrote: > > >Gary Herron wrote: > > > > > >>List comprehension is a great shortcut, but when the shortcut starts > >>causing trouble, better to go with the old ways. You

Re: ideas for programs?

2006-05-31 Thread [EMAIL PROTECTED]
I have always found it easiest to scratch a personal itch when learning a new language. One of the first things I wrote was a shopping list program for my wife. It was a pretty good way to start learning the lay of the python libraries - it needed a small object database, a gui (tk, although I

Re: using import * with GUIs?

2006-05-31 Thread [EMAIL PROTECTED]
John Salerno wrote: > Hi all. Quick question (but aren't they all?) :) > > Do you think it's a good idea to use the 'from import *' > statement when using a GUI module? It seems on wxPython's site, they > recommend using import wx nowadays, but I wonder if that advice is > followed. Also, I'm sti

Re: how to print newline in xml?

2006-06-01 Thread [EMAIL PROTECTED]
Thank you for a possible solution, but it's not what I'm looking for, cause something like would look quite similar... for big elements like robot it would be ok to use comment as a child of element - but imagine I'd like to comment transformation: I wouldn't like to make this element parent of

Re: Best Python Editor

2006-06-01 Thread [EMAIL PROTECTED]
If we could go back to emacs again for a second... I'm still using emacs but have been playing with a few other ide's (wing, komodo + pydev) are the ones i've given a go recently. However I still end up coming back to emacs for what I consider to be emacs mode's piece of 'killer functionality', (

Re: Best Python Editor

2006-06-01 Thread [EMAIL PROTECTED]
> Can anyone tell me a good python editor/IDE? > It would be great if you can provide the download link also. WingIDE is very good. It gives very nice completions and has a nice thing called "source assistant" that shows the help of the function you're standing on and etc. But I don't think it's o

Re: ideas for programs?

2006-06-01 Thread [EMAIL PROTECTED]
James Stroud wrote: > A digest of the major points summarizing the consensus opinion: > > Thomas Bartkus wrote: > > Python is your tool to put your expertise on a computer. Skill with > Python, > > or any computer language for that matter, counts for little. > &g

Re: how to print newline in xml?

2006-06-01 Thread [EMAIL PROTECTED]
Thank you! I think description as an attribute is readable. But now I'm thinking about the order of attributes cause I noticed that for instance X="0" Y="0" Z="0" set in this order by my script is printed like X="0" Z="0" Y="0" therefore it could be messy - I wouldn't like the description to be som

Re: Best Python Editor

2006-06-01 Thread [EMAIL PROTECTED]
In a windows enviroment, I am a big fan of conTEXT http://www.context.cx/ . Very powerful syntax highlighting for many, many languages . project workspace support . code template support . great file browsing and favorites support . good search/replace support across all open files In a unix env

Re: how to print newline in xml?

2006-06-01 Thread [EMAIL PROTECTED]
I use Python/XML packages are xml.dom.minidom and xml.dom.ext (second just for PrettyPrint) -- http://mail.python.org/mailman/listinfo/python-list

Re: integer to binary...

2006-06-01 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > does anyone know a module or something to convert numbers like integer > to binary format ? > > for example I want to convert number 7 to 0111 so I can make some > bitwise operations... > > Thanks Use the gmpy module. >>> import gmpy

Re: Replace one element of a tuple

2006-06-01 Thread [EMAIL PROTECTED]
Captain Dondo wrote: > I have an array(?) (sorry, I'm new* to python so I'm probably mangling > the terminology) that looks like this: > > [((1028L, datetime.datetime(2006, 5, 30, 7, 0), datetime.datetime(2006, > 5, 30, 7, 30), 'Arthur', 'Prunella Sees the Light; Return of the > Snowball', 'Prunel

Re: struct: type registration?

2006-06-02 Thread [EMAIL PROTECTED]
using struct for the stuff you're up to and you'll finish with weird unmaintainable code. save yourself a lot of pain and use construct instead. http://pyconstruct.wikispaces.com/ -- http://mail.python.org/mailman/listinfo/python-list

os.chdir doesn't accept variables sometimes

2006-06-02 Thread [EMAIL PROTECTED]
print "-SONG "+ string if string[-3:] == "mp3": print "CONVERTING "+string+" to "+string[:string.index(".")]+".mp3" #string = string[:string.index("

Re: How do you practice Python?

2006-06-02 Thread [EMAIL PROTECTED]
Ray wrote: > In our field, we don't always get to program in the language we'd like > to program. So... how do you practice Python in this case? Write code. Lots of it. Work on a project at home, contribute to something open source, use it to write support scripts at work, whatever. Figure out

Using pysqlite2

2006-06-02 Thread [EMAIL PROTECTED]
Is it possible to use this for sending triggers to a sqlite db?Could someone provide me with an example of how to do this please? Thanks -- http://mail.python.org/mailman/listinfo/python-list

restarting multiple instances of apache - newbie Q

2006-06-03 Thread [EMAIL PROTECTED]
hi all, i am new to python programming, so thanks for your patience in advance. I have a small script that I am working on that i want to restart multiple instances of apaches on our developers servers. We have about 25 developers each with their own apache. import sys, os try: file = open(

how not to run out of memory in cursor.execute

2006-06-04 Thread [EMAIL PROTECTED]
I am using cx_Oracle and MySQLdb to pull a lot of data from some tables and I find that the cursor.execute method uses a lot of memory that never gets garbage collected. Using fetchmany instead of fetchall does not seem to make any difference, since it's the execute that uses memory. Breaking the q

xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Hey all, I recently came across the xml.sax libraries and am trying to use them. I am currently making a string variable, and am attempting to pass it into a parser instance as follows: def parseMessage(self, message): #create a XML parser parser = make_parser() #cre

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > if you want to parse a string, use xml.sax.parseString instead of > xml.sax.parse. > > My function has changed to the following (parseString call instead of parse): def parseMessage(self, message): #create a XML parser parser = make_parser() #c

Re: xml.sax problem: getting parse() to read a string

2006-06-05 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > as mentioned in the documentation, and implied by my answer, parseString > is a helper function in the xml.sax module, not a parser method. try doing > > xml.sax.parseString(string, handler) > > instead of that make_parser/setContentHandler/parse dance. > > Thanks a

Re: is it possible to find which process dumped core

2006-06-06 Thread [EMAIL PROTECTED]
if your core is from a python program you can check what file/function was running use this gdb macro: define pbt set $i = 0 set $j = 0 while $i < 1000 select $i if $eip >= &PyEval_EvalFrame if $eip < &PyEval_EvalCodeEx echo c frame # p $i echo py frame # p $j set $j

10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread [EMAIL PROTECTED]
I wrote a program that takes an XML file into memory using Minidom. I found out that the XML document is 10gb. I clearly need SAX or something else? Any suggestions on what that something else is? Is it hard to convert the code from DOM to SAX? -- http://mail.python.org/mailman/listinfo/python-

Re: what are you using python language for?

2006-06-06 Thread [EMAIL PROTECTED]
hacker1017 wrote: > im just asking out of curiosity. Math research on the Collatz Conjecture. -- http://mail.python.org/mailman/listinfo/python-list

Re: capture video from camera

2006-06-06 Thread [EMAIL PROTECTED]
aljosa wrote: >and doesn't provide additional options like > motion detection nor any info on possibility of motion detection or > howto implement An example for motion detection and even pythonic eye toys :) http://gumuz.looze.net/wordpress/index.php/archives/2005/06/06/python-webcam-fun-motion

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread [EMAIL PROTECTED]
The file is an XML dump from Goldmine. I have built a document parser that allows for the population of data from Goldmine into SugarCRM. The clients data se is 10gb. Felipe Almeida Lessa wrote: > Em Ter, 2006-06-06 às 13:56 +, Paul McGuire escreveu: > > (just can't open it up like a text file

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-06 Thread [EMAIL PROTECTED]
Paul, This is interesting. Unfortunately, I have no control over the XML output. The file is from Goldmine. However, you have given me an idea... Is it possible to read an XML document in compressed format? Paul McGuire wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROT

Re: how not to run out of memory in cursor.execute

2006-06-07 Thread [EMAIL PROTECTED]
whenever you are using a package that leaks memory. it can be appropriate to use Rpyc (http://rpyc.wikispaces.com/) to run the leaking code in a different process, and restart it from time to time. I've been using this method to avoid the leaks of matplotlib. -- http://mail.python.org/mailman/lis

Re: A more elegant way to do this list comprehension?

2006-06-07 Thread [EMAIL PROTECTED]
> > [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, > > 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8] > [i+1 for i in range(8) for j in range(i+1)] [i for i in range(9) for j in range(i)] -- http://mail.python.org/mailman/listinfo/python-list

Re: what are you using python language for?

2006-06-07 Thread [EMAIL PROTECTED]
scientific computing testing systems hobby: games. check http://mashebali.com/?Chess_2 -- http://mail.python.org/mailman/listinfo/python-list

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-07 Thread [EMAIL PROTECTED]
Thanks guys for all your posts... So I am a bit confusedFuzzy, the code I saw looks like it decompresses as a stream (i.e. per byte). Is this the case or are you just compressing for file storage but the actual data set has to be exploded in memory? fuzzylollipop wrote: > Fredrik Lundh wrote:

Select hangs after some reads

2006-06-07 Thread [EMAIL PROTECTED]
Hi, I'm building a multithreaded application and I encountered a tiny and annoying problem. I use a select to wait for data to be read from a socket, after some reads, the select simply blocks and stays that way until I close the connection on the other side of the socket. When the socket is close

<    12   13   14   15   16   17   18   19   20   21   >