Re: [Tutor] subprocess module: when to _NOT_ use shell=True

2013-03-10 Thread Eike Welk
On Sunday 10.03.2013 09:56:26 aklei...@sonic.net wrote: > I've not found anywhere a clear explanation of when not to set shell=True. > If the command line must be interpreted by the shell then clearly this > must be set. So the question that comes up is why not set it always? Because ``shell=True`

Re: [Tutor] Image Processing

2012-12-17 Thread Eike Welk
Hello Ashkan! On Saturday 15.12.2012 23:20:31 Ashkan Rahmani wrote: > I have developed some simple c++/qt/opencv application with face > detection functionality. > for some reasons I'm going to start again them and I wan to use python 3. > Unfortunately I found opencv not supported in python 3. >

Re: [Tutor] how to read two files and substitute

2011-05-19 Thread Eike Welk
Hello Lina! On Wednesday 18.05.2011 05:22:50 lina wrote: > May I ask another question: > > where I can get some advanced, terse and powerful python tutorials. > short but powerful and a bit hard to understand at first. The tutorial on Python's website is relatively terse, but it uses a simple

Re: [Tutor] System of ODEs Question

2011-02-03 Thread Eike Welk
Hello Eric! On Thursday 03.02.2011 08:05:13 Eric Lofgren wrote: > def eq_system(PopIn,x): > '''Defining SIR System of Equations''' > #Creating an array of equations > Eqs= np.zeros((3)) > Eqs[0]= -beta * PopIn[0]*PopIn[1] > Eqs[1]= beta * PopIn[0]*PopIn[1] - gamma*PopIn[1] >

Re: [Tutor] decimal module and precision

2011-01-31 Thread Eike Welk
Hello Richard! In your code: d(123.2345274523452345235432452345) you are entering the number as a `float` and you are loosing the precision already when the code is compiled. To retain the precision all constants must be entered as strings. For illustration see this part of an interactive

Re: [Tutor] Trying to parse a HUGE(1gb) xml file in python

2010-12-21 Thread Eike Welk
On Tuesday 21.12.2010 10:12:55 David Hutto wrote: > Then what other file medium would you suggest as the tagging means. One of those formats, that are specially designed for large amounts of data, is HDF5. It is intended for numerical data, but you can store text as well. There are multiple Pyth

Re: [Tutor] normalize an array

2010-11-27 Thread Eike Welk
Hello John! On Friday 26.11.2010 23:23:51 Peter Otten wrote: > John wrote: > > I know this is a simple problem, but I want to do it the most > > efficient way (that is vectorized...) > > > > import numpy as np > > > > a = np.array(([1,2,3,4],[1,.2,3,4],[1,22,3,4])) > > b = np.sum(a,axis=1) > >

Re: [Tutor] IDEs

2010-11-23 Thread Eike Welk
On Tuesday 23.11.2010 15:02:27 Josep M. Fontana wrote: > Does anybody know of any good reference on testing? How do you develop > tests for functions? I haven't found much information on this in the > Python books I own. The basic idea is to call your function with known inputs, and test if it ha

Re: [Tutor] Columnar Transposition Cipher question

2010-11-09 Thread Eike Welk
On Tuesday 09.11.2010 18:36:43 Stefan Behnel wrote: > Steven D'Aprano, 09.11.2010 05:01: > > http://pypi.python.org/pypi/obfuscate > > Hmm - why is the Windows installer on that page called "linux-i686"? It was probably created on Linux. Python's Distutils create installers for Windows even on L

Re: [Tutor] Distributing Python Code for Commercial Porpoises?

2010-08-08 Thread Eike Welk
Hello Alan! On Sunday August 8 2010 10:10:20 Alan Gauld wrote: > Yes thats a good point. Most books (including mine) focus on how to > write code. Very few tell you how to distrubute it! And that's not > just > in Python, most programming books are the same. > > Interesting. > > Alan G. Yes, I

Re: [Tutor] Order Of Operations Question

2010-07-28 Thread Eike Welk
Hello David! On Thursday July 29 2010 01:00:15 David Hutto wrote: > but as a quick question, why does: > >>> 5e18 == 5**18 > > False 5e18 is a short form of a somewhat complex term: 5e18 == 5 * 10**18 == 500 But 5**18 is just the exponentiation operator: 5**18 == 38146972656

Re: [Tutor] extract a submatrix

2010-07-12 Thread Eike Welk
Hello Bala! On Sunday July 11 2010 23:41:14 Bala subramanian wrote: > I have a > matrix of size 550,550. I want to extract only part of this matrix say > first 330 elements, i dnt need the last 220 elements in the matrix. is > there any function in numpy that can do this kind of extraction. I d

Re: [Tutor] Running a python script as root.

2010-07-05 Thread Eike Welk
Hello Srihari! On Sunday July 4 2010 20:17:12 Srihari k wrote: > I did #chmod +s settime.py so that SUID bit be set and all users can > execute the script and set the system time. > now the permissions of file are: > -rwsr-xr-x 1 root root 165 2010-07-04 23:16 settime.py > > > The script still w

Re: [Tutor] puzzled by Python 3's print()

2010-07-01 Thread Eike Welk
Hello Richard! On Thursday July 1 2010 15:11:21 Richard D. Moores wrote: > Thanks to yours and others responses, I've learned some things I > didn't know, but remember, I'm starting with long ints such as Also note that in Python 3 the "/" (division) operator returns a floating point number when

Re: [Tutor] class questions

2010-06-26 Thread Eike Welk
Hello Payal! On Saturday June 26 2010 19:05:16 Payal wrote: > Can we say that our own exception classes have only maybe a doc-string > and pass, nothing more? No, you let the exception transport the information that you need for handling the error. This is an exception that I use to transport us

Re: [Tutor] Use flag to exit?

2010-06-24 Thread Eike Welk
On Thursday June 24 2010 12:51:26 Richard D. Moores wrote: > On Thu, Jun 24, 2010 at 03:36, Eike Welk wrote: > > On Thursday June 24 2010 12:15:25 Richard D. Moores wrote: > >> OK. See <http://tutoree7.pastebin.com/v4T98iRL>. What now? > > > > Ah.

Re: [Tutor] Use flag to exit?

2010-06-24 Thread Eike Welk
On Thursday June 24 2010 12:15:25 Richard D. Moores wrote: > OK. See . What now? Ah... my bad. Line 8 must be changed to: self.big_p = big_p Eike. ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Use flag to exit?

2010-06-24 Thread Eike Welk
On Thursday June 24 2010 09:16:05 Richard D. Moores wrote: > I did what you said (), and get > "invalid syntax" for the comma in line 40. Are you using Python 3? (I'm using Python 2.6) For Python 3 the correct syntax of the except clause is: except FoundP

Re: [Tutor] Use flag to exit?

2010-06-23 Thread Eike Welk
On Thursday June 24 2010 07:31:47 Richard D. Moores wrote: > My question is how to best exit when the big prime has been found. I > used a flag (see the highlighted lines 34,40,44), but I seem to > remember that, though they can work, flags are frowned upon by > Pythonistas, and should be used only

Re: [Tutor] how to shelve classes

2010-06-18 Thread Eike Welk
On Friday June 18 2010 12:22:26 Payal wrote: > Hi, > I want to carry my classes around, so I wrote foo.py as, > > #!/usr/bin/python > > import pickle, shelve > > f = shelve.open('movies') > > class F(object) : > def __init__(self, amt) : self.amt = amt > def dis(self) : print 'Amount :

Re: [Tutor] pickling/shelve classes

2010-06-17 Thread Eike Welk
On Thursday June 17 2010 11:11:11 Eike Welk wrote: > You should file a bug report in their bug tracker: > http://github.com/ipython/ipython/issues I believe tthis is the bug: http://github.com/ipython/ipython/issues/#issue/29 It seems that objects defined on IPython's top-level can&#

Re: [Tutor] pickling/shelve classes

2010-06-17 Thread Eike Welk
Hello Payal! On Thursday June 17 2010 04:48:19 Payal wrote: > Hi all, > Can someone please help in this below? > > class F(object) : >...: def __init__(self, amt) : self.amt = amt >...: def dis(self) : print 'Amount : ', self.amt >...: def add(self, na) : >...:

[Tutor] OT: Great find!

2010-06-12 Thread Eike Welk
On Saturday June 12 2010 20:22:03 Wayne Werner wrote: > I want to do something like this: > http://www.kulturblog.com/2007/11/marshie-attacks-halloween-interactive-dri > veway-activity/ Great find! That's a very nice idea! Eike. ___ Tutor maillist -

Re: [Tutor] SENTINEL, & more

2010-05-29 Thread Eike Welk
Hey Denis! On Saturday May 29 2010 10:29:43 spir ☣ wrote: > I'll try to clarify the purpose and use of sentinels with an example. > Please, advanced programmers correct me. A point is that, in languages > like python, sentinels are under-used, because everybody tends to une None > instead, or

Re: [Tutor] object structure

2010-05-12 Thread Eike Welk
Hello Denis! On Wednesday May 12 2010 14:37:54 spir ☣ wrote: > class Integer(int): pass > i = Integer(1) > i.name = "one" > print i,i.name# --> "1 one" > > An instance of Integer has both a value 1 and a dict. Actually, one can do > more sophisticated things (below __new__ is needed bec

Re: [Tutor] Question about Python being object oriented

2010-05-08 Thread Eike Welk
On Saturday May 8 2010 18:19:53 Tino Dai wrote: > Hi Everybody, > > My friend and I were having a disagreement about Python. Has Python > always been an OO language or was it at one point a procedural language > like C? Thanks! The Wikipedia article states: Yes, it was always an object orie

[Tutor] Write a programming language! (Was: Iterating through a list of strings)

2010-05-05 Thread Eike Welk
Hello Thomas! On Monday May 3 2010 07:16:17 Thomas C. Hicks wrote: > I am using Python 2.6.4 in Ubuntu. Since I use Ubuntu (with its every > 6 months updates) and want to learn Python I have been working on a > post-install script that would get my Ubuntu system up and running with > my favorite

Re: [Tutor] Is there a better way to use scientific notation in an equation?

2010-05-02 Thread Eike Welk
On Sunday May 2 2010 22:44:42 David Hutto wrote: > Q1 and Q2 are to be entered as base ten scientific notation. > When I try to input Q1 as raw input, entering in ((2*(10**7)), I get: > > ValueError: invalid literal for int() with base 10: '((2)*(10**7))' > > Which is why I broke it down into it'

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Eike Welk
On Wednesday April 28 2010 20:57:27 C M Caine wrote: > Thank you all. One tangentially related question: what does (self, > *args, **kwargs) actually mean? How does one reference variables given > to a function that accepts these inputs? *args is a tuple containing the positional arguments; **kwa

Re: [Tutor] Modify inherited methods

2010-04-28 Thread Eike Welk
On Wednesday April 28 2010 13:04:30 Steven D'Aprano wrote: > On Wed, 28 Apr 2010 04:53:06 pm Walter Wefft wrote: > > Steven D'Aprano wrote: > > > And for guru-level mastery, replace to call to dict.__init__ with > > > ... > > > > nothing at all, because dict.__init__ doesn't do anything. > > [..

Re: [Tutor] Introduction to modelling with Python

2010-04-14 Thread Eike Welk
On Wednesday April 7 2010 11:38:07 AG wrote: > > Eike > > I just wanted to come back to you on the book recommendation you made > "Python scripting for computational science" - I tracked down a cheapish > copy of the 3rd edition from 2009 and flipping through it (it only > arrived yesterday), it

Re: [Tutor] Introduction to modelling with Python

2010-03-28 Thread Eike Welk
Also bookmark this page, it will be very useful once you have a little knowledge about Numpy: http://www.scipy.org/Numpy_Example_List_With_Doc This is the page that I use most often. Eike. ___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] Introduction to modelling with Python

2010-03-28 Thread Eike Welk
On Sunday March 28 2010 19:37:41 AG wrote: > Now that's looking very much along the lines of what I had in mind > Eike. Very pricey ... might have to sit on that one for a while and > scout around for a used copy. I can certainly use the on-line resource > for as many pages as it allows one to ac

Re: [Tutor] Introduction to modelling with Python

2010-03-28 Thread Eike Welk
On Saturday March 27 2010 16:21:26 AG wrote: > I apologise in advance for the vagueness of this query, but I am looking > for a decent modern introduction to modelling using Python. > Specifically, I want something that is a good introduction (i.e. doesn't > expect one to already be a maths/ statis

Re: [Tutor] Using Matplotlib - program still running when graph window is closed

2010-02-24 Thread Eike Welk
On Wednesday February 24 2010 11:23:18 AG wrote: > How does one ensure that once a graph has been produced by Matplotlib > and that graph has been closed by the user that the program itself stops? > > What I am currently getting is that when I close the graph pop-up window > and then close IDLE, I

Re: [Tutor] What Editori?

2010-02-24 Thread Eike Welk
On Wednesday February 24 2010 14:14:49 Giorgio wrote: > Yes i'm sure. I'm using the "tab button" and the same button works > perfectly in the IDLE editor. The editors could be configured differently with respect to the "tab button". Some may insert tabs some may insert spaces. EMACS can even

Re: [Tutor] Searchlight/MVPA/ValueError

2010-02-23 Thread Eike Welk
Hey J! On Monday February 22 2010 22:48:11 J wrote: > Dear all, > I am trying to run a very simple searchlight on fMRI data via PyLab (on Mac > Leopard). > > My code is as follows: > > from mvpa.suite import * > import os > from matplotlib.pyplot import figure, show > from mvpa.misc.io.base impo

Re: [Tutor] string to list

2010-02-10 Thread Eike Welk
On Wednesday February 10 2010 14:32:52 Owain Clarke wrote: > My son was doing a statistics project in which he had to sort some data by > either one of two sets of numbers, representing armspan and height of a > group of children - a boring and painstaking job. I came across this > piece of cod

Re: [Tutor] Closing a matplotlib window after show()

2010-02-08 Thread Eike Welk
Hello Wayne! On Monday February 8 2010 20:54:27 Wayne Watson wrote: > The basic problem is the show(). One person checked out the examples I > provided and found show() to operate fine. On my XP machine the program > I'm modifying has plot code someone put in a year or two ago, and it all > works

Re: [Tutor] language aid (various)

2010-02-06 Thread Eike Welk
On Friday February 5 2010 12:29:30 Owain Clarke wrote: > What a helpful forum - much thanks to all who've commented. Seems to be > a bit of a consensus here about dictionaries. Let me just restate my > reluctance, using examples from Spanish. > > esperar = to hope > esperar = to wait You could

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
On Wednesday February 3 2010 12:26:43 David wrote: > thanks for the explanation, all this is really helpful -- I certainly > have learned sth. today! > I wonder, though, how I would get my number pairs, which I need later > on, if I were to follow your solution. I am asking because as I > understan

Re: [Tutor] help with random.randint

2010-02-03 Thread Eike Welk
Hello David! On Wednesday February 3 2010 04:21:56 David wrote: > > import random > terms = [] > for i in range(2): > terms = random.randint(1, 99) > print terms Here is an other solution, which is quite easy to understand and short: import random terms = [] for i in range(2): terms

Re: [Tutor] Question about importing

2010-02-02 Thread Eike Welk
On Tuesday February 2 2010 20:28:03 Grigor Kolev wrote: > Can I use something like this > #-- > import sys > sys.path.append("/home/user/other") > import module > #- > Yes I think so. I just tried some

Re: [Tutor] python closures

2010-01-27 Thread Eike Welk
Hello Denis! On Monday November 30 2009 11:24:45 spir wrote: > which seems to indicate python really embeds "symbolic references" (*) to > outer *variables*, when creating a closure for g0. Not "pointer > references" (**), otherwise the replacement of x would not be seen by the > closure --like

Re: [Tutor] cxfreeze

2010-01-11 Thread Eike Welk
Hello Григор! On Monday January 11 2010 16:55:49 Григор wrote: > Hi. Can I make exe file from python script. With cxfreeze on Windows no > have problem. But how make exe on ubuntu. > On Linux programs are distributed as so called packages. A program called the package manager opens these packa

Re: [Tutor] question about for loops

2010-01-07 Thread Eike Welk
Hello Richard! On Thursday January 7 2010 13:43:26 Richard D. Moores wrote: > On p. 162 of "Programming In Python", 2nd ed., by Summerfield, the > section entitled "for Loops" begins: > > = > for expression in iterable: > for_suite > else: > else_

Re: [Tutor] Finding a repeating sequence of digits

2010-01-02 Thread Eike Welk
Hello Robert! On Saturday 02 January 2010, Robert Berman wrote: > Hi, > > I am trying to build an algorithm or methodology which will let me > tell if a decimal has a repeating sequence of digits If you are starting from fractions, I think you have to find the prime factors of the denominator. I

Re: [Tutor] Modules and Test Suites

2009-12-29 Thread Eike Welk
Hello Stephen! On Tuesday 29 December 2009, Stephen Nelson-Smith wrote: > I do quite a lot of programming in Ruby. When I do so, my code > tends to have the following layout: > > /path/to/src/my_project > > Inside my_project: > > lib/ > test/ > my_project.rb > > b) If so - how can I do it in Pyt

[Tutor] Polyfit works like this

2009-12-02 Thread Eike Welk
On Tuesday 01 December 2009, questions anon wrote: > I would now like to add a line of best fit. I think the command is > polyfit()?? > But I can't seem to get it to work These are the steps to make polyval work. I typed it into an 'ipython -pylab' session; I hope I included all relevant lines an

Re: [Tutor] numerical simulation + SQLite

2009-11-30 Thread Eike Welk
Hello Faisal! Just in case you don't know it, maybe Pytables is the right solution for you. It is a disk storage library specially for scientific applications: http://www.pytables.org/moin The makers claim, that it is fast. It has on the fly data compression which allegedly makes the library f

Re: [Tutor] python closures

2009-11-30 Thread Eike Welk
On Monday 30 November 2009, Hugo Arts wrote: > Consider this python session: > >>> x = 0 > >>> def f(): > > x = x + 1 > > >>> f() > > Traceback (most recent call last): > File "", line 1, in > f() > File "", line 2, in f > x = x + 1 > UnboundLocalError: local variable

Re: [Tutor] x is a global variable

2009-11-30 Thread Eike Welk
Hello Spir! On Monday 30 November 2009, spir wrote: > which seems to indicate python really embeds "symbolic references" > (*) to outer *variables*, when creating a closure for g0. Not > "pointer references" (**), otherwise the replacement of x would not > be seen by the closure --like in the case

Re: [Tutor] Alternatives to get IP address of a computer : which one should I use ?

2009-11-24 Thread Eike Welk
On Tuesday 24 November 2009, Shashwat Anand wrote: On my openSuse 11.0 machine your method doesn't work as intended: e...@lixie:~> python Python 2.5.2 (r252:60911, Dec 1 2008, 18:10:01) [GCC 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]] on linux2 Type "help", "copyright", "credi

[Tutor] Oh no! Wrong advice!

2009-10-16 Thread Eike Welk
Well, my ideas weren't so good: On Friday 16 October 2009, Eike Welk wrote: > I have an other idea for a color function. It cam be embedded in > the print statement because it returns an empty string: > > > def color(color_num): > '''Cha

Re: [Tutor] Understanding what the code does behind the scenes

2009-10-16 Thread Eike Welk
On Friday 16 October 2009, Katt wrote: > > print "There are", > > textcolor(4) > > print apples_left, > > textcolor(7) > > print "left in the basket." > > The above code is very easy to understand when looking at it, but > from what I see of other programmers this would not be as pythonic. I think

Re: [Tutor] writing sample program that zips files and saves in a backup directory

2009-10-13 Thread Eike Welk
Hello David! This is meant as an addition to Kent's remarks that 'gzip' is inappropriate, and you should use tar to create the archive. The 'tar' program can additionally use 'gzip' to compress the archive. A useful command would be: tar cvzf archive_name.tgz file_or_dir_1 file_or_dir_2 and_so

Re: [Tutor] New to python: some advises for image processing tool

2009-10-13 Thread Eike Welk
On Monday 12 October 2009, Nicola De Quattro wrote: > I've started to write something about input image loading and > rotation. My goal is that, from graphical interface, the user will > be able to rotate an image at steps (perhaps using two buttons) or > by entering the amount of degree the image

Re: [Tutor] New to python: some advises for image processing tool

2009-10-02 Thread Eike Welk
Hello Nicola! For scientific computing there are the Numpy and Scipy libraries: http://www.scipy.org/ For making graphs there is Matplotlib: http://matplotlib.sourceforge.net/ You should join the mailing lists of these projects. For the GUI I would use QT4: http://doc.trolltech.com/4.5/index.h

Re: [Tutor] real world decorators

2009-09-20 Thread Eike Welk
On Sunday 20 September 2009, John wrote: > Hi, > > I think I understand what decorators are and how they work. Maybe > it's just me but I don't know where I'd use them in my real world > programming. I see how they work with profile or coverage but does > anyone have real world uses. Frequently

Re: [Tutor] include remote module

2009-09-14 Thread Eike Welk
On Monday 14 September 2009, Alan Gauld wrote: > It would also save valuable bandwidth and session time. Thinking about it... One could send compressed differences to the version on the CD. Rpm has such a feature I think (Delta RPM, Patch RPM). Eike.

Re: [Tutor] include remote module

2009-09-13 Thread Eike Welk
On Saturday 12 September 2009, Patrick wrote: > Imagine if I gave a client a live Linux CD that automatically > called this sort of script right after boot up. They could have the > absolute most current version of an application from my server > launched on their box and if their data from that ap

Re: [Tutor] run command

2009-09-05 Thread Eike Welk
Hello Upasara! On Saturday 05 September 2009, upasara wulung wrote: > (1) In a certain working folder, I produced simple python file, for > an example, hello.py, which is free of error. > (2) I called python from the same working folder using command > 'python' (3) In the python shell, I executed:

Re: [Tutor] how do we represent left arrow key in python programming.

2009-08-21 Thread Eike Welk
On Friday 21 August 2009, Ajith Gopinath wrote: > Hi, > I just want to travese a text based menu.My prog. will login to a > text based app. and traverse its menu and clicks where i want to > be. rit now i find it sifficult to traverse the menu.I am but able > to click on the very first item.Will

[Tutor] Fwd: Re: curve fitting

2009-07-29 Thread Eike Welk
Forwarding Skipper's other message, which must have somehow been lost: -- Forwarded Message -- Subject: Re: [Tutor] curve fitting Date: Wednesday 29 July 2009 From: Skipper Seabold To: Eike Welk On Wed, Jul 29, 2009 at 9:42 AM, Eike Welk wrote: > On Wednesday 29 J

Re: [Tutor] curve fitting

2009-07-29 Thread Eike Welk
On Wednesday 29 July 2009, Eike Welk wrote: > You can use the Numpy/Scipy libraries for that. I think they have > examples for curve fitting on their website. This page contains examples: http://www.scipy.org/Cookbook/FittingData - Eike. ___

Re: [Tutor] curve fitting

2009-07-29 Thread Eike Welk
On Wednesday 29 July 2009, Bala subramanian wrote: > Friends, > > I wish to do some curve fitting with python by defining my own > equations. Could someone please give some guidance or examples on > doing the same. You can use the Numpy/Scipy libraries for that. I think they have examples for cur

Re: [Tutor] String manipulation: Pig latin translator

2009-07-12 Thread Eike Welk
Hello Eddie! On Sunday 12 July 2009, Eddie wrote: > Hi guys, > > What I have here is more of a logic problem that I can't get my > head around than a programming problem. I am trying to program an > English to Pig Latin translator. I've got the English to Pig Latin > part down and its working grea

Re: [Tutor] Stack unwind using exceptions.

2009-07-05 Thread Eike Welk
On Sunday 05 July 2009, Noufal Ibrahim wrote: > Kent Johnson wrote: > [..] > > > Why not just return the value from the function and pass it up > > the call chain? If a call fails return None. Something like this: > > That's what I ended up doing but the first thing occurred to me and > I was just

Re: [Tutor] how to manage an encrypted file?

2009-06-22 Thread Eike Welk
The method that Daniele describes is called encryption with a "One Time Pad". A somewhat readable description is in Wikipedia: http://en.wikipedia.org/wiki/One_time_pad This encryption method is a theoretically perfectly secure, but there are big organizational problems connected to its use. It

Re: [Tutor] Import package module problem

2009-05-12 Thread Eike Welk
Hello Manuel! On Tuesday 12 May 2009, man...@themacaque.com wrote: > I have actually rearranged my code to have such hierarchy which > obviously works. The problem is that I want ot be able to perform > unit tests withinn the package of the code. I keep having the > problem Use a test discovery

Re: [Tutor] testing framework

2009-04-29 Thread Eike Welk
Hello Spir! On Thursday 23 April 2009, spir wrote: > I would like to refactor tests of an application in a consistent > form. I have a ton of tests for each module, but they are all ad > hoc things. doctest looks great. The issue is it seems based on > command line-like testing: I have researched

Re: [Tutor] Testing Frameworks and Organizations

2009-04-23 Thread Eike Welk
Hello Spir; hello all! I have a similar question: For projects with multiple packages (directories) and modules (files); where do you put your testcode, what framework do you use, and what design patterns do you employ? I currently work on a project with one package and several modules. I us

Re: [Tutor] Tokenizing Help

2009-04-22 Thread Eike Welk
Hello William! On Wednesday 22 April 2009, William Witteman wrote: > The file format I am looking at (it is a bibliographic reference > file) looks like this: > > <1> # the references are enumerated > AU - some text > perhaps across lines > AB - some other text > AB - there ma

Re: [Tutor] Automated function creation / outsourcing code

2009-03-31 Thread Eike Welk
On Saturday 28 March 2009, Martin Klimach wrote: > Is there a python editor, that can automatically turn a selection > of code into a function? Matching the input and return variables? > Look at "Rope IDE" it is fairly good at refactoring. It is very ugly and not very comfortable, but it works. Du

Re: [Tutor] Properties of an object

2009-01-30 Thread Eike Welk
Hello Spir! On Friday 30 January 2009, spir wrote: > In a rather consistent approach, Python does not provide any > standard way to simply define/describe/structure an object -- or a > class. The added flexibility of Python gives great powers to the programmers of libraries. There is for examp

Re: [Tutor] What Centroid Algorithm Is This?

2009-01-26 Thread Eike Welk
On Monday 26 January 2009, Wayne Watson wrote: > the three def stmts below. Maybe someone can hazard a guess? It > looks like someone had fun doing this. First bookmark this webpage. It explains every important function in Numpy: http://www.scipy.org/Numpy_Example_List_With_Doc > def Centro

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread Eike Welk
You could use Qt and PyQt (bindings) for your application. QT is a library for buttons and similar things; it can show images, play video and play sound. They should both be part of every big Linux distribution. They are also available for Windows and Mac OS. http://doc.trolltech.com/4.4/inde

Re: [Tutor] Non-blocking non-interactive graphics display

2009-01-19 Thread Eike Welk
You should look at IPython it is a frontend for the Python interpreter that runs the eventloop of Matplotlib in a separate thread. http://ipython.scipy.org/moin/ http://matplotlib.sourceforge.net/ Matplotlib and Ipython might be in your Python distribution from Enthougt. A session with Ipytho

Re: [Tutor] python parser

2008-12-22 Thread Eike Welk
Hi John! I have written a (currently mostly defunct) compiler in Python for a specialized programming language. The parser may serve as an example for you. Introduction: http://freeode.berlios.de/ The parser: https://svn.berlios.de/wsvn/freeode/trunk/freeode_py/freeode/simlparser.py The meth

Re: [Tutor] reading output from a c executable.

2008-12-11 Thread Eike Welk
On Thursday 11 December 2008, Ravi Kondamuru wrote: > This was a great info exchange for me. > I am going to try out the all-python solution and see how it works > out. thank you all, You could try to optimize slow parts with the compiled Cython language. Nearly all Python code is legal Cython; b

Re: [Tutor] [Re: class/type methods/functions]

2008-11-23 Thread Eike Welk
Hey Spir! Maybe you should read the book "Design Patterns" from Erich Gamma and the rest of "the gang of four". (A.T.Hofkamp, mentioning its terminology, got me thinking.) You ask complicated questions that normal newbies don't ask, so you should maybe read an advanced book. The book's idea is

Re: [Tutor] Scrolling through output in shell

2008-11-18 Thread Eike Welk
On Monday 17 November 2008, ALAN GAULD wrote: > > I'm writing a program that reads a text file onto the screen. The > > text file is too large to read so I want to be able to scroll > > through it with the arrow key or something like that. I am not > > using GUI. You could also output the text, an

Re: [Tutor] fast list traversal

2008-10-30 Thread Eike Welk
Hello Dinesh! On Thursday 30 October 2008, Dinesh B Vadhia wrote: > Bob: Nothing special is being done on the elements of the list - > additions/subtractions/ - and storing the results in an array. > That's it. You could convert the list into a numpy array first, and you could try to express th

Re: [Tutor] please explain this error

2008-09-24 Thread Eike Welk
Hello Herold! I have three ideas what you could do: - Try to run the script on the server. Maybe even take NFS down while running the script. Or as a variation, run the script in a directory which is on the local disk. It seems the script is confused by some specific behavior of NFS. (There is

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-15 Thread Eike Welk
On Tuesday 12 August 2008, Jaggo wrote: > Hello. > > I haven't much experience with programming. > > I'd like to point this question to programmers who write in editors > other than the default PyWin32: > > Why do you use your editor rather than using Pywin? What feature > has editor X got that PyW

Re: [Tutor] Array filling

2008-07-03 Thread Eike Welk
On Thursday 03 July 2008 15:53, Brain Stormer wrote: > I am using numpy to create an array then filling some of the values > using a for loop, I was wondering if there is way to easily fill > the values without iterating through sort of like > "array.fill[start:stop,start:stop]"? The reason for my

Re: [Tutor] Controlling applications

2008-06-11 Thread Eike Welk
On Monday 09 June 2008 17:51, W W wrote: > Hi, > > I've done some cursory searches, and it doesn't appear that what I > want to do is popular, if it's even possible. > > I'm trying to control other applications via python (specifically > my web browser). > > My hope is there is some way to emulate

Re: [Tutor] Memory Leak?

2008-05-08 Thread Eike Welk
On Thursday 08 May 2008 00:03, Keith Suda-Cederquist wrote: > So I started commenting things out until I isolated the problem. > For some reason when I plot some of the data using > pylab/matplotlib, then close the figure using pylab.close() the > memory doesn't get cleared. (I left this part out

Re: [Tutor] Python to C++

2008-03-21 Thread Eike Welk
On Friday 21 March 2008 23:37, Dinesh B Vadhia wrote: > Thank-you for all the suggestions for converting to C/C++ which > will be followed up. > > Can we interface Python to a C++ library and if so how? > > Dinesh > If you have only few classes / member functions Boost-Python is a good solution.

Re: [Tutor] [tutor] Finding image statistics

2008-03-09 Thread Eike Welk
On Monday 10 March 2008 01:53, Varsha Purohit wrote: >  # read the ascii file >     hdr = read_ascii.header(inFile) >     temp= hdr[4].strip().split() # temp is a list which is > ['cellsize', '127'] >     cellsize = temp[1] "cellsize" is a character string I think! You must convert it to a number

Re: [Tutor] [tutor] PIL versus matlab

2008-02-18 Thread Eike Welk
On Sunday 17 February 2008 08:26, Varsha Purohit wrote: > Hello All, >I wanted to know what are the advantages and disadvantages > of using pIL instead of matlab software to deal to image > processing. PIL is for simple tasks like resizing images. It can read and write very many image for

Re: [Tutor] matrix-vector multiplication errors

2008-02-02 Thread Eike Welk
On Friday 01 February 2008 23:13, Dinesh B Vadhia wrote: > I've posted this on the Scipy forum but maybe there are answers on > Tutor too. I'm performing a standard Scipy matrix* vector > multiplication, b=Ax , (but not using the sparse module) with > different sizes of A as follows: > > > Assumin

Re: [Tutor] matrix-vector multiplication errors

2008-02-02 Thread Eike Welk
On Friday 01 February 2008 23:13, Dinesh B Vadhia wrote: > I've posted this on the Scipy forum but maybe there are answers on > Tutor too. I'm performing a standard Scipy matrix* vector > multiplication, b=Ax , (but not using the sparse module) with > different sizes of A as follows: > > > Assumin

Re: [Tutor] NumPy Question - numpy.put in multi-dimensional array

2007-11-13 Thread Eike Welk
Hello Bryan! On Wednesday 14 November 2007 00:18, Bryan Fodness wrote: > I see how to do it in a one-dimenstional array, but do not know the > syntax for the multi-dimensional case. > > >from numpy import * > > a = zeros((60,40), int) > > fields = {} > field = 10 > fields[field] = '30A', 5 > > iy

Re: [Tutor] a code question, but don't know question's name

2007-10-07 Thread Eike Welk
I have written the exact same reply. Sorry for that! I should have read the other replies first. Eike. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Logging with proper format

2007-10-07 Thread Eike Welk
On Sunday 07 October 2007 22:32, Kent Johnson wrote: > Eric Brunson wrote: > > claxo wrote: > >> dont indent the line after '\', that means 0 indent > >> > >> s = 'hello\ > >> boy' > > > > Or, arguably better: > > > > s = '''hello > > boy''' > And there is even a third way:-) >>> s = "hello " \ .

Re: [Tutor] a code question, but don't know question's name

2007-10-07 Thread Eike Welk
On Sunday 07 October 2007 21:29, Happy Deer wrote: > Thank all for the discussion. > Maybe I can separate my question into two. > > First, I have experience in Matlab, where I can use "eval". I > wonder whether someone knows about it. I suspect you are using Numpy, you should subscribe to the Nump

Re: [Tutor] Income calculator

2007-09-19 Thread Eike Welk
On Thursday 20 September 2007 01:00, Ulrich Holtzhausen wrote: > Non-working program: http://pastebin.com/f4da62e57 There seems to be a closing bracket ')' missing at the end of line 17. In line 18 there is a bracket missing too, in the code at pastebin, but nut in the error message. So this see

Re: [Tutor] [tutor] Reading/Writing Ascii text file

2007-09-18 Thread Eike Welk
On Tuesday 18 September 2007 04:06, Varsha Purohit wrote: > I wanted a link or tutorial to help me understand how to read > or write ascii text file in python. with and without using Numpy. If you want to save a Numpy array as a text file, goto this web-page: http://www.scipy.org/Numpy_Examp

Re: [Tutor] Image Analysis

2007-09-12 Thread Eike Welk
On Wednesday 12 September 2007 05:09, Dave Kuhlman wrote: > Please do not stuff 1 MB emails in my mailbox. Either (1) post the > images on the Web and provide a link or (2) ask before emailing > large attachments. Sorry! I guess I'm spoiled by my ADSL connection. I did not know that the limit is

  1   2   >