Re: [OT] Question about Git branches

2014-09-15 Thread Ben Finney
"Frank Millman" writes: > I know there some Git experts on this list, so I hope you don't mind > me posting this question here. I do. There may be experts on parquetry flooring in this forum, but a topic is not on-topic merely because some people here may know about it. Please engage with the G

[OT] Question about Git branches

2014-09-15 Thread Frank Millman
Hi all I know there some Git experts on this list, so I hope you don't mind me posting this question here. I am slowly getting comfortable with Git, but there is something that confuses me. You are encouraged to make liberal use of 'branches', and if required you can have multiple branches ru

Re: What's the function location that reads the cached .pyc file from disk.

2014-09-15 Thread dieter
Shiyao Ma writes: > what's the location of the function that reads the .pyc file ? > > I bet it should lie in somewhere in > https://hg.python.org/cpython/file/322ee2f2e922/Lib/importlib > > But what's the actual location? Maybe, you look at the "importlib" source? Note: the function you search

Re: List insert at index that is well out of range - behaves like append that too SILENTLY

2014-09-15 Thread dieter
Harish Tech writes: > Let me demonstrate the problem I encountered : > > I had a list > > a = [1, 2, 3] > > when I did > > a.insert(100, 100) > > [1, 2, 3, 100] > > as list was originally of size 4 and I was trying to insert value at index > 100 , it behaved like append instead of throwing any e

Re: functools.wraps behaviour

2014-09-15 Thread Ian Kelly
On Mon, Sep 15, 2014 at 5:15 PM, ISE Development wrote: > The first two lines are as expected, using the name of the decorated > function. However, the exception uses the name of the decorating wrapper > function. > > Is this a bug in functools? Or is this a language feature? If so, is there a > v

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Chris Angelico
On Tue, Sep 16, 2014 at 11:02 AM, Josh English wrote: > I deleted the original post because I had figured out what I had changed. This is primarily a newsgroup and a mailing list. You can't delete posts. The best thing to do is to send a follow-up explaining that you no longer need answers. Chri

Re: python script monitor

2014-09-15 Thread William Ray Wing
On Sep 15, 2014, at 8:07 PM, Nicholas Cannon wrote: > I have made an app that is not fully stable and I would like to monitor the > performance of the app and try and improve the speed of it. I tried to use > the activity monitor on the mac but what I want I'm to see how much ram, cup > and ot

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Josh English
On Sunday, September 14, 2014 10:59:07 AM UTC-7, Terry Reedy wrote: > On 9/14/2014 2:44 AM, Josh English wrote: > > > To the best of my knowledge, protocol.py, brine.py, compat.py, are not > part of the stdlib. What have you installed other than Python? What > editor/IDE are you using? Check y

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Josh English
On Monday, September 15, 2014 12:12:50 PM UTC-7, Emile van Sebille wrote: > > That's your clue -- I'd take a close look at the last changes you made a > result of which caused this failure and apparent looping. > It's easy to lay blame on the (whatever) library and look for a root > cause there

Re: functools.wraps behaviour

2014-09-15 Thread Chris Angelico
On Tue, Sep 16, 2014 at 9:15 AM, ISE Development wrote: > @functools.wraps(func) > def wrapper(self): > func(self) > return wrapper > > try: > k.method(1) > except Exception as e: > print('exception:',e) > > The output (Python 3.3) is: >

Re: python script monitor

2014-09-15 Thread Chris Angelico
On Tue, Sep 16, 2014 at 10:07 AM, Nicholas Cannon wrote: > I have made an app that is not fully stable and I would like to monitor the > performance of the app and try and improve the speed of it. I tried to use > the activity monitor on the mac but what I want I'm to see how much ram, cup > an

python script monitor

2014-09-15 Thread Nicholas Cannon
I have made an app that is not fully stable and I would like to monitor the performance of the app and try and improve the speed of it. I tried to use the activity monitor on the mac but what I want I'm to see how much ram, cup and other stats on what resources that app is using. Is there any ap

functools.wraps behaviour

2014-09-15 Thread ISE Development
The purpose of 'functools.wraps' is to make a decorated function look like the original function, i.e. such that the __name__, __module__, __doc__ attributes are the same as the wrapped function. However, I've noticed inconsistent behaviour. Given the following: import functools def d

Re: PyCharm refactoring tool?

2014-09-15 Thread Stefan Behnel
George Silva schrieb am 15.09.2014 um 21:49: > It's pretty useful. I use it for some time now and I very much like it. > [...] > The most powerful for me are the rename refactor and extract. Works like > charm (no pun intended). Dito. > On Mon, Sep 15, 2014 at 4:44 PM, Skip Montanaro wrote: >>

Re: PyCharm refactoring tool?

2014-09-15 Thread George Silva
It's pretty useful. I use it for some time now and I very much like it. There are some things that might not be available on Python because of it's duck typing behavior (Pycharm perhaps can't confirm that the type is boolean to suggest it's inversion, for instance). The most powerful for me are t

PyCharm refactoring tool?

2014-09-15 Thread Skip Montanaro
I started up an instance of PyCharm last Friday. It's mostly just been sitting there like a bump on a log. I set things up to use Emacs as my editor. It seems most of its functionality won't be all that useful. Most of my work is on libraries/platforms - stuff which is not runnable in isolation, so

Re: Storing instances using jsonpickle

2014-09-15 Thread Josh English
On Wednesday, September 3, 2014 7:19:07 PM UTC-7, Ned Batchelder wrote: > Typically, you need to decide explicitly on a serialized representation > for your data. Even if it's JSON, you need to decide what that JSON > looks like. Then you need to write code that converts the JSON-able > data

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Emile van Sebille
On 9/13/2014 11:44 PM, Josh English wrote: I do not know what these three filesare doing, but suddenly they have caught in a loop every time I try to run some code. This is where I managed to send a keybord interrupt. I was working just fine, tweaking a line, running the code, tweaking a l

Re: Lists

2014-09-15 Thread Peter Otten
Ian Kelly wrote: > On Mon, Sep 15, 2014 at 1:36 AM, Peter Otten <__pete...@web.de> wrote: >> I'd call range() an iterable. > > I'd even go so far as to call it a sequence. > from collections import Sequence issubclass(range, Sequence) > True If you want to be as specific as possible c

Re: Lists

2014-09-15 Thread Ian Kelly
On Mon, Sep 15, 2014 at 1:36 AM, Peter Otten <__pete...@web.de> wrote: > I'd call range() an iterable. I'd even go so far as to call it a sequence. >>> from collections import Sequence >>> issubclass(range, Sequence) True -- https://mail.python.org/mailman/listinfo/python-list

Re: Lists

2014-09-15 Thread Seymore4Head
On Mon, 15 Sep 2014 16:59:36 +1000, Steven D'Aprano wrote: >Seymore4Head wrote: > >> import random >> nums=range(1,11) >> print (nums) >> samp=random.sample(nums,10) >> top=nums >> newlist=nums[::-1] >> tail=newlist >> >> for x in range(10): >> print ("Top {:2d}Tail {:2.0f} Sample {:2d}

Re: Lists

2014-09-15 Thread Seymore4Head
On Mon, 15 Sep 2014 09:05:50 -0400 (EDT), Dave Angel wrote: >Seymore4Head Wrote in message: >> import random >> nums=range(1,11) >> print (nums) >> samp=random.sample(nums,10) >> top=nums >> newlist=nums[::-1] >> tail=newlist >> >> for x in range(10): >> print ("Top {:2d}Tail {:2.0f} S

__import__(name, fromlist=...), was Re: Shuffle

2014-09-15 Thread Peter Otten
Steven D'Aprano wrote: > A serious question -- what is the point of the fromlist argument to > __import__? It doesn't appear to actually do anything. > > > https://docs.python.org/3/library/functions.html#__import__ It may be for submodules: $ mkdir -p aaa/bbb $ tree . └── aaa └── bbb 2 d

What's the function location that reads the cached .pyc file from disk.

2014-09-15 Thread Shiyao Ma
Hi. what's the location of the function that reads the .pyc file ? I bet it should lie in somewhere in https://hg.python.org/cpython/file/322ee2f2e922/Lib/importlib But what's the actual location? Btw, why I need it? I want to know the structure of a .pyc file. Of course the function that read

Re: Python 3.3.2 help

2014-09-15 Thread Steven D'Aprano
Hello David, and thanks for replying. More comments below. D Moorcroft wrote: > Hi, > > We are using windows 7 and it is all pupils as they are more restricted > than staff. > > They are using the python 3.3.2 shell and trying to print from there What you are describing does not sound like the

Re: Shuffle

2014-09-15 Thread Steven D'Aprano
Dave Angel wrote: > Michael Torrie Wrote in message: >> You can do it two ways: >> Refer to it as random.shuffle() >> >> or >> >> from random import shuffle >> >> I tend to use the first method (random.shuffle). That way it prevents >> my local namespace from getting polluted with random sym

Re: Shuffle

2014-09-15 Thread Dave Angel
Michael Torrie Wrote in message: > On 09/13/2014 05:47 PM, Seymore4Head wrote: >> Here is a screenshot of me trying Dave Briccetti's quiz program from >> the shell and it (the shuffle command) works. >> https://www.youtube.com/watch?v=VR-yNEpGk3g >> http://i.imgur.com/vlpVa5i.jpg >> >> Two questi

Re:protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Dave Angel
Dave Angel Wrote in message: > Josh English Wrote in message: >> I do not know what these three filesare doing, but suddenly they have caught >> in a loop every time I try to run some code. >> >> I grabbed the trace decorator from the python library and this is the last >> bit of the output: >

Re:CSV methodology

2014-09-15 Thread Dave Angel
je...@newsguy.com Wrote in message: > > Hello. Back in the '80s, I wrote a fractal generator, which, over the years, > I've modified/etc to run under Windows. I've been an Assembly Language > programmer for decades. Recently, I decided to learn a new language, > and decided on Python, and I jus

Re: Python 3.3.2 help

2014-09-15 Thread D Moorcroft
Hi, We are using windows 7 and it is all pupils as they are more restricted than staff. They are using the python 3.3.2 shell and trying to print from there Thank you, David Moorcroft ICT Operations Manager & Website Manager Turves Green Girls' School - Original Message - From: "Steve

Re:protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Dave Angel
Josh English Wrote in message: > I do not know what these three filesare doing, but suddenly they have caught > in a loop every time I try to run some code. > > I grabbed the trace decorator from the python library and this is the last > bit of the output: > > > trollvictims.py(129):

Re:Lists

2014-09-15 Thread Dave Angel
Seymore4Head Wrote in message: > import random > nums=range(1,11) > print (nums) > samp=random.sample(nums,10) > top=nums > newlist=nums[::-1] > tail=newlist > > for x in range(10): > print ("Top {:2d}Tail {:2.0f} Sample {:2d} > ".format(top[x],tail[x],samp[x])) > > I don't understa

Re: Marco's atexit issue was: Re: ANN: wxPython 3.0.1.1

2014-09-15 Thread Marco Prosperi
all the code addressed by the exception is out of my source. I don't have any atexit.register in my code Marco On Friday, September 12, 2014 6:33:09 PM UTC+2, Nathan McCorkle wrote: > > > > On Friday, September 12, 2014 1:14:41 AM UTC-7, Marco Prosperi wrote: >> >> >> I'm trying to pass my appl

List insert at index that is well out of range - behaves like append that too SILENTLY

2014-09-15 Thread Harish Tech
Hi , Let me demonstrate the problem I encountered : I had a list a = [1, 2, 3] when I did a.insert(100, 100) [1, 2, 3, 100] as list was originally of size 4 and I was trying to insert value at index 100 , it behaved like append instead of throwing any errors as I was trying to insert in an

something like pyfilesystem, fs.zipfs that works on windows

2014-09-15 Thread Nagy László Zsolt
I need something that is similar to zipfs, but it should work on Windows and Unix too. Requirements: * store a complete directory structure and multiple files in a single file * be able to add, replace and delete files and directories * binary write/append to files is NOT a requirement but it w

Re: Lists

2014-09-15 Thread Peter Otten
Christian Gollwitzer wrote: > Am 15.09.14 04:40, schrieb Seymore4Head: >> nums=range(1,11) >> print (nums) > >> I don't understand why the command nums=range(1,11) doesn't work. >> I would think that print(nums) should be 1,2,3 ect. >> Instead it prints range(1,11) > > It does work, but in a dif

Re: CSV methodology

2014-09-15 Thread Peter Otten
jayte wrote: > Sorry, I neglected to mention the values' significance. The MXP program > uses the "distance estimate" algorithm in its fractal data generation. > The values are thus, for each point in a 1778 x 1000 image: > > Distance, (an extended double) > Iterations, (a 16 bit int) > zc_x

Lists

2014-09-15 Thread Seymore4Head
import random nums=range(1,11) print (nums) samp=random.sample(nums,10) top=nums newlist=nums[::-1] tail=newlist for x in range(10): print ("Top {:2d}Tail {:2.0f} Sample {:2d} ".format(top[x],tail[x],samp[x])) I don't understand why the command nums=range(1,11) doesn't work. I would

Re: CSV methodology

2014-09-15 Thread Akira Li
je...@newsguy.com writes: > Hello. Back in the '80s, I wrote a fractal generator, which, over the years, > I've modified/etc to run under Windows. I've been an Assembly Language > programmer for decades. Recently, I decided to learn a new language, > and decided on Python, and I just love it, a

Re: Lists

2014-09-15 Thread Steven D'Aprano
Christian Gollwitzer wrote: > range() does > not return a list of numbers, but rather a generator Technically, it's not a generator. It's a range object. Generators can return anything, and you have to program them by using yield: def gen(): yield 1 yield 2 if today() is Tuesday:

Re: Lists

2014-09-15 Thread Steven D'Aprano
Seymore4Head wrote: > import random > nums=range(1,11) > print (nums) > samp=random.sample(nums,10) > top=nums > newlist=nums[::-1] > tail=newlist > > for x in range(10): > print ("Top {:2d}Tail {:2.0f} Sample {:2d} > ".format(top[x],tail[x],samp[x])) > > I don't understand why the