Installing Python 2.7 for all users on SLES 11

2016-08-04 Thread Bo Stone
I installed Python 2.7 on SLES 11 box that previously was running Python 2.6. To do so I used a script described in this post (http://stackoverflow.com/a/11371726/135946) and run it as a root user. Everything went well but when it was done I discovered few issues: 1. No symbolic links were crea

Re: Win32 API in pywin32

2016-08-04 Thread jj0gen0info
Thanks for the info iMath, I will try to contact the developers as you've suggested. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is Activestate's Python recipes broken?

2016-08-04 Thread Jason Friedman
> > Log in to Activestate: > > https://code.activestate.com/recipes/langs/python/new/ > > and click "Add a Recipe". I get > > > Forbidden > > You don't have permission to access /recipes/add/ on this server. > Apache Server at code.activestate.com Port 443 > > > > Broken for everyone, or just for m

Re: Tcl/Tk for Python 3.6.0a3 on Os X 10.9.5

2016-08-04 Thread Zachary Ware
On Thu, Aug 4, 2016 at 8:25 PM, Lawrence D’Oliveiro wrote: > On Tuesday, August 2, 2016 at 8:21:57 PM UTC+12, Valeria Munoz wrote: >> >> I have downloaded Python 3.6.0a3 on a Mac 10.9.5 and realized that I also >> need to download an Active Tcl for it. > > Python should already come with Tk >

RE: Issue with ctypes and callback functions

2016-08-04 Thread Bill Somerville
-Original Message- From: eryk sun [mailto:eryk...@gmail.com] from_param is a hook method for a type that's set in a function pointer's argtypes. It gets called to convert an argument when the function pointer is called from Python. The return value can be a ctypes instance, an object wi

Is Activestate's Python recipes broken?

2016-08-04 Thread Steven D'Aprano
Log in to Activestate: https://code.activestate.com/recipes/langs/python/new/ and click "Add a Recipe". I get Forbidden You don't have permission to access /recipes/add/ on this server. Apache Server at code.activestate.com Port 443 Broken for everyone, or just for me? -- Steve “Cheer

Re: Tcl/Tk for Python 3.6.0a3 on Os X 10.9.5

2016-08-04 Thread Lawrence D’Oliveiro
On Tuesday, August 2, 2016 at 8:21:57 PM UTC+12, Valeria Munoz wrote: > > I have downloaded Python 3.6.0a3 on a Mac 10.9.5 and realized that I also > need to download an Active Tcl for it. Python should already come with Tk . Tcl is an entirely separate

Re: Win32 API in pywin32

2016-08-04 Thread Lawrence D’Oliveiro
On Friday, August 5, 2016 at 12:06:23 PM UTC+12, Igor Korot wrote: > > On Thu, Aug 4, 2016 at 4:57 PM, Lawrence D’Oliveiro wrote: >> On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com wrote: >>> According to Python.org Mark Hammond has an Add-on (pywin32) that >>> supports Win32 a

Re: datetime vs Arrow vs Pendulum vs Delorean vs udatetime

2016-08-04 Thread Steven D'Aprano
On Fri, 5 Aug 2016 08:41 am, breamore...@gmail.com wrote: > I hereby ask that only people who know and use Python reply, not the > theoretical idiots who could not fight their way out of a wet paper bag. So it's only people who are theoretically idiots that are prohibited from replying? Actual,

Re: Win32 API in pywin32

2016-08-04 Thread eryk sun
On Fri, Aug 5, 2016 at 12:25 AM, iMath wrote: > On Friday, August 5, 2016 at 7:50:28 AM UTC+8, jj0ge...@gmail.com wrote: >> According to Python.org Mark Hammond has an Add-on (pywin32) that supports >> Win32 and COM. >> >> Does anyone know if the Add-on covers all Win32 API functions, and if not

get a certain request url during Loading a web page

2016-08-04 Thread iMath
During Loading this web page(http://www.iqiyi.com/v_19rrkkri8k.html) , the browser makes many requests,now I need a certain request url (e.g.starts with 'http://cache.video.qiyi.com/vms?') during the Loading process ,and the request is made on condition that the adobe flash player plugin for NPA

Re: Win32 API in pywin32

2016-08-04 Thread iMath
On Friday, August 5, 2016 at 7:50:28 AM UTC+8, jj0ge...@gmail.com wrote: > According to Python.org Mark Hammond has an Add-on (pywin32) that supports > Win32 and COM. > > Does anyone know if the Add-on covers all Win32 API functions, and if not is > there a list of the subset of Win32 API functi

Re: Win32 API in pywin32

2016-08-04 Thread Igor Korot
Hi, On Thu, Aug 4, 2016 at 4:57 PM, Lawrence D’Oliveiro wrote: > On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com wrote: >> According to Python.org Mark Hammond has an Add-on (pywin32) that supports >> Win32 and COM. > > Are people still using Win32? I thought Windows went 64-b

Re: make an object read only

2016-08-04 Thread Lawrence D’Oliveiro
On Wednesday, August 3, 2016 at 3:13:01 AM UTC+12, Robin Becker wrote: > A reportlab user found he was doing the wrong thing by calling > canvas.save repeatedly, our documentation says you should not use Canvas > objects after the save method has been used. The user had mixed results :( As GvR has

Re: can't add variables to instances of built-in classes

2016-08-04 Thread Lawrence D’Oliveiro
On Thursday, August 4, 2016 at 3:07:17 PM UTC+12, Chris Angelico wrote: > On Thu, Aug 4, 2016 at 12:34 PM, Lawrence D’Oliveiro wrote: >> On Thursday, July 21, 2016 at 2:29:53 PM UTC+12, Chris Angelico wrote: >> >>> Using __slots__ basically takes your object down to the level of a >>> Java one. >>

Re: Win32 API in pywin32

2016-08-04 Thread Lawrence D’Oliveiro
On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com wrote: > According to Python.org Mark Hammond has an Add-on (pywin32) that supports > Win32 and COM. Are people still using Win32? I thought Windows went 64-bit years ago. -- https://mail.python.org/mailman/listinfo/python-list

Win32 API in pywin32

2016-08-04 Thread jj0gen0info
According to Python.org Mark Hammond has an Add-on (pywin32) that supports Win32 and COM. Does anyone know if the Add-on covers all Win32 API functions, and if not is there a list of the subset of Win32 API functions it does include? J. -- https://mail.python.org/mailman/listinfo/python-list

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
Wow!!! A huge thank you to all who replied to this thread! Chris: You gave me some ideas I will apply in the future. MRAB: Thanks for exposing me to the extended attributes of the UnicodeError object (e.start, e.end, e.object). Mike: Cool example! I like how _cleanlines() recursively calls itse

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Michael Selik
On Thu, Aug 4, 2016 at 3:24 PM Malcolm Greene wrote: > Hi Chris, > > Thanks for your suggestions. I would like to capture the specific bad > codes *before* they get replaced. So if a line of text has 10 bad codes > (each one raising UnicodeError), I would like to track each exception's > bad code

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 5:22 AM, Malcolm Greene wrote: > Thanks for your suggestions. I would like to capture the specific bad > codes *before* they get replaced. So if a line of text has 10 bad codes > (each one raising UnicodeError), I would like to track each exception's > bad code but still ret

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 5:36 AM, Terry Reedy wrote: > An example of the latter is when one writes code in Python to execute > 'other' code. (IDLE is one example. It both executes user statements and > evals user expressions.) One needs "except BaseException:" to isolate the > interpreter from e

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Random832
On Thu, Aug 4, 2016, at 15:22, Malcolm Greene wrote: > Hi Chris, > > Thanks for your suggestions. I would like to capture the specific bad > codes *before* they get replaced. So if a line of text has 10 bad codes > (each one raising UnicodeError), I would like to track each exception's > bad code

Re: Python Error message

2016-08-04 Thread Terry Reedy
On 8/4/2016 12:19 PM, MRAB wrote: In those rare occasions when you do write a bare except, A bare "except:" is never needed and in my opinion, and that of others, one should never write one (except possibly for experimentation). Be explicit and write "except BaseException:" or "except Except

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread MRAB
On 2016-08-04 20:22, Malcolm Greene wrote: Hi Chris, Thanks for your suggestions. I would like to capture the specific bad codes *before* they get replaced. So if a line of text has 10 bad codes (each one raising UnicodeError), I would like to track each exception's bad code but still return a v

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
Hi Chris, Thanks for your suggestions. I would like to capture the specific bad codes *before* they get replaced. So if a line of text has 10 bad codes (each one raising UnicodeError), I would like to track each exception's bad code but still return a valid decode line when finished. My goal is

Re: Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 4:47 AM, Malcolm Greene wrote: > I'm processing a lot of dirty CSV files and would like to track the bad > codes that are raising UnicodeErrors. I'm struggling how to figure out > what the exact codes are so I can track them, them remove them, and then > repeat the decoding

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 4:37 AM, Terry Reedy wrote: > Making repeat a keyword would have such an extremely high cost > that it is out of the question and not a sane proposal. > To start with, it is used in two major, widely used APIs. > > itertools.repeat + 50 uses in other itertools and tests > ti

Re: Ide or code editor confusion

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 4:36 AM, Michael Torrie wrote: > On 08/04/2016 01:23 AM, Lawrence D’Oliveiro wrote: >> On Friday, July 22, 2016 at 2:38:10 AM UTC+12, Chris Angelico wrote: >>> On Fri, Jul 22, 2016 at 12:22 AM, sigmaphine1914 wrote: Beginning Python: using Python 2.6 and Python 3.1. By

Capturing the bad codes that raise UnicodeError exceptions during decoding

2016-08-04 Thread Malcolm Greene
I'm processing a lot of dirty CSV files and would like to track the bad codes that are raising UnicodeErrors. I'm struggling how to figure out what the exact codes are so I can track them, them remove them, and then repeat the decoding process for the current line until the line has been fully deco

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Terry Reedy
Making repeat a keyword would have such an extremely high cost that it is out of the question and not a sane proposal. To start with, it is used in two major, widely used APIs. itertools.repeat + 50 uses in other itertools and tests + all the imports and and uses of repeat() in code all over th

Re: Ide or code editor confusion

2016-08-04 Thread Michael Torrie
On 08/04/2016 01:23 AM, Lawrence D’Oliveiro wrote: > On Friday, July 22, 2016 at 2:38:10 AM UTC+12, Chris Angelico wrote: >> On Fri, Jul 22, 2016 at 12:22 AM, sigmaphine1914 wrote: >>> Beginning Python: using Python 2.6 and Python 3.1. By James Payne >>> >>> Part II. >> >> Ugh, that's extremely ol

Re: Tracing memory in production django process with systemtap

2016-08-04 Thread Lei G
在 2016年8月5日星期五 UTC+8上午1:41:04,Lei G写道: > Hi all, > > Recently I met some python memory problems with Django and uwsgi, and found > to find exactly which part is causing the problem, so I went to use systemtap > to tracing the problem, and here are some problems that I met: > > It seems pyth

Tracing memory in production django process with systemtap

2016-08-04 Thread Lei G
Hi all, Recently I met some python memory problems with Django and uwsgi, and found to find exactly which part is causing the problem, so I went to use systemtap to tracing the problem, and here are some problems that I met: It seems python needs to patch some 'probes' into the source code,

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 2:09 AM, Igor Korot wrote: >> [1] There are exceptions to this rule, for experts. But if you need to ask >> what they are, you're not ready to know > > But even the experts will never write such a code - you never know what > happens > in a month. Server might throw some ne

Re: Python Error message

2016-08-04 Thread MRAB
On 2016-08-04 17:09, Igor Korot wrote: Steven, On Thu, Aug 4, 2016 at 11:56 AM, Steven D'Aprano wrote: On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: try: parsed_response = json.loads(response) deployid = parsed_response[u'id'] print "Your deployid is: " + deployid except: prin

Re: Python Error message

2016-08-04 Thread MRAB
On 2016-08-04 16:31, GBANE FETIGUE wrote: Hi, I am running a python script to run some CURL commands, and return the response which is the applicationId and the versionId. I was able to do it. Now the versionId value supposed to be used on the second CURL as a value of the applications key whi

Re: Python Error message

2016-08-04 Thread Igor Korot
Steven, On Thu, Aug 4, 2016 at 11:56 AM, Steven D'Aprano wrote: > On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: > >> try: >> parsed_response = json.loads(response) >> deployid = parsed_response[u'id'] >> print "Your deployid is: " + deployid >> except: >> print 'Seems the named id

Re: Python Error message

2016-08-04 Thread Steven D'Aprano
On Fri, 5 Aug 2016 01:31 am, GBANE FETIGUE wrote: > try: > parsed_response = json.loads(response) > deployid = parsed_response[u'id'] > print "Your deployid is: " + deployid > except: > print 'Seems the named id already exists!' I'm not going to try to debug your code blindfolded wit

Re: Python Error message

2016-08-04 Thread Chris Angelico
On Fri, Aug 5, 2016 at 1:31 AM, GBANE FETIGUE wrote: > try: > parsed_response = json.loads(response) > print "Your applicationId is: " + parsed_response[u'applicationId'] > version_id = parsed_response[u'versionId'] > print "Your versionId is: " + version_id > except: > print '

Python Error message

2016-08-04 Thread GBANE FETIGUE
Hi, I am running a python script to run some CURL commands, and return the response which is the applicationId and the versionId. I was able to do it. Now the versionId value supposed to be used on the second CURL as a value of the applications key which is an array. but it doesn't work.I 'll p

Re: Use pip to install non-python?

2016-08-04 Thread Jon Ribbens
On 2016-08-04, Tennis Smith wrote: > I have several utility scripts I want to install in /usr/local/bin. > Some are python, some are simple bash scripts. Can I use pip to > install them? If so, can anyone point me to some examples? By the looks of it*, you should be able to do this: setup

Use pip to install non-python?

2016-08-04 Thread Tennis Smith
I have several utility scripts I want to install in /usr/local/bin. Some are python, some are simple bash scripts. Can I use pip to install them? If so, can anyone point me to some examples? Thanks, -T -- https://mail.python.org/mailman/listinfo/python-list

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Steven D'Aprano
On Thursday 04 August 2016 19:13, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> Who says it

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread Chris Angelico
On Thu, Aug 4, 2016 at 7:13 PM, BartC wrote: > On 04/08/2016 04:23, Steven D'Aprano wrote: >> >> On Wed, 3 Aug 2016 08:16 pm, BartC wrote: > > >>> So the idea that remembering 'repeat N' is a cognitive burden, and the >>> myriad string operations for example are not, is ridiculous. >> >> >> Who sa

Re: Debugging (was Re: Why not allow empty code blocks?)

2016-08-04 Thread BartC
On 04/08/2016 04:23, Steven D'Aprano wrote: On Wed, 3 Aug 2016 08:16 pm, BartC wrote: So the idea that remembering 'repeat N' is a cognitive burden, and the myriad string operations for example are not, is ridiculous. Who says it isn't a cognitive burden? Of course it is. The difference is

Re: Float

2016-08-04 Thread Lawrence D’Oliveiro
On Sunday, July 31, 2016 at 3:21:09 PM UTC+12, Rustom Mody wrote: > In writing Tex he went out of his way to implement his own fixed point > system and avoid using the builtin hardware floating point > https://en.wikipedia.org/wiki/TeX#Development > > To the extent its feasible it’s advisable to f

Re: Ide or code editor confusion

2016-08-04 Thread Lawrence D’Oliveiro
On Friday, July 22, 2016 at 2:38:10 AM UTC+12, Chris Angelico wrote: > On Fri, Jul 22, 2016 at 12:22 AM, sigmaphine1914 wrote: >> Beginning Python: using Python 2.6 and Python 3.1. By James Payne >> >> Part II. > > Ugh, that's extremely old now. That’s why I’ve come to the conclusion it’s a wast