Simple Interactive Python Version Management for Managing Python 2, Python 3, and Development Builds

2015-05-08 Thread Nimit Kalra
Hey all, Wrote a ~600 line Bash script that takes the pain out of managing Python versions (from 2.x.x to 3.x.x to development builds). Below are some more details. The entire project can be found on GitHub at https://github.com/qw3rtman/p. Let me know if you find it useful. :) p: Python Version

Is this unpythonic?

2015-05-08 Thread Frank Millman
Hi all I have often read about the gotcha regarding 'mutable default arguments' that frequently trips people up. I use them from time to time, but I have never had a problem. I have just delved a bit deeper to see if I am skating on thin ice. AFAICT my usage is safe. If I use a list as an argu

www.python.org - Backend is unhealthy

2015-05-08 Thread jarausch
I cannot access www.python.org. I always get Error 503 Backend is unhealthy Backend is unhealthy Guru Mediation: Details: cache-ams4149-AMS 1431072956 2041303800 Varnish cache server Is it only me? Thanks for a hint, Helmut -- https://mail.python.org/mailman/listinfo/python-list

Re: Is this unpythonic?

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 6:01 PM, Frank Millman wrote: > I have often read about the gotcha regarding 'mutable default arguments' > that frequently trips people up. > > I use them from time to time, but I have never had a problem. I have just > delved a bit deeper to see if I am skating on thin ice.

Re: www.python.org - Backend is unhealthy

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 6:17 PM, wrote: > I cannot access www.python.org. > I always get > > Error 503 Backend is unhealthy > > Backend is unhealthy > > Guru Mediation: > > Details: cache-ams4149-AMS 1431072956 2041303800 > > Varnish cache server > > > Is it only me? > No, it's not only you. I ge

Re: [pydotorg-www] www.python.org - Backend is unhealthy

2015-05-08 Thread Noah Kantrowitz
On May 8, 2015, at 10:28 AM, Chris Angelico wrote: > On Fri, May 8, 2015 at 6:17 PM, wrote: >> I cannot access www.python.org. >> I always get >> >> Error 503 Backend is unhealthy >> >> Backend is unhealthy >> >> Guru Mediation: >> >> Details: cache-ams4149-AMS 1431072956 2041303800 >> >>

Re: [pydotorg-www] www.python.org - Backend is unhealthy

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 6:32 PM, Noah Kantrowitz wrote: >> Cc'ing in the www list in case someone there knows, and I'll create a >> github issue to ping the people there. > > Should be recovering now. Thanks, yep, working for me now! ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Boolean Operator Confusion

2015-05-08 Thread Albert van der Horst
In article <553a5ded$0$12978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >On Sat, 25 Apr 2015 12:50 am, subhabrata.bane...@gmail.com wrote: > >> Dear Group, >> >> I am trying to understand the use of Boolean operator in Python. I am >> trying to write small piece of script, as fol

Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
Why is array.array('u') deprecated? Will we get an alternative for a character array or mutable unicode string? Thanks! Jonathan -- https://mail.python.org/mailman/listinfo/python-list

Re: [pydotorg-www] www.python.org - Backend is unhealthy

2015-05-08 Thread jarausch
On Friday, 8 May 2015 10:32:21 UTC+2, Coderanger wrote: Should be recovering now. Thanks, it's fine here, as well. Helmut -- https://mail.python.org/mailman/listinfo/python-list

Re: Is this unpythonic?

2015-05-08 Thread Steven D'Aprano
On Fri, 8 May 2015 06:01 pm, Frank Millman wrote: > Hi all > > I have often read about the gotcha regarding 'mutable default arguments' > that frequently trips people up. > > I use them from time to time, but I have never had a problem. I have just > delved a bit deeper to see if I am skating on

To pickle or not to pickle

2015-05-08 Thread Cecil Westerhof
I first used marshal in my filebasedMessages module. Then I read that you should not use it, because it changes per Python version and it was better to use pickle. So I did that and now I find: https://wiki.python.org/moin/Pickle Is it really that bad and should I change again? -- Cecil West

Re: Why is array.array('u') deprecated?

2015-05-08 Thread Steven D'Aprano
On Fri, 8 May 2015 07:14 pm, jonathan.slend...@gmail.com wrote: > Why is array.array('u') deprecated? > > Will we get an alternative for a character array or mutable unicode > string? Good question. Of the three main encodings for Unicode, two are variable-width: * UTF-8 uses 1-4 bytes per c

Re: To pickle or not to pickle

2015-05-08 Thread Peter Otten
Cecil Westerhof wrote: > I first used marshal in my filebasedMessages module. Then I read that > you should not use it, because it changes per Python version and it > was better to use pickle. So I did that and now I find: > https://wiki.python.org/moin/Pickle > > Is it really that bad and sh

Re: Matlab to Python problem

2015-05-08 Thread Peter Otten
Lesego Moloko wrote: > I am a Python novice and have recently converted the attached Matlab file > to Python (attached). The problem is that I cannot reproduce the Matlab > plots (attached) with the converted Python program. I am also trying to go > line by line through my converted Python file to

Re: Bitten by my C/Java experience

2015-05-08 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Tue, May 5, 2015 at 3:32 AM, Irmen de Jong wrote: >> That is a broad question, but one thing that comes to mind is the >current (python 3) >> behavior of integer division. It gives the exact result and doesn't >truncate to integers: >> >> > 5/4 >> 1.25

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Steven D'Aprano" wrote in message news:554c8b0a$0$12992$c3e8da3$54964...@news.astraweb.com... > On Fri, 8 May 2015 06:01 pm, Frank Millman wrote: > >> Hi all >> [...] >> >> However, every time I look at my own code, and I see "def x(y, z=[]): >> ." it looks wrong because I have been con

Re: To pickle or not to pickle

2015-05-08 Thread Steven D'Aprano
On Fri, 8 May 2015 07:58 pm, Cecil Westerhof wrote: > I first used marshal in my filebasedMessages module. Then I read that > you should not use it, because it changes per Python version and it > was better to use pickle. So I did that and now I find: > https://wiki.python.org/moin/Pickle > >

Re: Encrypt python files

2015-05-08 Thread Denis McMahon
On Tue, 05 May 2015 23:37:02 -0700, Palpandi wrote: > What are the ways to encrypt python files? Depends why you want to encrypt them, and what you want to do with the encrypted files. Do you mean executable python code files, or do you mean data files generated by python. -- Denis McMahon,

about Orthogonal series

2015-05-08 Thread tahiri noria
hello, I read your article on the blog: http://jpktd.blogspot.com/ about orthogonal series estimation , I would like to ask you if you allow . First, I based on Article Sam Efromovich about "Orthogonal series density estimates" . he worked with the Fourier series with a compact support assumed [0

about orthogonal series

2015-05-08 Thread tahiri noria
hello, I read your article on the blog: http://jpktd.blogspot.com/ about orthogonal series estimation , I would like to ask you if you allow . First, I based on Article Sam Efromovich about "Orthogonal series density estimates" . he worked with the Fourier series with a compact support assumed [0

Re: Encrypt python files

2015-05-08 Thread Denis McMahon
On Wed, 06 May 2015 00:23:39 -0700, Palpandi wrote: > On Wednesday, May 6, 2015 at 12:07:13 PM UTC+5:30, Palpandi wrote: >> Hi, >> >> What are the ways to encrypt python files? > > No, I just want to hide the scripts from others. You can do that by deleting the scripts. Make sure you use a secu

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
Le vendredi 8 mai 2015 12:29:15 UTC+2, Steven D'Aprano a écrit : > On Fri, 8 May 2015 07:14 pm, jonathan.slenders wrote: > > > Why is array.array('u') deprecated? > > > > Will we get an alternative for a character array or mutable unicode > > string? > > > Good question. > > Of the three main

Re: Beacon controller

2015-05-08 Thread Denis McMahon
On Tue, 05 May 2015 16:37:06 -0700, bmanogna.17 wrote: > I'm new to pyhton, can anyone suggest me how can I implement a DOS or > DDOS attack in Beacon Controller. Contact your nearest LEO cybercrime unit and ask them. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailma

Re: Json Comaprision

2015-05-08 Thread Denis McMahon
On Tue, 05 May 2015 12:55:20 -0700, pra devOPS wrote: > I wanted to compare two json files ignoring few of the keys in the json > files. > > Can anybody suggest me few things? json files usually get imported to either a list or a dictionary (unless they're a simple string or number). If the fi

Re: To pickle or not to pickle

2015-05-08 Thread Cem Karan
What are you using pickle for? If this is just for yourself, go for it. If you're planning on interchanging with different languages/platforms/etc., JSON or XML might be better. If you're after something that is smaller and faster, maybe MessagePack or Google Protocol Buffers. If you're afte

Re: Bitten by my C/Java experience

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 8:47 PM, Albert van der Horst wrote: > In article , > Chris Angelico wrote: >>On Tue, May 5, 2015 at 3:32 AM, Irmen de Jong wrote: >>> That is a broad question, but one thing that comes to mind is the >>current (python 3) >>> behavior of integer division. It gives the exa

Re: Is this unpythonic?

2015-05-08 Thread Ben Finney
"Frank Millman" writes: > If I use a list as an argument, I only use it to pass values *into* > the function, but I never modify the list. You've had good reasons why a mutable default argument is a good idea. I'll address another aspect of the question: passing a structured collection of value

Re: Why is array.array('u') deprecated?

2015-05-08 Thread Peter Otten
jonathan.slend...@gmail.com wrote: > Le vendredi 8 mai 2015 12:29:15 UTC+2, Steven D'Aprano a écrit : >> On Fri, 8 May 2015 07:14 pm, jonathan.slenders wrote: >> >> > Why is array.array('u') deprecated? >> > >> > Will we get an alternative for a character array or mutable unicode >> > string? >>

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Dave Angel
On 05/08/2015 02:42 AM, Chris Angelico wrote: On Fri, May 8, 2015 at 4:36 PM, Rustom Mody wrote: On Friday, May 8, 2015 at 10:39:38 AM UTC+5:30, Chris Angelico wrote: Why have the concept of a procedure? On Friday, Chris Angelico ALSO wrote: With print(), you have a conceptual procedure...

Re: Is this unpythonic?

2015-05-08 Thread Dave Angel
On 05/08/2015 06:53 AM, Frank Millman wrote: "Steven D'Aprano" wrote in message news:554c8b0a$0$12992$c3e8da3$54964...@news.astraweb.com... On Fri, 8 May 2015 06:01 pm, Frank Millman wrote: Hi all [...] However, every time I look at my own code, and I see "def x(y, z=[]): ." it l

Re: functions, optional parameters

2015-05-08 Thread Rustom Mody
On Friday, May 8, 2015 at 5:30:15 PM UTC+5:30, Michael Welle wrote: > Hello, > > assume the following function definition: > > def bar(foo = []): > print("foo: %s" % foo) > foo.append("foo") > > It doesn't work like one would expect (or as I would expect ;-)). As I > understand it the as

Re: Encrypt python files

2015-05-08 Thread Dave Angel
On 05/08/2015 06:59 AM, Denis McMahon wrote: On Wed, 06 May 2015 00:23:39 -0700, Palpandi wrote: On Wednesday, May 6, 2015 at 12:07:13 PM UTC+5:30, Palpandi wrote: Hi, What are the ways to encrypt python files? No, I just want to hide the scripts from others. You can do that by deleting t

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
> Can you expand a bit on how array("u") helps here? Are the matches in the > gigabyte range? I have a string of unicode characters, e.g.: data = array.array('u', u'x' * 10) Then I need to change some data in the middle of this string, for instance: data[50] = 'y' Then I want to u

Re: To pickle or not to pickle

2015-05-08 Thread Cecil Westerhof
Op Friday 8 May 2015 12:32 CEST schreef Peter Otten: > Cecil Westerhof wrote: > >> I first used marshal in my filebasedMessages module. Then I read >> that you should not use it, because it changes per Python version >> and it was better to use pickle. So I did that and now I find: >> https://wiki

Re: To pickle or not to pickle

2015-05-08 Thread Cecil Westerhof
Op Friday 8 May 2015 12:54 CEST schreef Steven D'Aprano: > If your code is only going to be used by yourself, I'd just use > pickle. If you are creating an application for others to use, I > would spend the extra effort to build in support for at least > pickle, JSON and plists, and let the user d

A __call__ "method" which is itself another callable class instance?

2015-05-08 Thread Skip Montanaro
This is just a pedantic post. It has no real useful application, just something to think about. I apologize that the setup is rather long. The stuff to think about is at the end. (I also apologize for using rich text/html. In this HTML world in which we live nowadays, I'm never certain that mail sy

Re: Beacon controller

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 9:23 PM, Denis McMahon wrote: > On Tue, 05 May 2015 16:37:06 -0700, bmanogna.17 wrote: > >> I'm new to pyhton, can anyone suggest me how can I implement a DOS or >> DDOS attack in Beacon Controller. > > Contact your nearest LEO cybercrime unit and ask them. Now I'm thinking

Re: Stripping unencodable characters from a string

2015-05-08 Thread Serhiy Storchaka
On 05.05.15 21:19, Paul Moore wrote: I want to write a string to an already-open file (sys.stdout, typically). However, I *don't* want encoding errors, and the string could be arbitrary Unicode (in theory). The best way I've found is data = data.encode(file.encoding, errors='replace').dec

Re: functions, optional parameters

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 9:59 PM, Michael Welle wrote: > Hello, > > assume the following function definition: > > def bar(foo = []): > print("foo: %s" % foo) > foo.append("foo") > > It doesn't work like one would expect (or as I would expect ;-)). As I > understand it the assignment of the e

Re: A __call__ "method" which is itself another callable class instance?

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 10:24 PM, Skip Montanaro wrote: > The question for the esteemed gathering here: have you ever encountered the > need for this class-instance-as-a-dunder-call-method before? Perhaps in some > sort of code generation situation? Or cleaner functions-with-attributes? I've never

Re: To pickle or not to pickle

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 9:55 PM, Cecil Westerhof wrote: > Op Friday 8 May 2015 12:54 CEST schreef Steven D'Aprano: > >> If your code is only going to be used by yourself, I'd just use >> pickle. If you are creating an application for others to use, I >> would spend the extra effort to build in supp

Re: asyncio: What is the difference between tasks, futures, and coroutines?

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 9:53 PM, Dave Angel wrote: > One thing newbies get tripped up by is having some path through their code > that doesn't explicitly return. And in Python that path therefore returns > None. It's most commonly confusing when there are nested ifs, and one of > the "inner ifs"

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Ben Finney" wrote in message news:85y4kzb90f@benfinney.id.au... > "Frank Millman" writes: > >> If I use a list as an argument, I only use it to pass values *into* >> the function, but I never modify the list. > > You've had good reasons why a mutable default argument is a good idea. > > I'

Re: Why is array.array('u') deprecated?

2015-05-08 Thread Peter Otten
jonathan.slend...@gmail.com wrote: >> Can you expand a bit on how array("u") helps here? Are the matches in the >> gigabyte range? > > I have a string of unicode characters, e.g.: > > data = array.array('u', u'x' * 10) > > Then I need to change some data in the middle of this string, fo

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Dave Angel" wrote in message news:554ca652.1000...@davea.name... > On 05/08/2015 06:53 AM, Frank Millman wrote: >> > > It might be appropriate to define the list at top-level, as > > EMPTY_LIST=[] > > and in your default argument as > def x(y, z=EMPTY_LIST): > > and with the all-caps, you'r

Re: multiprocessing, queue

2015-05-08 Thread Chris Angelico
On Fri, May 8, 2015 at 8:08 PM, Michael Welle wrote: > Hello, > > what's wrong with [0]? As num_tasks gets higher proc.join() seems to > block forever. First I thought the magical frontier is around 32k tasks, > but then it seemed to work with 40k tasks. Now I'm stuck around 7k > tasks. I think I

CFP: Workshop on Exascale Multi/many Core Computing Systems (E-MuCoCoS)

2015-05-08 Thread SP
*** Paper submission deadline: June 22, 2015 *** Workshop on Exascale Multi/many Core Computing Systems (E-MuCoCoS) In conjunction with the 18th IEEE Confere

Re: Why is array.array('u') deprecated?

2015-05-08 Thread jonathan . slenders
Le vendredi 8 mai 2015 15:11:56 UTC+2, Peter Otten a écrit : > > So, this works perfectly fine and fast. But it scares me that it's > > deprecated and Python 4 will not support it anymore. > > Hm, this doesn't even work with Python 3: My mistake. I should have tested better. > >>> data = array.a

Re: To pickle or not to pickle

2015-05-08 Thread Cecil Westerhof
Op Friday 8 May 2015 14:53 CEST schreef Chris Angelico: > On Fri, May 8, 2015 at 9:55 PM, Cecil Westerhof wrote: >> Op Friday 8 May 2015 12:54 CEST schreef Steven D'Aprano: >> >>> If your code is only going to be used by yourself, I'd just use >>> pickle. If you are creating an application for ot

Re: multiprocessing, queue

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 12:31 AM, Michael Welle wrote: >> As a general rule, queues need to have both ends operating >> simultaneously, otherwise you're likely to have them blocking. In >> theory, your code should all work with ridiculously low queue sizes; >> the only cost will be concurrency (sin

Re: Is this unpythonic?

2015-05-08 Thread Steven D'Aprano
On Fri, 8 May 2015 08:53 pm, Frank Millman wrote: >> Does z have to be a list? Could you use an empty tuple instead? >> >> def x(y, z=()): ... >> > > That was Chris' suggestion as well (thanks Chris). > > The idea appealed to me, but then I found a situation where I pass in a > dictionary instea

Re: To pickle or not to pickle

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 12:34 AM, Cecil Westerhof wrote: > When I unpickle quotes.pickle I get: > [25, 112, 4, 18, 41, 2, 81, 75, 28, 60, 105, 47, 84, 65, 103, 42, > 13, 66, 55, 124, 6, 82, 76, 12, 61, 113, 119, 96, 3, 68, 11, 89, > 98, 107, 118, 29, 57, 33, 88, 121, 110, 49, 90, 72, 87

Re: functions, optional parameters

2015-05-08 Thread Steven D'Aprano
On Fri, 8 May 2015 09:59 pm, Michael Welle wrote: > Hello, > > assume the following function definition: > > def bar(foo = []): > print("foo: %s" % foo) > foo.append("foo") > > It doesn't work like one would expect (or as I would expect ;-)). As I > understand it the assignment of the e

IDLE Restoration

2015-05-08 Thread subhabrata . banerji
Dear Group, In many applications there is a facility to restore its previous sessions, especially if they close accidentally. Does IDLE have any such facility? If it is there, how may I use it? If someone may kindly suggest it. Regards, Subhabrata Banerjee. -- https://mail.python.org/mailm

Re: IDLE Restoration

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 1:26 AM, wrote: > In many applications there is a facility to restore its previous sessions, > especially if they close accidentally. > > Does IDLE have any such facility? > If it is there, how may I use it? > > If someone may kindly suggest it. Generally the notion of se

How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Tommy C
I'm trying to apply OOP in this bouncing ball code in order to have multiple balls bouncing around the screen. The objective of this code is to create a method called settings, which controls all the settings for the screen and the bouncing behaviour of multiple balls, under the class Ball. Howe

Re: functions, optional parameters

2015-05-08 Thread Ian Kelly
On May 8, 2015 9:26 AM, "Steven D'Aprano" < steve+comp.lang.pyt...@pearwood.info> wrote: > > Do you think that Python will re-compile the body of the function every time > you call it? Setting the default is part of the process of compiling the > function. To be a bit pedantic, that's not accurate

Re: functions, optional parameters

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 1:48 AM, Ian Kelly wrote: > On May 8, 2015 9:26 AM, "Steven D'Aprano" > wrote: >> >> Do you think that Python will re-compile the body of the function every >> time >> you call it? Setting the default is part of the process of compiling the >> function. > > To be a bit peda

Re: IDLE Restoration

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 2:06 AM, Thomas 'PointedEars' Lahn wrote: > Chris Angelico wrote: > >> Are you hoping to have the IDLE editor restore the fact that you had >> files X, Y, and Z open, or are you hoping to have the interactive >> interpreter retain your entire history of commands and their re

Re: IDLE Restoration

2015-05-08 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > Are you hoping to have the IDLE editor restore the fact that you had > files X, Y, and Z open, or are you hoping to have the interactive > interpreter retain your entire history of commands and their results? > The former is reasonably plausible (and may well be possible al

Re: How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Ian Kelly
On May 8, 2015 9:46 AM, "Tommy C" wrote: > > I'm trying to apply OOP in this bouncing ball code in order to have multiple balls bouncing around the screen. The objective of this code is to create a method called settings, which controls all the settings for the screen and the bouncing behaviour of

Re: To pickle or not to pickle

2015-05-08 Thread Cecil Westerhof
Op Friday 8 May 2015 17:11 CEST schreef Chris Angelico: > On Sat, May 9, 2015 at 12:34 AM, Cecil Westerhof wrote: >> When I unpickle quotes.pickle I get: >> [25, 112, 4, 18, 41, 2, 81, 75, 28, 60, 105, 47, 84, 65, 103, 42, >> 13, 66, 55, 124, 6, 82, 76, 12, 61, 113, 119, 96, 3, 68, 11, 89, >> 98,

Re: To pickle or not to pickle

2015-05-08 Thread Irmen de Jong
On 8-5-2015 12:32, Peter Otten wrote: > Cecil Westerhof wrote: > >> I first used marshal in my filebasedMessages module. Then I read that >> you should not use it, because it changes per Python version and it >> was better to use pickle. So I did that and now I find: >> https://wiki.python.org

Re: functions, optional parameters

2015-05-08 Thread Steven D'Aprano
On Sat, 9 May 2015 01:48 am, Ian Kelly wrote: > On May 8, 2015 9:26 AM, "Steven D'Aprano" < > steve+comp.lang.pyt...@pearwood.info> wrote: >> >> Do you think that Python will re-compile the body of the function every > time >> you call it? Setting the default is part of the process of compiling th

Re: functions, optional parameters

2015-05-08 Thread Steven D'Aprano
On Sat, 9 May 2015 02:02 am, Chris Angelico wrote: > On Sat, May 9, 2015 at 1:48 AM, Ian Kelly wrote: >> On May 8, 2015 9:26 AM, "Steven D'Aprano" >> wrote: >>> >>> Do you think that Python will re-compile the body of the function every >>> time >>> you call it? Setting the default is part of th

Re: functions, optional parameters

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 3:36 AM, Steven D'Aprano wrote: > On Sat, 9 May 2015 02:02 am, Chris Angelico wrote: >> Aside from constructing two closures in the same context and proving >> that their __code__ attributes point to the same object, is there any >> way to distinguish between "code object co

Re: How to properly apply OOP in the bouncing ball code

2015-05-08 Thread Mel Wilson
On Fri, 08 May 2015 08:40:34 -0700, Tommy C wrote: > I'm trying to apply OOP in this bouncing ball code in order to have > multiple balls bouncing around the screen. The objective of this code is > to create a method called settings, which controls all the settings for > the screen and the bouncin

Re: functions, optional parameters

2015-05-08 Thread Mel Wilson
On Sat, 09 May 2015 03:49:36 +1000, Chris Angelico wrote: > Yes, but can you *distinguish* them in terms of default argument versus > code object creation? How do you know that the function's code object > was created when compile() happened, rather than being created when the > function was defin

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread zljubisicmob
The script is very simple (abc.txt exists in ROOTDIR directory): import os import shutil ROOTDIR = 'C:\Users\zoran' file1 = os.path.join(ROOTDIR, 'abc.txt') file2 = os.path.join(ROOTDIR, 'def.txt') shutil.move(file1, file2) But it returns the following error: C:\Python34\python.exe C:/Users

Re: IDLE Restoration

2015-05-08 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Thomas 'PointedEars' Lahn […] wrote: >> Chris Angelico wrote: >>> Are you hoping to have the IDLE editor restore the fact that you had >>> files X, Y, and Z open, or are you hoping to have the interactive >>> interpreter retain your entire history of commands and their

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread random832
On Fri, May 8, 2015, at 15:00, zljubisic...@gmail.com wrote: > As I saw, I could solve the problem by changing line 4 to (small letter > "r" before string: > ROOTDIR = r'C:\Users\zoran' > > but that is not an option for me because I am using configparser in order > to read the ROOTDIR from underly

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread MRAB
On 2015-05-08 20:00, zljubisic...@gmail.com wrote: The script is very simple (abc.txt exists in ROOTDIR directory): import os import shutil ROOTDIR = 'C:\Users\zoran' file1 = os.path.join(ROOTDIR, 'abc.txt') file2 = os.path.join(ROOTDIR, 'def.txt') shutil.move(file1, file2) But it returns t

Direct client Requirement - Immediate Hire: ETL Developer

2015-05-08 Thread nagaraju thoudoju
Hi, Hope your are doing great, Please find the requirement below and let me know you interest on this position on nagar...@intsystech.com or feel free to call me on my D:908-333-3534. Requirement: Role: ETL Developer Location: Boise Idaho Must be 10+ Years Experience . Should have stro

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread zljubisicmob
Thanks for clarifying. Looks like the error message was wrong. On windows ntfs I had a file name more than 259 characters which is widows limit. After cutting file name to 259 characters everything works as it should. If I cut file name to 260 characters I get the error from subject which is wron

Re: IDLE Restoration

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 5:12 AM, Thomas 'PointedEars' Lahn wrote: > Chris Angelico wrote: > >> […] Thomas 'PointedEars' Lahn […] wrote: >>> Chris Angelico wrote: Are you hoping to have the IDLE editor restore the fact that you had files X, Y, and Z open, or are you hoping to have the inte

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 5:00 AM, wrote: > But it returns the following error: > > > C:\Python34\python.exe C:/Users/bckslash_test.py > File "C:/Users/bckslash_test.py", line 4 > ROOTDIR = 'C:\Users' > ^ > SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in

Re: Direct client Requirement - Immediate Hire: ETL Developer

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 6:02 AM, nagaraju thoudoju wrote: > Please find the requirement below and let me know you interest on this > position on > nagar...@intsystech.com or feel free to call me on my > D:908-333-3534. > Requirement: > Role: ETL Developer > Location: Boise Idaho This is spam sent

Re: Delivery Status Notification (Failure)

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 8:58 AM, Mail Delivery Subsystem wrote: > Delivery to the following recipient failed permanently: > > ab...@intsystech.com > > Technical details of permanent failure: > Google tried to deliver your message, but it was rejected by the server for > the recipient domain i

Jython from bathc file?

2015-05-08 Thread vjp2 . at
How do I do this in a .bat file? Do I include the Jython or pipe it? % CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper Jython 2.2.1 on java1.6.0_20 Type "copyright", "credits" or "license" for more information.

Re: IDLE Restoration

2015-05-08 Thread Terry Reedy
On 5/8/2015 11:26 AM, subhabrata.bane...@gmail.com wrote: Dear Group, In many applications there is a facility to restore its previous sessions, especially if they close accidentally. Does IDLE have any such facility? No. You are prompted to close unsaved files. Filenames are saved in Rece

(OT) Re: Encrypt python files

2015-05-08 Thread Gregory Ewing
Dave Angel wrote: It'd be clearer if you used decryptable, since unencryptable has a very different meaning. http://en.wiktionary.org/wiki/unencryptable The meaning is clear, but does that word have a use? What could a piece of unencryptable data possibly be like? -- Greg -- https://mail.py

Re: functions, optional parameters

2015-05-08 Thread Gregory Ewing
Chris Angelico wrote: How do you know that the function's code object was created when compile() happened, rather than being created when the function was defined? Python 3.4.2 (default, Feb 4 2015, 20:08:25) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or

Re: (OT) Re: Encrypt python files

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 11:03 AM, Gregory Ewing wrote: > Dave Angel wrote: >> >> It'd be clearer if you used decryptable, since unencryptable has a very >> different meaning. >> >> http://en.wiktionary.org/wiki/unencryptable > > > The meaning is clear, but does that word have a use? > What could a

Re: functions, optional parameters

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 11:41 AM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> How do you know that the function's code >> object was created when compile() happened, rather than being created >> when the function was defined? > > > Python 3.4.2 (default, Feb 4 2015, 20:08:25) > [GCC 4.2.1 (

Re: Delivery Status Notification (Failure)

2015-05-08 Thread Steven D'Aprano
On Sat, 9 May 2015 09:02 am, Chris Angelico wrote: > Thanks, that saves me the trouble of wondering if they'll deal with > it. Flag as spam, folks, flag as spam. They breach protocol by not > accepting abuse@. OMG, you mean spammers ignore long standing Internet conventions for dealing with misus

Re: functions, optional parameters

2015-05-08 Thread Steven D'Aprano
On Sat, 9 May 2015 03:49 am, Chris Angelico wrote: > On Sat, May 9, 2015 at 3:36 AM, Steven D'Aprano > wrote: >> On Sat, 9 May 2015 02:02 am, Chris Angelico wrote: >>> Aside from constructing two closures in the same context and proving >>> that their __code__ attributes point to the same object,

Re: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

2015-05-08 Thread Steven D'Aprano
On Sat, 9 May 2015 06:39 am, zljubisic...@gmail.com wrote: > Thanks for clarifying. > Looks like the error message was wrong. No, the error message was right. Your problem was that you used backslashes in *Python program code*, rather than reading it from a text file. In Python, a string-litera

Re: Delivery Status Notification (Failure)

2015-05-08 Thread Chris Angelico
On Sat, May 9, 2015 at 12:37 PM, Steven D'Aprano wrote: > On Sat, 9 May 2015 09:02 am, Chris Angelico wrote: > >> Thanks, that saves me the trouble of wondering if they'll deal with >> it. Flag as spam, folks, flag as spam. They breach protocol by not >> accepting abuse@. > > OMG, you mean spammer

SSL Socket Error

2015-05-08 Thread shdwkeeper
Ive setup a Debian server with Python 2.7.9. Have everything running and SSL as well, but when I try and login to using HTTPS:// I get this error: Incoming web connection from ('192.168.15.177', 53202) error: uncaptured python exception, closing channel (:certfile must be specified for server-s

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Steven D'Aprano" wrote in message news:554cd119$0$12977$c3e8da3$54964...@news.astraweb.com... > On Fri, 8 May 2015 08:53 pm, Frank Millman wrote: > >>> Does z have to be a list? Could you use an empty tuple instead? >>> >>> def x(y, z=()): ... >>> >> >> That was Chris' suggestion as well (thank

Question on Pygame

2015-05-08 Thread Desmond Lim
I am trying to install pygame on my computer to get the webcame working. After going through the process on http://juliaelman.com/blog/2013/04/02/installing-pygame-on-osx-mountain-lio n/, I was able to download the required software and folders, but now I am met with this problem below with the SDL

calling base class method fetches no results

2015-05-08 Thread david jhon
Hello everyone, I am new to python and trying to run an example code from mininet tests. Basically, I am trying to call a method in Hcontroller.py from base class Routing defined in DCRouting.py which runs and fetches all the required results in install_reactive_path() method, but it returns None

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Frank Millman" wrote in message news:mik7j6$59n$1...@ger.gmane.org... > > "Steven D'Aprano" wrote in message > news:554cd119$0$12977$c3e8da3$54964...@news.astraweb.com... >> On Fri, 8 May 2015 08:53 pm, Frank Millman wrote: >> Does z have to be a list? Could you use an empty tuple instea