getting output from a command into a list to work with

2007-05-20 Thread Anthony Irwin
Hi All, I would like to run the command below and have each line from the output stored as an element in a list. find /some/path/ -maxdepth 1 -type f -size +10k -exec ls -1 '{}' \ The reason for this is so I can then work on each file in the following manner var = command for i in var:

Re: A few questions

2007-05-20 Thread John Nagle
jay wrote: > Hi, > > I'm totally new to Python and was hoping someone might be able to > answer a few questions for me: > > 1. What are your views about Python vs Perl? Do you see one as better > than the other? Python is a much cleaner language than Perl, but not as widely used. The

Re: Unable to strip \n characters

2007-05-20 Thread Asun Friere
On May 20, 10:49 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > On May 20, 2007, at 7:41 AM, Michael Bentley wrote: > > > (upload.strip()) > > Oops: (upload.strip(),) or upload.strip() Superfluous though the braces around your original were, it should still run ... ie. (a) == a -- http://mail.

EUROPYTHON: Talk submission deadline extended up to Friday, 25th of May

2007-05-20 Thread GHUM
We took longer then planned to open the registration. Some potential speakers came in late. To make it even, we extended talk submission deadline for ONE WEEK. New deadline is Friday, 25th of May 2007. So, if you made a fortune with Python: tell others about it at EuroPython. If you have a gre

Re: What is deployment?

2007-05-20 Thread Paul Rubin
Maria R <[EMAIL PROTECTED]> writes: > I would suggest a somewhat more limited view. > That is, deployment is the process after development is finished (or > the product system is purchased) up until it is in full operation > (including establishing support organisation etc). > The exact point of ti

Re: What is deployment?

2007-05-20 Thread Maria R
On May 20, 7:28 am, Paul Rubin wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > > Agreed. I usually discuss "deployment" as meaning "everything required > > to take something from the point of working in a vendor's lab > > environment, to an actual working installation i

Re: A few questions

2007-05-20 Thread Alex Martelli
jay <[EMAIL PROTECTED]> wrote: > Hi, > > I'm totally new to Python and was hoping someone might be able to > answer a few questions for me: > > 1. What are your views about Python vs Perl? Do you see one as > better than the other? Yep: if I didn't find Python more readable, maintainable

Re: trouble with pyvtk

2007-05-20 Thread LokiDawg
On May 18, 12:41 am, [EMAIL PROTECTED] wrote: > > This could be very well be a bug where infinite recursion happens, but > see if changing the recursion limit fixes this: > >>> import sys > >>> sys.getrecursionlimit() > 1000 > >>> sys.setrecursionlimit(1) > Regards, > Ondrej Thanks for the tip,

Re: [IronPython] [ANN] IronPython Community Edition r6

2007-05-20 Thread M. David Peterson
Nice! > http://www.oreillynet.com/windows/blog/2007/05/seo_sanghyeonipce_ironpython_c_2.html On 5/20/07, Sanghyeon Seo <[EMAIL PROTECTED]> wrote: This is the sixth release of IronPython Community Edition (IPCE). Download from SourceForge: http://sourceforge.net/projects/fepy FePy project aim

Re: A few questions

2007-05-20 Thread Anthony Irwin
jay wrote: > Hi, > > I'm totally new to Python and was hoping someone might be able to answer > a few questions for me: > > 1. What are your views about Python vs Perl? Do you see one as better > than the other? I have written some scripts in both perl and python and to me python feels more

Re: Python assignment loop

2007-05-20 Thread Silver Rock
On 20 May 2007 20:21:52 -0700, George Sakkis <[EMAIL PROTECTED]> wrote: > On May 20, 10:33 pm, "Silver Rock" <[EMAIL PROTECTED]> wrote: > > i need to do something like this: > > > > ### > > import wx > > x=number > > for i in range(500): > >"var"+str(i)=ClassXYZ(...,x+i,...) > > > > # code

Re: Getting the member of a singleton set

2007-05-20 Thread Arnaud Delobelle
On May 21, 12:52 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: [...] > Yes, something like peek() or any() would be useful. But you're not > restricted by the builtin methods, you could write your own: > > def peek(iterable): >return iter(iterable).next() Yes, but that's not getting rid

A few questions

2007-05-20 Thread jay
Hi, I'm totally new to Python and was hoping someone might be able to answer a few questions for me: 1. What are your views about Python vs Perl? Do you see one as better than the other? 2. Is there a good book to start with while learning Python? I'm currently reading 'Python Essentia

Re: Cycle detection and object memory usage?

2007-05-20 Thread John Nagle
Jim Kleckner wrote: > cycles: > > I understand from the documentation that types with a finalizer method > that participate in cycles can't be collected. > > What is the best way to go about finding these cycles? > Googling gives a variety of methods none of which seem terribly > mainstream for

Re: List Moderator

2007-05-20 Thread Klaus Alexander Seistrup
Grant Edwards wrote: > Maybe I've got a beter news server, but I don't see much > spam at all in c.l.p. Neither do I. Cheers, -- Klaus Alexander Seistrup http://klaus.seistrup.dk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: List Moderator

2007-05-20 Thread Grant Edwards
On 2007-05-20, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> It doesn't all go through a central point - users like me who use a news >> server to access the list submit articles through a local news server >> using NNTP. While there *is* a single point of access for articles >> pulled from p

Re: Python assignment loop

2007-05-20 Thread George Sakkis
On May 20, 10:33 pm, "Silver Rock" <[EMAIL PROTECTED]> wrote: > i need to do something like this: > > ### > import wx > x=number > for i in range(500): >"var"+str(i)=ClassXYZ(...,x+i,...) > > # code > y=number > for i in range(y): >Class(object_called_by_the_string("var"+str(i)),...

Cycle detection and object memory usage?

2007-05-20 Thread Jim Kleckner
cycles: I understand from the documentation that types with a finalizer method that participate in cycles can't be collected. What is the best way to go about finding these cycles? Googling gives a variety of methods none of which seem terribly mainstream for such a common problem. Object mem

Re: Newbie Question: python mysqldb performance question

2007-05-20 Thread John Nagle
cjl wrote: > Group: > > I'm new to python and new to mysql. > > I have a csv file that is about 200,000 rows that I want to add to a > mysql database. Yes, I know that I can do this directly from the > mysql command line, but I am doing it through a python script so that > I can munge the data b

Python assignment loop

2007-05-20 Thread Silver Rock
i need to do something like this: ### import wx x=number for i in range(500): "var"+str(i)=ClassXYZ(...,x+i,...) # code y=number for i in range(y): Class(object_called_by_the_string("var"+str(i)),...) ### i can't figure out how to do this, and could not find it on the web. c. -- h

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread George Sakkis
On May 18, 7:07 pm, py_genetic <[EMAIL PROTECTED]> wrote: > Hello, > > I'm importing large text files of data using csv. I would like to add > some more auto sensing abilities. I'm considing sampling the data > file and doing some fuzzy logic scoring on the attributes (colls in a > data base/ cs

Re: Newbie Question: python mysqldb performance question

2007-05-20 Thread rurpy
On May 20, 5:55 pm, cjl <[EMAIL PROTECTED]> wrote: ...snip... > conn = MySQLdb.connect(db="database", host="localhost", user="root", > passwd="password") > c = conn.cursor() > > reader = csv.reader(open(sys.argv[1])) > for row in reader: > data1, data2, data3, data4 = row > data = (data1,da

Re: list modification subclassing

2007-05-20 Thread AchatesAVC
On May 20, 8:55 pm, manstey <[EMAIL PROTECTED]> wrote: > Hi, > > I have a simple subclass of a list: > > class CaListOfObj(list): > """ subclass of list """ > def __init__(self, *args, **kwargs): > list.__init__(self, *args, **kwargs) > > a= CaListOfObj([1,2,3]) > > How do I write a

Re: Inverse of id()?

2007-05-20 Thread Ian Clark
On 5/20/07, Michael Hoffman <[EMAIL PROTECTED]> wrote: > [snip] > That's not what I get: > > Python 2.5 (r25:51908, Mar 13 2007, 08:13:14) > [GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin > Type "help", "copyright", "credits" or "license" for more information. > >>> class A: p

list modification subclassing

2007-05-20 Thread manstey
Hi, I have a simple subclass of a list: class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self, *args, **kwargs) a= CaListOfObj([1,2,3]) How do I write a method that does something EVERY time a is modified? Thanks -- http://m

subclassing list question

2007-05-20 Thread manstey
test -- http://mail.python.org/mailman/listinfo/python-list

subclassing list question

2007-05-20 Thread manstey
Hi, I have a simple class that subclasses a list: class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self, *args, **kwargs) a= CaListOfObj([1,2,3]) Is it possible to have a method in the class that is called EVERY time a is modif

subclassing list question

2007-05-20 Thread manstey
Hi, I have a simple class that subclasses list: class CaListOfObj(list): """ subclass of list """ def __init__(self, *args, **kwargs): list.__init__(self, *args, **kwargs) a = CaListOfObj([1,2,3]) I want an instance method to be run EVERY time a is modified. Is this possible? T

Re: Inverse of id()?

2007-05-20 Thread Michael Hoffman
Gabriel Genellina wrote: > En Sat, 19 May 2007 20:42:53 -0300, Paul McGuire <[EMAIL PROTECTED]> > escribió: > > z = id(results) > for x in globals().values(): >> ... if id(x)==z: break >> ... >> >> This gives me a variable x that is indeed another ref to the results >> variable: > x

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-20 Thread Rico
On May 16, 2:04 pm, Victor Kryukov <[EMAIL PROTECTED]> wrote: > Hello list, > > our team is going to rewrite our existing web-site, which has a lot of > dynamic content and was quickly prototyped some time ago. > > Today, as we get better idea of what we need, we're going to re-write > everything f

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-20 Thread Michael Bayer
On May 16, 5:04 pm, Victor Kryukov <[EMAIL PROTECTED]> wrote: > > Our main requirement for tools we're going to use is rock-solid > stability. As one of our team-members puts it, "We want to use tools > that are stable, has many developer-years and thousands of user-years > behind them, and that we

Newbie Question: python mysqldb performance question

2007-05-20 Thread cjl
Group: I'm new to python and new to mysql. I have a csv file that is about 200,000 rows that I want to add to a mysql database. Yes, I know that I can do this directly from the mysql command line, but I am doing it through a python script so that I can munge the data before adding it. I have th

Re: docs patch: dicts and sets

2007-05-20 Thread rurpy
On May 20, 3:12 am, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On May 13, 4:52 pm, [EMAIL PROTECTED] wrote: > > Dismissing this as not a "real problem" is both wrong > > and offensive to people taking the time to actually > > propose improvements. > > I should have elaborated on what I meant by

Re: Getting the member of a singleton set

2007-05-20 Thread Gabriel Genellina
En Sun, 20 May 2007 17:27:20 -0300, Arnaud Delobelle <[EMAIL PROTECTED]> escribió: > Hi all, > > I often find myself needing to get (non-destructively) the value of > the member of a singleton set. Is there a good way to do this (as an > expression?) None of the ones I can think of satisfy me,

Re: python shell

2007-05-20 Thread JussiJ
On May 17, 3:38 am, Krypto <[EMAIL PROTECTED]> wrote: > My mentor told me that you can virtually do anything from > testing your program to anything in the shell. Any incite > would be useful. Using something like tee you can run the Python script in the shell and also capture it's output: h

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-20 Thread rurpy
On May 17, 5:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 16, 6:38 pm, [EMAIL PROTECTED] wrote: > > Are you worried that some 3rd-party package you have > > included in your software will have some non-ascii identifiers > > buried in it somewhere? Surely that is easy to check for

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread John Machin
On May 21, 2:04 am, Paddy <[EMAIL PROTECTED]> wrote: > On May 20, 1:12 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On 20/05/2007 8:52 PM, Paddy wrote: > > > > On May 20, 2:16 am, John Machin <[EMAIL PROTECTED]> wrote: > > >> On 19/05/2007 3:14 PM, Paddy wrote: > > > >>> On May 19, 12:07 am

Re: pyExcelerator bug?

2007-05-20 Thread John Machin
On 21/05/2007 7:01 AM, Waldemar Osuch wrote: > On May 16, 4:42 pm, [EMAIL PROTECTED] wrote: >> My program creates three lists: the first has dates expressed as >> strings, the second has floats that are strictly positive, and the >> third has floats that are strictly negative. I have no trouble wri

Re: Translating some Java to Python

2007-05-20 Thread Daniel Gee
Alright, sounds good. I'm just not as familiar with the preferred designs of python. As to wanting to have them in a class, sometimes I do. Persisting a roll in a class is only for the slightly more complicated rolls such as 3d6+5d4-1d12 or "4d6 (drop the lowest and re-roll ones)", things of that

Components for a client/server architecture

2007-05-20 Thread Samuel
Hi, I am looking for some recommendations for client/server technologies and for the communication involved. I am currently planning to port a Perl application that has grown out of proportion to another language and architecture. For this purpose, I am investigating technologies that best fit

ANN: EasyExtend 2.0 - beta1

2007-05-20 Thread Kay Schluehr
Hi Pythonistas, EasyExtend is a grammar based preprocessor generator, code analysis and synthesis framework and metaprogramming system for Python written in Python. This is the first beta of EE 2.0. As always some novelties are implemented. This time it is Console Test an ultralightweight test fa

Re: pyExcelerator bug?

2007-05-20 Thread Waldemar Osuch
On May 16, 4:42 pm, [EMAIL PROTECTED] wrote: > My program creates three lists: the first has dates expressed as > strings, the second has floats that are strictly positive, and the > third has floats that are strictly negative. I have no trouble writing > the data in these lists to a .csv file usin

Re: python shell

2007-05-20 Thread Steve Holden
Douglas Woodrow wrote: > On Sat, 19 May 2007 21:42:27, Steve Holden <[EMAIL PROTECTED]> wrote > >> http://en.wikipedia.org/wiki/Doctest > >> Since you claim to be exercising your pedantry, I wonder why I get the >> results I do. Since we *are* being pedantic, by the way, surely the >> name is

Re: Translating some Java to Python

2007-05-20 Thread Arnaud Delobelle
On May 20, 9:24 pm, Daniel Gee <[EMAIL PROTECTED]> wrote: > A while ago I wrote a class in Java for all kinds of dice rolling > methods, as many sides as you want, as many dice as you want, only > count values above or below some number in the total, things like > that. Now I'm writing a project in

Re: List Moderator

2007-05-20 Thread Steve Holden
Dotan Cohen wrote: > On 19/05/07, Steve Holden <[EMAIL PROTECTED]> wrote: [...] >> The Python list managers know what they are doing, and they *do* keep a >> huge amount of spam off the list. The occasional piece gets through, but >> this is Usenet. It will, from time to time. >> > > Again, I appr

Getting the member of a singleton set

2007-05-20 Thread Arnaud Delobelle
Hi all, I often find myself needing to get (non-destructively) the value of the member of a singleton set. Is there a good way to do this (as an expression?) None of the ones I can think of satisfy me, eg: * list(myset)[0] * iter(myset).next() * set(myset).pop() What I would like is something

Translating some Java to Python

2007-05-20 Thread Daniel Gee
A while ago I wrote a class in Java for all kinds of dice rolling methods, as many sides as you want, as many dice as you want, only count values above or below some number in the total, things like that. Now I'm writing a project in Python that needs to be able to make use of that kind of a class.

Re: Python compared to other language

2007-05-20 Thread Bruno Desthuilliers
walterbyrd a écrit : > On May 18, 10:24 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > > >>I think that Ruby, which roughly speaking sits somewhere between Python >>and Perl, is closer to Python than Perl is. > > > I don't know much about Ruby, but it does not seem to be commonly used > for any

Re: List Moderator

2007-05-20 Thread Dotan Cohen
On 19/05/07, Steve Holden <[EMAIL PROTECTED]> wrote: > Dotan Cohen wrote: > > On 19/05/07, Steve Holden <[EMAIL PROTECTED]> wrote: > >> I'm sorry, but you have no idea what you are talking about. Most of what > >> can be done *is* being done, which is why you see the relatively low > >> spam volume

Re: model browser

2007-05-20 Thread Daniel Nogradi
And before you ask, yes, I did read http://mail.python.org/pipermail/python-list/2007-May/440337.html but there was nothing beyond django/tg :) -- http://mail.python.org/mailman/listinfo/python-list

Re: TIFF to PDF

2007-05-20 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, revuesbio wrote: > I'm looking for : > 1/ the best method to convert tiff files to PDF. > 2/ and I want to merge these pdf files. If it doesn't need to be done in pure Python I would use the command line tools from libtiff: `tiffcp` to copy several tiffs into one multipage

Re: How to do basic CRUD apps with Python

2007-05-20 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > > Sounds like you're talking about rails. Do any of the python packages > compare with the ease of rails? Turbogears, Django and Pylons. -- http://mail.python.org/mailman/listinfo/python-list

Re: docs patch: dicts and sets

2007-05-20 Thread Alan Isaac
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Another way to put it is that the docs are sufficient > when they say that set ordering is arbitrary. That should be a cue to > not have *any* expectations about the internal ordering of sets and > dicts. You are us

TIFF to PDF

2007-05-20 Thread revuesbio
Hello, I'm looking for : 1/ the best method to convert tiff files to PDF. 2/ and I want to merge these pdf files. thank you for your help -- http://mail.python.org/mailman/listinfo/python-list

model browser

2007-05-20 Thread Daniel Nogradi
Hi list, I'm looking for an sqlobject based model browser with a web interface (is this the thing called CRUD these days?). Searching all over the place turned up of course django's automatic admin interface and turbogears' catwalk but I wouldn't want to buy into any of these two frameworks becaus

Re: Python compared to other language

2007-05-20 Thread Martin v. Löwis
> PHP was definitely born _for_ webpages; Ruby wasn't, just like Perl or > Python weren't, it just became very popular for webpages when Rails > appeared. In this kind of discussion, I get always reminded that Perl stands for "Practical Extraction and Report Language". So Perl _clearly_ is for gen

Re: Inverse of id()?

2007-05-20 Thread Gabriel Genellina
En Sat, 19 May 2007 20:42:53 -0300, Paul McGuire <[EMAIL PROTECTED]> escribió: z = id(results) for x in globals().values(): > ... if id(x)==z: break > ... > > This gives me a variable x that is indeed another ref to the results > variable: x is results > True x.x > 123 > >

Re: Python Web Programming - looking for examples of solid high-traffic sites

2007-05-20 Thread Bruno Desthuilliers
John Nagle a écrit : > Bruno Desthuilliers wrote: > >> John Nagle a écrit : >> >>> Victor Kryukov wrote: >>> Hello list, our team is going to rewrite our existing web-site, which has a lot of dynamic content and was quickly prototyped some time ago. >>> >>> >>> ... >>> Our

Re: _PyObject_New / PyObject_Init / PyInstance_New / etc?

2007-05-20 Thread Gre7g Luterman
> From Python, you create a Noddy object by *calling* its type. Do the same > in C: > > return PyObject_CallObject((PyObject *) &NoddyType, NULL); > > Or any other suitable variant of PyObject_CallXXX. (I've answered this > same question yesterday, when I was not sure about this; then I've tried

Re: Many-to-many pattern possiable?

2007-05-20 Thread Bruno Desthuilliers
Jia Lu a écrit : > Hi all > > I see dict type can do 1-to-1 pattern, But is there any method to do > 1-to-many, a dict of lists > many-to-1 What's the difference with 1-n ? > and many-to-many pattern ? As usual, using an intermediate dict. > What about using some > Serialized objects? What

Re: Python compared to other language

2007-05-20 Thread Martin v. Löwis
>> But that is my point. With Python, the language itself takes care of >> the platform differences, so the same Python code will run on >> different platforms. I realize that, at a lower level, everything is >> done is C. But, from the developers point of view: developing code in >> C requires mor

[ANN] IronPython Community Edition r6

2007-05-20 Thread Sanghyeon Seo
This is the sixth release of IronPython Community Edition (IPCE). Download from SourceForge: http://sourceforge.net/projects/fepy FePy project aims to provide enhancements and add-ons for IronPython. http://fepy.sourceforge.net/ This release is built with Mono 1.2.3.1. As this release has droppe

Re: zipfile [module and file format, both] stupidly broken

2007-05-20 Thread Thorsten Kampe
* Paul Boddie (20 May 2007 08:36:18 -0700) > Thorsten Kampe wrote: > > Don't be silly. Where would you look for the URL to report bugs? On > > the website of the project, of course. It's not that easy to find on > > python.org (although not as hard as Martin says): > > > > Core Development > Links

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread Paddy
On May 20, 1:12 pm, John Machin <[EMAIL PROTECTED]> wrote: > On 20/05/2007 8:52 PM, Paddy wrote: > > > > > On May 20, 2:16 am, John Machin <[EMAIL PROTECTED]> wrote: > >> On 19/05/2007 3:14 PM, Paddy wrote: > > >>> On May 19, 12:07 am, py_genetic <[EMAIL PROTECTED]> wrote: > Hello, > I'm

Re: zipfile [module and file format, both] stupidly broken

2007-05-20 Thread Paul Boddie
Thorsten Kampe wrote: > > Don't be silly. Where would you look for the URL to report bugs? On > the website of the project, of course. It's not that easy to find on > python.org (although not as hard as Martin says): > > Core Development > Links for Developers > Bug Manager or This is the "in crow

Re: Path python versions and Macosx

2007-05-20 Thread andrea
On 14 Mag, 23:00, [EMAIL PROTECTED] wrote: > On May 14, 4:46 am, andrea <[EMAIL PROTECTED]> wrote: > > > > > On 12 Mag, 01:09, [EMAIL PROTECTED] wrote: > > > > On May 11, 1:36 pm, andrea <[EMAIL PROTECTED]> wrote: > > > > > Hi everyone, > > > > I use python on macosx with textmate as editor (great

Re: zipfile [module and file format, both] stupidly broken

2007-05-20 Thread Thorsten Kampe
* Gabriel Genellina (Sat, 19 May 2007 18:09:06 -0300) > En Sat, 19 May 2007 14:00:01 -0300, Martin Maney <[EMAIL PROTECTED]> > escribió: > > BTW, thanks for the pointer someone else gave to the proper place for > > posting bugs. I'd had the silly idea that I would be able to find that > > easily

Re: questions about programming styles

2007-05-20 Thread Arvind Singh
On 5/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > which is the better way to calculate the value of attributes of a class ? > for example: > > (A) > def cal_attr(self, args): > #do some calculations > self.attr = calculated_value > and then if the vlue of attribute is

Re: zipfile stupidly broken

2007-05-20 Thread Thorsten Kampe
* Gabriel Genellina (Wed, 16 May 2007 16:38:39 -0300) > En Wed, 16 May 2007 12:18:35 -0300, Martin Maney <[EMAIL PROTECTED]> > escribió: > > So the author knows that there's a hard limit of 64K on the comment > > size, but feels it's more important to fail a little more quickly when > > fed somet

Re: Can't embed python in C++(Mingw[3.*] compiler)

2007-05-20 Thread sturlamolden
On May 19, 6:14 pm, Arjun Narayanan <[EMAIL PROTECTED]> wrote: > For thr program, > #include "E:\Python25\include\Python.h" Consider using #include "E:/Python25/include/Python.h" or #include "E:\\Python25\\include\\Python.h" instead. Or use #include and compile with -IE:/Python25/include

Re: Unable to strip \n characters

2007-05-20 Thread Michael Bentley
On May 20, 2007, at 7:41 AM, Michael Bentley wrote: > (upload.strip()) Oops: (upload.strip(),) or upload.strip() -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to strip \n characters

2007-05-20 Thread Michael Bentley
On May 20, 2007, at 5:50 AM, aiwarrior wrote: > files = f.readlines() >for upload in files: > upload.strip("\n") > final_args = "./rsapiresume.pl %s prem user password" % (upload) > print upload > #os.system( final_args ) for upload in f: final_args = "./rsapiresu

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread John Machin
On 20/05/2007 8:52 PM, Paddy wrote: > On May 20, 2:16 am, John Machin <[EMAIL PROTECTED]> wrote: >> On 19/05/2007 3:14 PM, Paddy wrote: >> >> >> >>> On May 19, 12:07 am, py_genetic <[EMAIL PROTECTED]> wrote: Hello, I'm importing large text files of data using csv. I would like to add >>>

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
John Machin wrote: > The model would have to be a lot more complicated than that. There is a > base number of required columns. The kind suppliers of the data randomly > add extra columns, randomly permute the order in which the columns > appear, and, for date columns I'm going to ignore this b

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread Paddy
On May 20, 2:16 am, John Machin <[EMAIL PROTECTED]> wrote: > On 19/05/2007 3:14 PM, Paddy wrote: > > > > > On May 19, 12:07 am, py_genetic <[EMAIL PROTECTED]> wrote: > >> Hello, > > >> I'm importing large text files of data using csv. I would like to add > >> some more auto sensing abilities. I'm

Re: Unable to strip \n characters

2007-05-20 Thread Peter Otten
aiwarrior wrote: > Im writing a personal wrapper to the perl script offered by > rapidshare, so that im able to use multiple files and glob pathnames, > but im using a file so i can track and resume any uploading data. The > problem is the lines come with a \n character that im not bein able to >

Custom Software Development

2007-05-20 Thread VB
iTechArt Group - Custom Software Development and Offshore outsourcing Company http://www.itechart.com/ Offshore custom software development company iTechArt - Web site and Content Management Solutions development, CMS consulting: Ektron, Drupal and DotNetNuke iTechArt Group provides high quality

Re: python shell/Intermediate Python tools.

2007-05-20 Thread Paddy
On May 20, 1:56 am, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>,Paddy <[EMAIL PROTECTED]> wrote: > >On May 16, 6:38 pm, Krypto <[EMAIL PROTECTED]> wrote: > >> I have been using python shell to test small parts of the big program. > >> What other ways can I use the she

Re: Can't embed python in C++(Mingw[3.*] compiler)

2007-05-20 Thread Michael Hoffman
Arjun Narayanan wrote: > That AND I didn't use the american spelling Py_Initiali >>> Z <<< e(); Like many words ending in -ize/-ise, initialize is listed with what you call the "American" spelling in the Oxford English Dictionary. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/p

Unable to strip \n characters

2007-05-20 Thread aiwarrior
Hi Im writing a personal wrapper to the perl script offered by rapidshare, so that im able to use multiple files and glob pathnames, but im using a file so i can track and resume any uploading data. The problem is the lines come with a \n character that im not bein able to take out, files

Re: questions about programming styles

2007-05-20 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > (1) > which is the better way to calculate the value of attributes of a class ? > for example: > > (A) >def cal_attr(self, args): >#do some calculations >self.attr = calculated_value > and then if the vlue of attribute is needed, >self.cal_attr(a

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
John Machin wrote: > So, all in all, Bayesian inference doesn't seem much use in this scenario. This is equivalent to saying that any statistical analysis doesn't seem much use in this scenario--but you go ahead and use statistics anyway? -- http://mail.python.org/mailman/listinfo/python-list

Re: questions about programming styles

2007-05-20 Thread Ben C
On 2007-05-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all, I'm not skilled at programming, so sorry for my ignorance. > My questions: > > (1) > which is the better way to calculate the value of attributes of a class ? > for example: > > (A) > def cal_attr(self, args): > #do

Re: Typed named groups in regular expression

2007-05-20 Thread Paddy
On May 20, 2:27 am, "Hugo Ferreira" <[EMAIL PROTECTED]> wrote: > Both Paddy (hackish) and McGuire (right tool for the job) ideas sound > very interesting ;-) I'll definitely research on them further. > > Thanks for the support... Hackis, hackISH! Sir, I would have you know that the idea proffered

Re: questions about programming styles

2007-05-20 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Hi all, I'm not skilled at programming, so sorry for my ignorance. ?! Seems you met many not-so-nice programmers. > (1) > which is the better way to calculate the value of attributes of a > class ? for example: > > (A) > def cal_attr(self, args): > #do s

Re: Closing socket file descriptors

2007-05-20 Thread js
Hi Yang. > Hi, thanks for your answer. Should I just use that object's close() > method? Is it safe to assume that objects that have fileno() also have > close()? (Statically typed interfaces would come in handy now.) > I'm writing a simple asynchronous I/O framework (for learning purposes - > I'm

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-20 Thread Christophe Cavalaria
Istvan Albert wrote: > On May 19, 3:33 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> >That would be invalid syntax since the third line is an assignment >> > with target identifiers separated only by spaces. >> >> Plus, the identifier starts with a number (even though 6 is not DIGIT >

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread John Machin
On 20/05/2007 5:47 PM, James Stroud wrote: > John Machin wrote: >> Against that background, please explain to me how I can use "results >> from previous tables as priors". >> >> Cheers, >> John > > It depends on how you want to model your probabilities, but, as an > example, you might find the f

questions about programming styles

2007-05-20 Thread [EMAIL PROTECTED]
Hi all, I'm not skilled at programming, so sorry for my ignorance. My questions: (1) which is the better way to calculate the value of attributes of a class ? for example: (A) def cal_attr(self, args): #do some calculations self.attr = calculated_value and then if the vlue of

Re: docs patch: dicts and sets

2007-05-20 Thread Raymond Hettinger
On May 13, 4:52 pm, [EMAIL PROTECTED] wrote: > Dismissing this as not a "real problem" is both wrong > and offensive to people taking the time to actually > propose improvements. I should have elaborated on what I meant by saying that there is not a real problem. Another way to put it is that the

Re: docs patch: dicts and sets

2007-05-20 Thread thinkogram
On May 19, 8:06 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Seems to me that you're focusing on the wrong part of the docs. The > source of this "bug" is not sets or dicts, Seems to me, this thread has lost touch with reality. There is no bug, just a quest to make some random change to docs

Re: Closing socket file descriptors

2007-05-20 Thread Yang
Hi, thanks for your answer. Should I just use that object's close() method? Is it safe to assume that objects that have fileno() also have close()? (Statically typed interfaces would come in handy now.) I'm writing a simple asynchronous I/O framework (for learning purposes - I'm aware of the my

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
James Stroud wrote: > Now with one test positive for Int, you are getting pretty certain you > have an Int column. Now we take a second cell randomly from the same > column and find that it too casts to Int. > > P_2(H) = 0.9607843--> Confidence its an Int column from round 1 > P(D|H) = 0.98

Re: python shell

2007-05-20 Thread Douglas Woodrow
On Sat, 19 May 2007 21:42:27, Steve Holden <[EMAIL PROTECTED]> wrote > http://en.wikipedia.org/wiki/Doctest >Since you claim to be exercising your pedantry, I wonder why I get the >results I do. Since we *are* being pedantic, by the way, surely the >name is actually "doctest", not "Doctest".

Re: converting strings to most their efficient types '1' --> 1, 'A' ---> 'A', '1.2'---> 1.2

2007-05-20 Thread James Stroud
John Machin wrote: >Against that background, please explain to me how I can use > "results from previous tables as priors". > > Cheers, > John It depends on how you want to model your probabilities, but, as an example, you might find the following frequencies of columns in all tables you have

Re: Closing socket file descriptors

2007-05-20 Thread js
Hello, Yang. You're not supposed to use os.open there. See the doc at http://docs.python.org/lib/os-fd-ops.html Is there any reason you want to use os.close? On 20 May 2007 04:26:12 GMT, Yang <[EMAIL PROTECTED]> wrote: > Hi, I'm experiencing a problem when trying to close the file descriptor > f