Re: UnicodeDecodeError issue

2013-08-30 Thread Chris Angelico
On Sat, Aug 31, 2013 at 4:41 PM, Ferrous Cranus wrote: > Suddenly my webiste superhost.gr running my main python script presents me > with this error: > > Code: > UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3\xf4\xef > \xfc\xed\xef\xec\xe1 \xf3\xf5\xf3\xf4\xde\xec\xe1\xf4\xef\xf2', 0, 1, > 'i

Re: Encapsulation unpythonic?

2013-08-30 Thread Marco Buttu
On 08/31/2013 08:07 AM, Fabrice Pombet wrote: well, look at that: a=(1,2) a=2+3 ->a is an object and I have changed its type and value from outside. No, `a` is not an object, so you did not change the type of any object. `a` is just a name (a label), that initially refers to the tuple (1, 2)

UnicodeDecodeError issue

2013-08-30 Thread Ferrous Cranus
Suddenly my webiste superhost.gr running my main python script presents me with this error: Code: UnicodeDecodeError('utf-8', b'\xb6\xe3\xed\xf9\xf3\xf4\xef \xfc\xed\xef\xec\xe1 \xf3\xf5\xf3\xf4\xde\xec\xe1\xf4\xef\xf2', 0, 1, 'invalid start byte') Does anyone know what this means? -- Web

Re: Encapsulation unpythonic?

2013-08-30 Thread Fabrice Pombet
On Saturday, August 31, 2013 4:35:39 AM UTC+2, Steven D'Aprano wrote: > On Fri, 30 Aug 2013 10:43:28 -0700, Fabrice Pombet wrote: > > > > > On Saturday, August 17, 2013 2:26:32 PM UTC+2, Fernando Saldanha wrote: > > > > >> 2) If it is in fact true that encapsulation is rarely used, how do I >

Re: semicolon at end of python's statements

2013-08-30 Thread Terry Reedy
On 8/30/2013 8:09 PM, Steven D'Aprano wrote: We really are spoiled for choice here. We can write any of these: # Option 1 for spam in sequence: if predicate(spam): process(spam) # Option 2 for spam in filter(predicate, sequence): process(spam) # Option 3 for spam in (spam f

Re: Encapsulation unpythonic?

2013-08-30 Thread Steven D'Aprano
On Fri, 30 Aug 2013 10:43:28 -0700, Fabrice Pombet wrote: > On Saturday, August 17, 2013 2:26:32 PM UTC+2, Fernando Saldanha wrote: >> 2) If it is in fact true that encapsulation is rarely used, how do I >> deal with the fact that other programmers can easily alter the values >> of members of my

Re: Interface and duck typing woes

2013-08-30 Thread Ned Batchelder
On 8/30/13 8:13 PM, Steven D'Aprano wrote: On Fri, 30 Aug 2013 06:35:47 -0400, Roy Smith wrote: In article <52200699$0$6599$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: These days, it would be relatively simple to implement pre- and post- condition checking using decorators,

Re: Using PyQT with QT Designer

2013-08-30 Thread tausciam
Lee Harr, thank you. I took your suggestion after I finished coding the audio section. You can see the improved project here: http://i.imgur.com/permuRQ.jpg On Friday, August 23, 2013 7:35:53 PM UTC-5, Lee Harr wrote: > > That's the problem though. It is exactly how I want it in designer. It's >

Re: python script to gather file links into textfile

2013-08-30 Thread Steven D'Aprano
On Fri, 30 Aug 2013 03:53:05 -0700, david.dsch wrote: > Hi, im looking for someone who can make a script that gathers all file > links from an url into a textfile, like this : > http://pastebin.com/jfD31r1x You've come to the right place! My rate is AUD$100 an hour. Contact me if you are interes

Re: Interface and duck typing woes

2013-08-30 Thread Steven D'Aprano
On Fri, 30 Aug 2013 06:35:47 -0400, Roy Smith wrote: > In article <52200699$0$6599$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> These days, it would be relatively simple to implement pre- and post- >> condition checking using decorators, and indeed one of the motivating >>

Re: semicolon at end of python's statements

2013-08-30 Thread Steven D'Aprano
On Fri, 30 Aug 2013 11:32:17 +0100, Fábio Santos wrote: > On 29 Aug 2013 23:20, "Ben Finney" wrote: >> >> Fábio Santos writes: >> >> > It is a shame that this is not possible in python. for..if exists in >> > comprehensions and not in regular loops but that would be nice >> > sometimes. >> >> So

Gunstar - Another python web framework.

2013-08-30 Thread Allisson Azevedo
It's a recent project, check this out: http://github.com/allisson/gunstar -- http://mail.python.org/mailman/listinfo/python-list

Re: Lettuce vs Behave

2013-08-30 Thread Ben Finney
jumpmanl...@myopera.com writes: > On Friday, August 16, 2013 1:15:01 PM UTC-4, cutems93 wrote: > > As professionals, what do you prefer and why? > > +1 for Behave And why? -- \ “In the long run, the utility of all non-Free software | `\ approaches zero. All non-Free softwar

Re: semicolon at end of python's statements

2013-08-30 Thread Chris Angelico
On Sat, Aug 31, 2013 at 12:14 AM, Antoon Pardon wrote: > Maybe python should just allow more than one control structure on one > line and then considers the end of the suite the end of both controls. > In that case we could just write the following: > > for a in lst: if a % 2: > treat a >

Re: subprocess.Popen instance hangs

2013-08-30 Thread Tim Johnson
* Jerry Hill [130830 07:48]: > On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote: > > The objective is to display all output, but to also separate error > > messages from normal output. > > I still think you want to use communicate(). Like this: > > p = subprocess.Popen(args,stderr=subpr

Re: subprocess.Popen instance hangs

2013-08-30 Thread Tim Johnson
* Nobody [130830 06:55]: > On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote: > > > ## This appears to be what works. > > def __exec(self,args) : > > """Run the process with arguments""" > >p = > >subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE)

Re: Encapsulation unpythonic?

2013-08-30 Thread Fabrice Pombet
On Saturday, August 17, 2013 2:26:32 PM UTC+2, Fernando Saldanha wrote: > I am new to Python, with experience in Java, C++ and R. > > > > As I understand encapsulation is not a big thing in the Python world. I read > that you can put two underscores before the name of a variable within a class

ANN: A new version (0.3.5) of python-gnupg has been released.

2013-08-30 Thread Vinay Sajip
A new version of the Python module which wraps GnuPG has been released. What Changed? = This is a minor enhancement and bug-fix release. See the project website ( http://code.google.com/p/python-gnupg/ ) for more information. Summary: Added improved shell quoting to guard against shel

Best practice for generalizing and documenting each method's behaviour

2013-08-30 Thread niubao56
I'm starting a small project coding in Python as I learn the ropes. As the project grows bigger, there are more and more overlapping and even redundant methods. For example, several classes have a checkAndClean_obj_state() method. If just one or two such classes, it is easy to analyze the behavi

RE: sax.handler.Contenthandler.__init__

2013-08-30 Thread Prasad, Ramit
Neil Cerutti wrote: > This code is from The Python Cookbook, 2nd edition, 12.2 Counting > Tags in a Document: > > from xml.sax.handler import ContentHandler > import xml.sax > class countHandler(ContentHandler): > def __init__(self): > self.tags={} > def startElement(self, name, at

Re: web2py - running on fedora

2013-08-30 Thread Joel Goldstick
On Fri, Aug 30, 2013 at 1:13 PM, bruce wrote: > Hi. > > I know this is a python list, but hoping that I can find someone to > help get a base install of web2py running. > > I've got an older version of fedora, running py 2.6.4 running apache v2.2 > > I'm simply trying to get web2py up/running, and

sax.handler.Contenthandler.__init__

2013-08-30 Thread Neil Cerutti
This code is from The Python Cookbook, 2nd edition, 12.2 Counting Tags in a Document: from xml.sax.handler import ContentHandler import xml.sax class countHandler(ContentHandler): def __init__(self): self.tags={} def startElement(self, name, attr): self.tags[name] = 1 + sel

web2py - running on fedora

2013-08-30 Thread bruce
Hi. I know this is a python list, but hoping that I can find someone to help get a base install of web2py running. I've got an older version of fedora, running py 2.6.4 running apache v2.2 I'm simply trying to get web2py up/running, and then to interface it with apache, so that the existing weba

Re: subprocess.Popen instance hangs

2013-08-30 Thread Jerry Hill
On Fri, Aug 30, 2013 at 11:32 AM, Tim Johnson wrote: > The objective is to display all output, but to also separate error > messages from normal output. I still think you want to use communicate(). Like this: p = subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE) output, e

Re: python script to gather file links into textfile

2013-08-30 Thread Joel Goldstick
David, actually, what is the url? I read about you a little and it looks like you are into music but not a software guy. You might be better off finding someone local to write the code for you. People here generally help people with actual coding problems, or discuss aspects of python, but if y

Python Weekend Challenge - $$

2013-08-30 Thread Michael Herman
https://gist.github.com/mjhea0/6390724 Check it out!:) Have a great labor day weekend. -- http://mail.python.org/mailman/listinfo/python-list

Re: python script to gather file links into textfile

2013-08-30 Thread Joel Goldstick
> >> On 2013-08-30, david.d...@gmail.com wrote: >>> >>> Hi, im looking for someone who can make a script that gathers >>> all file links from an url into a textfile, like this : >>> http://pastebin.com/jfD31r1x > Sometimes its good to look in the closets or under the beds. People forget what they

Re: subprocess.Popen instance hangs

2013-08-30 Thread Nobody
On Thu, 29 Aug 2013 17:00:21 -0800, Tim Johnson wrote: > ## This appears to be what works. > def __exec(self,args) : > """Run the process with arguments""" >p = >subprocess.Popen(args,stderr=subprocess.PIPE,stdout=subprocess.PIPE) >while 1 : >output

Re: Lettuce vs Behave

2013-08-30 Thread jumpmanlane
On Friday, August 16, 2013 1:15:01 PM UTC-4, cutems93 wrote: > I found that BDD is a very good philosophy for coding and checking my > program, and I decided to use either of these two software. However, it seems > these two are very similar in the way they function. As professionals, what > do

Re: semicolon at end of python's statements

2013-08-30 Thread Antoon Pardon
Op 30-08-13 12:53, Roy Smith schreef: > In article , > Fábio Santos wrote: > >> On 29 Aug 2013 23:20, "Ben Finney" wrote: >>> >>> Fábio Santos writes: >>> It is a shame that this is not possible in python. for..if exists in comprehensions and not in regular loops but that would be ni

صفحتنا على الفيس بوك اشترك الان اخباريه وترفيه وصور

2013-08-30 Thread 23alagmy
صفحتنا على الفيس بوك اشترك الان اخباريه وترفيه وصور https://www.facebook.com/pages/%D9%86%D8%AA%D8%A7%D8%A6%D8%AC-%D8%A7%D9%84%D8%A7%D9%85%D8%AA%D8%AD%D8%A7%D9%86%D8%A7%D8%AA-%D9%88%D8%A7%D9%84%D8%AC%D8%A7%D9%85%D8%B9%D8%A7%D8%AA-%D9%88%D8%A7%D8%AC%D8%AA%D9%85%D8%A7%D8%B9%D9%8A%D8%A7%D8%AA/2997191

Re: Question about XMLRPC

2013-08-30 Thread Ferrous Cranus
Στις 29/8/2013 6:30 μμ, ο/η Ferrous Cranus έγραψε: Στις 29/8/2013 3:35 μμ, ο/η Ferrous Cranus έγραψε: Στις 29/8/2013 2:54 μμ, ο/η Gregory Ewing έγραψε: i.she...@gmail.com wrote: I should write a python script(s) that listens to an existing XMLRPC service on my company's dev server. then i

Re: python script to gather file links into textfile

2013-08-30 Thread Bastien Amiel
Le 30/08/2013 15:01, Neil Cerutti a écrit : On 2013-08-30, david.d...@gmail.com wrote: Hi, im looking for someone who can make a script that gathers all file links from an url into a textfile, like this : http://pastebin.com/jfD31r1x 1. Read the file with urls http://stackoverflow.com/question

Re: python script to gather file links into textfile

2013-08-30 Thread Neil Cerutti
On 2013-08-30, david.d...@gmail.com wrote: > Hi, im looking for someone who can make a script that gathers > all file links from an url into a textfile, like this : > http://pastebin.com/jfD31r1x Michael Jackson advises you to start with the man in the mirror. -- Neil Cerutti -- http://mail.py

Re: How to keep cookies when making http requests (Python 2.7)

2013-08-30 Thread Luca Cerone
Thanks Dieter, > With respect to cookie handling, you do everything right. > > > > There may be other problems with the (wider) process. > > Analysing the responses of your requests (reading the status codes, > > the response headers and the response bodies) may provide hints > > towards th

Re: semicolon at end of python's statements

2013-08-30 Thread Roy Smith
In article , Fábio Santos wrote: > On 29 Aug 2013 23:20, "Ben Finney" wrote: > > > > Fábio Santos writes: > > > > > It is a shame that this is not possible in python. for..if exists in > > > comprehensions and not in regular loops but that would be nice > > > sometimes. > > > > So you use it i

python script to gather file links into textfile

2013-08-30 Thread david . dsch
Hi, im looking for someone who can make a script that gathers all file links from an url into a textfile, like this : http://pastebin.com/jfD31r1x -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface and duck typing woes

2013-08-30 Thread Roy Smith
In article <52200699$0$6599$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > These days, it would be relatively simple to implement pre- and post- > condition checking using decorators, and indeed one of the motivating use- > cases for function annotations in Python 3 is to allow su

Re: semicolon at end of python's statements

2013-08-30 Thread Fábio Santos
On 29 Aug 2013 23:20, "Ben Finney" wrote: > > Fábio Santos writes: > > > It is a shame that this is not possible in python. for..if exists in > > comprehensions and not in regular loops but that would be nice > > sometimes. > > So you use it in a generator expression, and iterate over the generat

Re: Is there a function that applies list of functions to a value?

2013-08-30 Thread Fabrice Pombet
On Friday, August 30, 2013 8:36:40 AM UTC+2, alex23 wrote: > On 30/08/2013 4:17 PM, fp2...@gmail.com wrote: > > > On Wednesday, August 28, 2013 8:50:53 PM UTC+2, Josh English wrote: > > >> def compose(*funcs): > > >> for func in funcs: > > >> if not callable(func): > > >>

Re: Is there a function that applies list of functions to a value?

2013-08-30 Thread Fabrice Pombet
On Friday, August 30, 2013 8:23:44 AM UTC+2, alex23 wrote: > On 30/08/2013 4:14 PM, fp2...@gmail.com wrote: > > > For this purpose however, I suspect that a named function with a proper > > docstring that can be imported and reused over and over again is probably > > more appropriate than a lamb

Re: semicolon at end of python's statements

2013-08-30 Thread Antoon Pardon
Op 30-08-13 09:25, Chris Angelico schreef: > On Fri, Aug 30, 2013 at 5:15 PM, Antoon Pardon > wrote: >> Op 30-08-13 06:55, Ben Finney schreef: >>> Ben Finney writes: >>> Fábio Santos writes: > It is a shame that this is not possible in python. for..if exists in > comprehensions

Re: semicolon at end of python's statements

2013-08-30 Thread Chris Angelico
On Fri, Aug 30, 2013 at 5:15 PM, Antoon Pardon wrote: > Op 30-08-13 06:55, Ben Finney schreef: >> Ben Finney writes: >> >>> Fábio Santos writes: >>> It is a shame that this is not possible in python. for..if exists in comprehensions and not in regular loops but that would be nice

Re: semicolon at end of python's statements

2013-08-30 Thread Antoon Pardon
Op 30-08-13 06:55, Ben Finney schreef: > Ben Finney writes: > >> Fábio Santos writes: >> >>> It is a shame that this is not possible in python. for..if exists in >>> comprehensions and not in regular loops but that would be nice >>> sometimes. >> for foo in (spam for spam in sequence if pred