Re: python unit test frame work

2015-12-10 Thread Cameron Simpson
On 11Dec2015 14:09, Ben Finney wrote: Cameron Simpson writes: First, as Ben remarks, if one test _depends_ on an earlier one then it isn't a real unit test. On the other hand, if you simply have some simple tests followed by more complex tests (I have several like this) you have two facilitie

Re: real usable file/directory operation module?

2015-12-10 Thread Cameron Simpson
On 11Dec2015 11:04, oyster wrote: there is shutil module, but I find it limits the user heavily. For example, I want to move 2 directories "a/scene" and "c/scene" to "d", but there is "scene" under d already. Then shutil.move will raise Error, "Destination path '%s' already exists" % real_dst S

Re: python unit test frame work

2015-12-10 Thread Ben Finney
Cameron Simpson writes: > First, as Ben remarks, if one test _depends_ on an earlier one then it > isn't a real unit test. > > On the other hand, if you simply have some simple tests followed by > more complex tests (I have several like this) you have two facilities > to help you. > > Firstly, I

real usable file/directory operation module?

2015-12-10 Thread oyster
there is shutil module, but I find it limits the user heavily. For example, I want to move 2 directories "a/scene" and "c/scene" to "d", but there is "scene" under d already. Then shutil.move will raise Error, "Destination path '%s' already exists" % real_dst So is there any module, which allow me

Re: How to use internal python c funtions, from python code

2015-12-10 Thread srinivas devaki
Thank you Chris, later I decided that this would be cheating and I have to think about another algorithmic approach. most of the competitive programming platforms provide python with a time limit of 5 times of c/c++ time limit. but in many cases like if the algorithms are recursive(like segment

Re: python unit test frame work

2015-12-10 Thread Cameron Simpson
On 11Dec2015 04:05, Ganesh Pal wrote: On Dec 11, 2015 3:57 AM, "Ganesh Pal" wrote: > Drop the habit to sprinkle sys.exit() all over the place. A well-behaved > application has one exit point, at the end of the main module. I was using sys.exit() as the means to stop the execution or termina

Re: python unit test frame work

2015-12-10 Thread Ben Finney
Ganesh Pal writes: > I have multiple checks if I don't meet them continuing with the main > program doesn't make sense That means these are not unit tests (which are isolatable, independent test cases). If the tests are best characterised as a sequence of steps, then the ‘unittest’ model (desig

Re: python unit test frame work

2015-12-10 Thread Ganesh Pal
+python list . sorry I accidentally did a reply to Peter. On Dec 11, 2015 3:57 AM, "Ganesh Pal" wrote: > > > > Drop the habit to sprinkle sys.exit() all over the place. A well-behaved > > application has one exit point, at the end of the main module. > I was using sys.exit() as the means to stop

Re: np.searchSorted over 2D array

2015-12-10 Thread Oscar Benjamin
On 10 Dec 2015 14:46, "Heli" wrote: > > Thanks Peter, > > I will try to explain what I really need. > > I have a 3D numpy array of 100*100*100 (1M elements). Then I have another numpy array of for example 10*2*10 (200 elements). I want to know if in the bigger dataset of 100*100*100, there is anyw

testfixtures 4.7.0 Released!

2015-12-10 Thread Chris Withers
Hi All, I'm pleased to announce the release of testfixtures 4.7.0. Since 4.5.1, the following have been added: - Add the ability to pass raises=False to compare() to just get the resulting message back rather than having an exception raised. - Fix a bug that mean symlinked directories would

Re: Administrators and moderators of Python-list, please erase all the messages that I not should have posted here in python-list!

2015-12-10 Thread Michael Torrie
On 12/10/2015 07:44 AM, françai s wrote: > Administrators and moderators of Python-list, please erase all the messages > that I not should have posted here in python-list. > > I ask this because I probably be in future a good programmer famous and I > do not want to talk about the topics that I s

Re: Administrators and moderators of Python-list, please erase all the messages that I not should have posted here in python-list!

2015-12-10 Thread Michael Torrie
On 12/10/2015 07:44 AM, françai s wrote: > Administrators and moderators of Python-list, please erase all the messages > that I not should have posted here in python-list. > > I ask this because I probably be in future a good programmer famous and I > do not want to talk about the topics that I s

Re: non-blocking getkey?

2015-12-10 Thread Ulli Horlacher
Ulli Horlacher wrote: > My idea now is: instead of raw_input() I use a get_paste() function, which > reads input character for input character and after a (say) 1 s timeout it > returns the string. Pasting a string with the mouse is rather fast, there > should be no big delay between the characte

Re: python unit test frame work

2015-12-10 Thread Peter Otten
Ganesh Pal wrote: > Hello Team, > > Iam on python 2.7 and linux. Iam trying to understand the python unit > test frame work and also trying to fix the below code , any help in > this regard would be appreciated ? I recommend that you reread the unittest documentation. setUpClass() should be a

Re: Administrators and moderators of Python-list, please erase all the messages that I not should have posted here in python-list!

2015-12-10 Thread Nick Sarbicki
Great, now I have something I can use as blackmail when you are a rich and famous programmer! /s Joking aside, don't worry about embarrassing questions from your past. We've all had a journey to being programmers and we've all done dumb things. If anything, by trying to cover up your past you wil

python unit test frame work

2015-12-10 Thread Ganesh Pal
Hello Team, Iam on python 2.7 and linux. Iam trying to understand the python unit test frame work and also trying to fix the below code , any help in this regard would be appreciated ? # Sample code starts here inject_failure = {} report = "" ClassIsSetup = False ClassCleanup = F

Administrators and moderators of Python-list, please erase all the messages that I not should have posted here in python-list!

2015-12-10 Thread françai s
Administrators and moderators of Python-list, please erase all the messages that I not should have posted here in python-list. I ask this because I probably be in future a good programmer famous and I do not want to talk about the topics that I should not have posted here in python-list. I decid

Re: np.searchSorted over 2D array

2015-12-10 Thread Heli
Thanks Peter, I will try to explain what I really need. I have a 3D numpy array of 100*100*100 (1M elements). Then I have another numpy array of for example 10*2*10 (200 elements). I want to know if in the bigger dataset of 100*100*100, there is anywhere, where the second numpy array of 200

Re: Python variable assigning problems...

2015-12-10 Thread Denis McMahon
On Wed, 09 Dec 2015 09:49:26 -0800, ICT Ezy wrote: > Pl refer question which attached image here: > > link: https://drive.google.com/open?id=0B5L920jMv7T0dFNKQTJ2UUdudW8 I can't access the image with my G+ account because the image owner hasn't given me permission. Perhaps you'd like to post a

Re: Getting data out of Mozilla Thunderbird with Python?

2015-12-10 Thread Thomas 'PointedEars' Lahn
Michael Torrie wrote: > It's good to know I can configure Thunderbird to use maildir for local > storage. I'll have to make the change here. Will make my backups a lot > easier and faster. But see also . Not all of those bugs have been resolved/fi

Re: SystemError in python 2.5.4

2015-12-10 Thread Chris Angelico
On Fri, Dec 11, 2015 at 12:14 AM, Palpandi wrote: > ChrisA, Thanks for your quick response. > I am using Windows and we are using 2.5.4 only. > Is there any workaround? I wouldn't know. All I know is, upgrading to 2.7 gives you a lot of other improvements too, so unless there's something serious

Re: SystemError in python 2.5.4

2015-12-10 Thread Palpandi
On Thursday, December 10, 2015 at 5:08:05 PM UTC+5:30, Chris Angelico wrote: > On Thu, Dec 10, 2015 at 10:29 PM, Palpandi wrote: > > Hi All, > > > > I am getting the error mentioned below in python 2.5.4. > > > > SystemError: \loewis\25\python\Objects\longobject.c:225: bad argument to > > interna

IO Redirection to Console

2015-12-10 Thread austin aigbe
Hello, I am trying to port the following C++ code for IO redirection to console. // C++ (from Synfig) void redirectIOToConsole() { int hConHandle; HANDLE lStdHandle; CONSOLE_SCREEN_BUFFER_INFO coninfo; FILE *fp; // allocate console if( GetStdHandl

Re: SystemError in python 2.5.4

2015-12-10 Thread Chris Angelico
On Thu, Dec 10, 2015 at 10:29 PM, Palpandi wrote: > Hi All, > > I am getting the error mentioned below in python 2.5.4. > > SystemError: \loewis\25\python\Objects\longobject.c:225: bad argument to > internal function. > > I also ran the same code in python 2.7. > There I am not getting this error

SystemError in python 2.5.4

2015-12-10 Thread Palpandi
Hi All, I am getting the error mentioned below in python 2.5.4. SystemError: \loewis\25\python\Objects\longobject.c:225: bad argument to internal function. I also ran the same code in python 2.7. There I am not getting this error. I don't know which causes this error. Any solution for this? N

Re: Problems using celery and pyelasticsearch

2015-12-10 Thread nonami
On 07/12/2015 02:50, Laura Creighton wrote: In a message of Mon, 07 Dec 2015 02:37:15 +0100, nonami writes: Does anyone have any idea what could be going on or how I can further inspect running tasks. Not sure this will help, but it might ... https://www.caktusgroup.com/blog/2013/10/30/using

Re: non-blocking getkey?

2015-12-10 Thread Ulli Horlacher
Christian Gollwitzer wrote: > Another cheap solution comes to mind: On windows, dropping files onto an > icon on the desktop is interpreted as "launch the program with > additional arguments", where the arguments are the file names. Ohhh... great! This helps me a lot! > Maybe you could try i

Re: non-blocking getkey?

2015-12-10 Thread Ulli Horlacher
Christian Gollwitzer wrote: > > My users do not like it :-( > > They want to drag&drop files. > > Therefore I have added it as another option to enter files: > > > > [f] select a file > > [d] select a directory > > [e] enter a file or directory (with drag&drop or copy&paste) >

tkinter cascaded menus, was Re: PyTk cascaded radiobuttons, howto?

2015-12-10 Thread Peter Otten
nickgeova...@gmail.com wrote: > Using python 3.4.2. > Tcl/tk example here is from /usr/share/tk8.5/demos/widget and > .../menu.tcl. The way tcl/tk adds cascaded radiobuttons to a menu is like > this: set m $w.menu.cascade > $w.menu add cascade -label "Cascades" -menu $m -underline 0 > > $m ad

Re: non-blocking getkey?

2015-12-10 Thread Christian Gollwitzer
Am 10.12.15 um 09:28 schrieb Ulli Horlacher: Ulli Horlacher wrote: My users do not like it :-( They want to drag&drop files. Another cheap solution comes to mind: On windows, dropping files onto an icon on the desktop is interpreted as "launch the program with additional arguments", where th

Re: non-blocking getkey?

2015-12-10 Thread Christian Gollwitzer
Am 10.12.15 um 09:28 schrieb Ulli Horlacher: Ulli Horlacher wrote: Found it: from Tkinter import Tk from tkFileDialog import askopenfilename Tk().withdraw() file = askopenfilename() My users do not like it :-( They want to drag&drop files. Therefore I hav

Re: non-blocking getkey?

2015-12-10 Thread Ulli Horlacher
Ulli Horlacher wrote: > > But... is there a windows program with which one can select files and the > > result is written to STDOUT? > > Found it: > > from Tkinter import Tk > from tkFileDialog import askopenfilename > > Tk().withdraw() > file = askopenfilename(