Re: TypeError: object.__init__() takes no parameters

2011-09-08 Thread Ben Finney
Oliver writes: > let me be honest with you, I am a poor programmer who can only do > Perl. I strongly suspect you could do more than that. Welcome to the Python discussion forum. > I tried to code a program in Perl, but found that another guy already > finished this job in Python. Unlucky for

Re: Python: Deleting specific words from a file.

2011-09-08 Thread Terry Reedy
On 9/8/2011 9:09 PM, papu wrote: Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","wo

TypeError: object.__init__() takes no parameters

2011-09-08 Thread Oliver
Hello together, let me be honest with you, I am a poor programmer who can only do Perl. I tried to code a program in Perl, but found that another guy already finished this job in Python. Unlucky for me, this guy is now CEO of a company, not really interested in supporting his old code. If I want

Re: Django or web2py

2011-09-08 Thread Vineet
On Sep 9, 3:29 am, Paul Watson wrote: > I have read some of the talk around these two frameworks. > > Would you say that web2py is more geared toward the enterprise? > > Which one do you believe will be on Python 3 more quickly? Both Django & web2py are good frameworks. I have tried both of them

wholesale all brand(UGGBOOTS, SHOES, CLOTHES, HANDBAG, WATCH, JEANS, JERSEY, T-SHIRT, SHIRTS, HOODY, EYEGLASS, CAP, SHAWL, WALLT) and so on.

2011-09-08 Thread amy
wholesale all brand shoes(NIKE,ADIDAS,LV,GUCCI,CHANEL,PRADA,POLO,UGG BOOTS,D&G,DIOR )and so on. paypal payment wholesale all brand clothing(T- SHIRT,JEANS,JERSEY,HOODIES,JACKETS,HARDY,SWEATER,SHIRTS )and so on . http://www.24hour-buy.com/ paypal payment all brand watch(ROLEX,OMEGA,CHANEL,LV,CARTIER

Re: Processing a file using multithreads

2011-09-08 Thread aspineux
On Sep 9, 12:49 am, Abhishek Pratap wrote: > Hi Guys > > My experience with python is 2 days and I am looking for a slick way > to use multi-threading to process a file. Here is what I would like to > do which is somewhat similar to MapReduce in concept. > > # test case > > 1. My input file is 10

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Chris Angelico
On Fri, Sep 9, 2011 at 1:20 PM, Simon Cropper wrote: > Chris, > > You assessment is correct. Working through the PyPI I am having better luck > with using different terms than the old-term 'sitemap'. > > I have found a link to funnelweb which uses the transmogrify library (yeah, > as if I would ha

Re: Python: Deleting specific words from a file.

2011-09-08 Thread John Gordon
In <30f9b718-bb3c-4c92-8a03-0f760c993...@a12g2000yqi.googlegroups.com> papu writes: > Hello, I have a data file (un-structed messy file) from which I have > to scrub specific list of words (delete words). > Here is what I am doing but with no result: > infile = "messy_data_file.txt" > outfile

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 12:59, Chris Angelico wrote: On Fri, Sep 9, 2011 at 12:43 PM, Simon Cropper wrote: At present I am definitely getting the impression that my assumption that something like this' must out there', is wrong. I have found a XML-Sitemaps Generator at http://www.xml-sitemaps.com, this p

buffer() as argument to ctypes function which expects c_void_p?

2011-09-08 Thread Jack Bates
How do you pass a Python buffer() value as an argument to a ctypes function, which expects a c_void_p argument? I keep getting TypeError: ctypes.ArgumentError: argument 2: : wrong type -- http://mail.python.org/mailman/listinfo/python-list

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Chris Angelico
On Fri, Sep 9, 2011 at 12:43 PM, Simon Cropper wrote: > At present I am definitely getting the impression that my assumption that > something like this' must out there', is wrong. > > I have found a XML-Sitemaps Generator at http://www.xml-sitemaps.com, > this page allows you to create the XML fil

Using web2py and deck.js to make HTML5 presentation

2011-09-08 Thread chinakr
web2py is one of the most popular Web Frameworks. web2py has MVC architecture, offering us excellent development efficiency and extensibility. web2py is very suitable for Web application development. deck.js is a JavaScript library for making HTML5 presentation. It supports keyboard navigation, th

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 12:14, Steven D'Aprano wrote: If you do decide to write your own, please consider uploading it to PyPI under a FOSS licence. At present I am definitely getting the impression that my assumption that something like this' must out there', is wrong. I am following people's links and

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Steven D'Aprano
Simon Cropper wrote: > Certainly doable but > considering the shear commonality of this task I don't understand why a > simple script does not already exist Perhaps it isn't as common or as simple as you believe. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Steven D'Aprano
Simon Cropper wrote: > 1. Being told to google-it when I explicitly stated in my initial post > that I had been doing this and had not been able to find anything is > just plain rude. It is unconstructive and irritating. Why so you did. Even though I wasn't the one who told you to google it, I'll

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 10:32, Rhodri James wrote: On Fri, 09 Sep 2011 00:40:42 +0100, Simon Cropper Ahem. You should expect a certain amount of ribbing after admitting that your Google-fu is weak. So is mine, but hey. I did not admit anything. I consider my ability to find this quite good actually. Othe

Re: How to structure packages

2011-09-08 Thread Chris Angelico
On Fri, Sep 9, 2011 at 10:45 AM, Nobody wrote: > The Java compiler also acts as a "make" program. If it doesn't find > a .class file for a needed class, it will search for the corresponding > .java file and compile that. So to compile a complex program, you only > need to compile the top-level fil

Re: Processing a file using multithreads

2011-09-08 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Abhishek Pratap wrote: Hi Guys My experience with python is 2 days and I am looking for a slick way to use multi-threading to process a file. Here is what I would like to do which is somewhat similar to MapReduce in concept. # test case 1. My input file is 10 GB. 2.

Re: Python: Deleting specific words from a file.

2011-09-08 Thread MRAB
On 09/09/2011 02:09, papu wrote: Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","wo

Python: Deleting specific words from a file.

2011-09-08 Thread papu
Hello, I have a data file (un-structed messy file) from which I have to scrub specific list of words (delete words). Here is what I am doing but with no result: infile = "messy_data_file.txt" outfile = "cleaned_file.txt" delete_list = ["word_1","word_2","word_n"] new_file = [] fin=open(infil

Re: How to structure packages

2011-09-08 Thread Nobody
On Thu, 08 Sep 2011 10:29:26 +1000, Steven D'Aprano wrote: > I suppose "one class per file" might be useful for those using an editor > with no search functionality. Other than that, is there any justification > for this rule? Any Java fans want to defend this? Not a Java fan, but: The Java comp

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Rhodri James
On Fri, 09 Sep 2011 00:40:42 +0100, Simon Cropper wrote: On 09/09/11 01:11, Steven D'Aprano wrote: [SNIP] It's no harder to put the search terms into a google URL, which still gets the point across without being a dick about it: > [SNIP] [RANT] OK I was not going to say anything but..

Re: Processing a file using multithreads

2011-09-08 Thread Gregory Ewing
Abhishek Pratap wrote: 3. Each file handle is processed in by an individual thread using the same function ( so total 10 cores are assumed to be available on the machine) Are you expecting the processing to be CPU bound or I/O bound? If it's I/O bound, multiple cores won't help you, and neith

Re: killing a script

2011-09-08 Thread Cameron Simpson
On 30Aug2011 14:13, Steven D'Aprano wrote: | On Tue, 30 Aug 2011 08:53 am Arnaud Delobelle wrote: | >> Yes, but if I am not mistaken, that will require me to put a line or | >> two after each os.system call. That's almost like whack-a-mole at the | >> code level rather than the Control-C level. O

Re: Create an index from a webpage [RANT, DNFTT]

2011-09-08 Thread Simon Cropper
On 09/09/11 01:11, Steven D'Aprano wrote: [SNIP] It's no harder to put the search terms into a google URL, which still gets the point across without being a dick about it: > [SNIP] [RANT] OK I was not going to say anything but... 1. Being told to google-it when I explicitly stated in my initi

Processing a file using multithreads

2011-09-08 Thread Abhishek Pratap
Hi Guys My experience with python is 2 days and I am looking for a slick way to use multi-threading to process a file. Here is what I would like to do which is somewhat similar to MapReduce in concept. # test case 1. My input file is 10 GB. 2. I want to open 10 file handles each handling 1 GB of

Re: Best way to check that you are at the beginning (the end) of an iterable?

2011-09-08 Thread Cameron Simpson
On 08Sep2011 14:21, Chris Torek wrote: | In article | Cameron Simpson wrote: | >Facilities like feof() in C and eof in Pascal already lead to lots of | >code that runs happily with flat files and behaves badly in interactive | >or piped input. It is _so_ easy to adopt a style like: | > | > whi

Django or web2py

2011-09-08 Thread Paul Watson
I have read some of the talk around these two frameworks. Would you say that web2py is more geared toward the enterprise? Which one do you believe will be on Python 3 more quickly? -- http://mail.python.org/mailman/listinfo/python-list

Re: replace random matches of regexp

2011-09-08 Thread gry
On Sep 8, 3:51 pm, gry wrote: To elaborate(always give example of desired output...) I would hope to get something like: SELECT public.max(PUBLIC.TT.I) AS SEL_0 FROM (SCHM.T RIGHT OUTER JOIN PUBLIC.TT ON (SCHM.T.I IS NULL)) WHERE (NOT(NOT((power(PUBLIC.TT.F, PUBLIC.TT.F) = cast(ceil(( SEL

Re: DRY and class variables

2011-09-08 Thread egbert
On Thu, Sep 08, 2011 at 12:22:33PM +0200, Thomas Jollans wrote: > You should be able to do this with a metaclass (almost certainly > overkill), or with a class decorator (Python 2.6+): > > def with_metadata (cls): > cls.m = Metadata (cls.__name__) > cls.m.do_something () > return cls >

Re: replace random matches of regexp

2011-09-08 Thread Peter Otten
gry wrote: > [Python 2.7] > I have a body of text (~1MB) that I need to modify. I need to look > for matches of a regular expression and replace a random selection of > those matches with a new string. There may be several matches on any > line, and a random selection of them should be replaced

Re: replace random matches of regexp

2011-09-08 Thread André Malo
* gry wrote: > I might want to replace '(max|min|cos|sqrt|ceil' with "public.\1", but > only with probability 0.7. I looked and looked for some computed > thing in re's that I could stick and expression, but could not find > such(for good reasons, I know). > Any ideas how to do this? I would go

Re: replace random matches of regexp

2011-09-08 Thread MRAB
On 08/09/2011 20:51, gry wrote: [Python 2.7] I have a body of text (~1MB) that I need to modify. I need to look for matches of a regular expression and replace a random selection of those matches with a new string. There may be several matches on any line, and a random selection of them should

Symposium “Experimental and Computational Bio-Imaging and Visualization” within ICEM15 – Announce & Call for Papers

2011-09-08 Thread tava...@fe.up.pt
Dear Colleague, Within the 15th International Conference on Experimental Mechanics (ICEM15), to be held in Faculty of Engineering, University of Porto, Porto, Portugal, in July 22-27, 2012, (www.fe.up.pt/clme/icem15/ index.htm), we are organizing a Symposium on “Experimental and Computational Bio-

replace random matches of regexp

2011-09-08 Thread gry
[Python 2.7] I have a body of text (~1MB) that I need to modify. I need to look for matches of a regular expression and replace a random selection of those matches with a new string. There may be several matches on any line, and a random selection of them should be replaced. The probability of

Re: DRY and class variables

2011-09-08 Thread Eric Snow
On Thu, Sep 8, 2011 at 3:55 AM, egbert wrote: > My classes correspond to sql tables. > In these classes I want to have several class variables > that refer to data that are common to all instances. > > The assignment statements for the class variables are the same > in all classes, except that of

Re: Portable locale usage

2011-09-08 Thread Siniša Šegvić
> From: "Laszlo Nagy" > To: "Siniša Šegvić" , python-list@python.org > Sent: Thursday, September 8, 2011 10:41:22 AM > Subject: Re: Portable locale usage > > I have set the system-wide locale to Croatian (Croatia) > > on my development system as instructed by: > > http://windows.microsoft.com/en-U

Re: my multi-download program can't finish

2011-09-08 Thread MRAB
On 08/09/2011 05:24, 守株待兔 wrote: here is the program, # basic structure,omit something import Queue import httplib2 import threading jobs = Queue.Queue() name=something #omit ,it is a web list to download for x in name: jobs.put(x) def download(): while not jobs.empty():

Re: Create an index from a webpage

2011-09-08 Thread Steven D'Aprano
Thomas 'PointedEars' Lahn wrote: > [climbs up on the soapbox and begins rant] Please don't use lmgtfy. The joke, such as it is, stopped being funny about three years ago. It's just annoying, and besides, it doesn't even work without Javascript. Kids today ha

Re: how to make fxn argument work with setting a field value

2011-09-08 Thread MRAB
On 08/09/2011 08:59, noydb wrote: The documentation mentions "getValue" and "setValue": http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00...- Hide quoted text - - Show quoted text - I have tried row.setValue(rankFld) = i for line 14. Get syntax error - cant assign to fun

Re: wrap the queue to multiprocess download

2011-09-08 Thread Chris Angelico
On Fri, Sep 9, 2011 at 12:12 AM, alias <1248283...@qq.com> wrote: >     def  __init__(self,arg): >     for  x  in  name: > >     s=webdata('quote') What you're doing here is iterating over the letters in the string 'quote'. It's adding one job for each letter. Is that your intention? ChrisA -

Re: Best way to check that you are at the beginning (the end) of an iterable?

2011-09-08 Thread Chris Torek
In article Cameron Simpson wrote: >Facilities like feof() in C and eof in Pascal already lead to lots of >code that runs happily with flat files and behaves badly in interactive >or piped input. It is _so_ easy to adopt a style like: > > while not eof(filehandle): >line = filehandle.nextlin

Re: Installing WebDAV server

2011-09-08 Thread Fokke Nauta
"Fokke Nauta" wrote in message news:9c4trjfcf...@mid.individual.net... > Hi all, > > I am completely new to Python, but I'm confronted with a problem I can't > solve. > This is my question: > > I'm running a PC with XP Pro32, which acts as a file server/print > server/FTP server and web server.

Re: [OT] Anyone here familiar with installing Open Watcom F77?

2011-09-08 Thread W. eWatson
On 9/5/2011 9:36 AM, Colin J. Williams wrote: On 05-Sep-11 12:22 PM, Dan Nagle wrote: Hello, On 2011-09-05 16:15:20 +, W. eWatson said: On 9/5/2011 8:24 AM, Chris Angelico wrote: On Tue, Sep 6, 2011 at 1:15 AM, W. eWatson wrote: See Subject. To what extent "familiar"? I have it ins

wrap the queue to multiprocess download

2011-09-08 Thread alias
here is my part of program,you can see main structure,i want to wrap it in class , class webdata(object): def __init__(self,arg): jobs = Queue.Queue() for x in name: jobs.put(self.url) def download(self): while not

Re: Installing WebDAV server

2011-09-08 Thread Fokke Nauta
"Piet van Oostrum" wrote in message news:m2mxefb8nd@cochabamba.vanoostrum.org... > "Fokke Nauta" writes: > >> "Piet van Oostrum" wrote in message >> news:m2zkigartn@cochabamba.vanoostrum.org... >>> "Fokke Nauta" writes: >>> >>> INFO:DAVServer.fshandler:get_data: d:\webdav not foun

Re: Create an index from a webpage

2011-09-08 Thread Thomas 'PointedEars' Lahn
Simon Cropper wrote: > I am after a way of pointing a python routine to my website and have it > create a tree, represented as a hierarchical HTML list in a webpage, of > all the pages in that website (recursive list of internal links to HTML > documents; ignore images, etc.). > > It is essential

Create an index from a webpage

2011-09-08 Thread Simon Cropper
Hi, I am getting dizzy on google. I am after a way of pointing a python routine to my website and have it create a tree, represented as a hierarchical HTML list in a webpage, of all the pages in that website (recursive list of internal links to HTML documents; ignore images, etc.). It is es

Re: lfun and such

2011-09-08 Thread Chris Angelico
On Thu, Sep 8, 2011 at 10:09 PM, Marc Dirix wrote: > scratch that. > > Silly me. > Heh. I'm curious now as to what was wrong, but am glad it's all working! I just switched back from my test run where I made a minimal class implementing `[]() and `[]=() to see if there was something weirdly wrong.

Re: Installing WebDAV server

2011-09-08 Thread Piet van Oostrum
"Fokke Nauta" writes: > "Piet van Oostrum" wrote in message > news:m2zkigartn@cochabamba.vanoostrum.org... >> "Fokke Nauta" writes: >> >> >>> INFO:DAVServer.fshandler:get_data: d:\webdav not found >>> XXX --- [07/Sep/2011 11:57:48] - Mozilla/5.0 UJindows NT 5.1; rv:6.0.1> >>> Gecko/ >>> 20

Re: Need help with simple OOP Python question

2011-09-08 Thread Piet van Oostrum
Terry Reedy writes: > Indexing objects by their internal id is usually useless. obj.id is not the internal id. -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4] -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] relaxing keyword usage restrictions

2011-09-08 Thread Adam Jorgensen
About the only keyword I can think of this being even slightly useful for would be class and even then I think that clazz is a pretty acceptable substitute. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to structure packages

2011-09-08 Thread Jonathan Hartley
On Thursday, September 8, 2011 1:29:26 AM UTC+1, Steven D'Aprano wrote: > Steven D'Aprano wrote: > > Other than that, is there any justification > for this rule? Any Java fans want to defend this? > > If "one class per file", why not "one method per class" too? Why is the > second rule any more si

Re: DRY and class variables

2011-09-08 Thread Thomas Jollans
On 08/09/11 11:55, egbert wrote: > My classes correspond to sql tables. > In these classes I want to have several class variables > that refer to data that are common to all instances. > > The assignment statements for the class variables are the same > in all classes, except that of these instruc

DRY and class variables

2011-09-08 Thread egbert
My classes correspond to sql tables. In these classes I want to have several class variables that refer to data that are common to all instances. The assignment statements for the class variables are the same in all classes, except that of these instructions needs the name of the class itself. Tha

Re: How to structure packages

2011-09-08 Thread Dan Sommers
On Thu, 08 Sep 2011 10:29:26 +1000, Steven D'Aprano wrote: > I suppose "one class per file" might be useful for those using an editor > with no search functionality. Other than that, is there any > justification for this rule? Any Java fans want to defend this? Back in the dark ages known as the

Re: Portable locale usage

2011-09-08 Thread Laszlo Nagy
I have set the system-wide locale to Croatian (Croatia) on my development system as instructed by: http://windows.microsoft.com/en-US/windows-vista/Change-the-system-locale Nevertheless, your proposal produces: ('English_United States','1252') This is what I see on my Hungarian Windows: C:\U

Re: how to make fxn argument work with setting a field value

2011-09-08 Thread noydb
> The documentation mentions "getValue" and "setValue": > > http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z00...- > Hide quoted text - > > - Show quoted text - I have tried row.setValue(rankFld) = i for line 14. Get syntax error - cant assign to function call -- http://mail.

回复: my multi-download program can't finish

2011-09-08 Thread 守株待兔
sometimes,the output is: error: [Errno 104] Connection reset by peer -- 原始邮件 -- 发件人: "Steven D'Aprano"; 发送时间: 2011年9月8日(星期四) 中午1:08 收件人: "python-list"; 主题: Re: my multi-download program can't finish On Thu, 8 Sep 2011 02:24 pm 守株待兔 wrote: [...] >