Re: [Tutor] How to handle a non integer within a question function that needs to return a integer?

2015-03-11 Thread Steven D'Aprano
On Wed, Mar 11, 2015 at 09:26:38PM +, Wibble wrote: [...] > How do I make it show a message to users saying only numbers excepted > and then the loop continues? > > I have tried this but same error is still generated. > > def user_choice(question, low, high, step = 1): > """Define user c

Re: [Tutor] file exists question

2015-03-11 Thread Steven D'Aprano
On Mon, Mar 09, 2015 at 08:51:52PM -0500, Zachary Ware wrote: > On Mar 9, 2015 7:25 PM, "Steven D'Aprano" wrote: > > What I really want is an option to open() that only > > opens a new file, and fails if the file already exists. > > If I'm not mistaken, this is the 'x' open mode, added in Python

Re: [Tutor] How linux software centers make “search” operation?

2015-03-11 Thread Steven D'Aprano
On Thu, Mar 12, 2015 at 01:21:40AM +0200, metis wisdom wrote: > Hello, I want to develop a software center in Ubuntu similar to Ubuntu > software center. In ubuntu software center, when we type a keyword and hits > enter button, it displays us the related results. For example, when i > searched for

Re: [Tutor] How linux software centers make “search” operation?

2015-03-11 Thread Ben Finney
metis wisdom writes: > Hello, I want to develop a software center in Ubuntu similar to Ubuntu > software center. Similar, but different in what way? > In ubuntu software center, when we type a keyword and hits enter > button, it displays us the related results. For example, when i > searched fo

Re: [Tutor] How linux software centers make “search” operation?

2015-03-11 Thread Dave Angel
On 03/11/2015 07:21 PM, metis wisdom wrote: Hello, I want to develop a software center in Ubuntu similar to Ubuntu software center. You forgot the rest of the caps. It's "Uuntu Software Center". Why? Is there something wrong with what it does, that you need something different? Is this ac

Re: [Tutor] How to handle a non integer within a question function that needs to return a integer?

2015-03-11 Thread Alan Gauld
On 11/03/15 21:26, Wibble wrote: def user_choice(question, low, high, step = 1): """Define user choice""" choice = None while choice not in range(low, high, step): choice = int(input(question)) return choice If user enters a string rather than a number it creates th

[Tutor] How linux software centers make “search” operation?

2015-03-11 Thread metis wisdom
Hello, I want to develop a software center in Ubuntu similar to Ubuntu software center. In ubuntu software center, when we type a keyword and hits enter button, it displays us the related results. For example, when i searched for "eclipse" keyword, 5 result are listed in ubuntu software center. I

[Tutor] How to handle a non integer within a question function that needs to return a integer?

2015-03-11 Thread Wibble
Dear All Very basic question from a newbie. I have defined a function for asking a question within a range def user_choice(question, low, high, step = 1): """Define user choice""" choice = None while choice not in range(low, high, step): choice = int(input(question)) ret

Re: [Tutor] Tuple indexing

2015-03-11 Thread Steven D'Aprano
On Wed, Mar 11, 2015 at 02:08:18PM +, Ian D wrote: [...] > I then read that a Tuple has no attribute index on this site > http://www.diveintopython.net/native_data_types/tuples.html That's pretty old, and written by an independent author. The official documentation for Python is here: https

Re: [Tutor] Idle - ImportError: No module named numpy

2015-03-11 Thread Markos
On 10-03-2015 16:48, Oscar Benjamin wrote: On 10 March 2015 at 13:59, Markos wrote: I don't have the python3-pip in the repository, then I downloaded the get-pip.py from: https://bootstrap.pypa.io/get-pip.py But when running the command "python3 get-pip.py" appears the error message (end

Re: [Tutor] Calculating and displaying students record in Python v12 (Odoo)

2015-03-11 Thread Alan Gauld
On 11/03/15 03:25, Elroi Henry wrote: I am working on a student management system for a primary school using Odoo (Python v12). I assume that's Odoo v12? Python is only at version 3.5... please am having problems with the report as certain fields are not being calculated. This list is for

Re: [Tutor] Idle - ImportError: No module named numpy

2015-03-11 Thread Alan Gauld
Please use ReplyAll to include the tutor list On 11/03/15 02:00, Jack Potrashitel wrote: Ok , thanks a lot. But I still in doubts :(. if self.root is None: self.root = BinaryNode( value ) else: self.root.add( value ) the object is created as BinaryNode(value ) only

Re: [Tutor] Tuple indexing

2015-03-11 Thread Peter Otten
Ian D wrote: > Hi > > > > I have seen some examples that seem to use a tuple with a method called > index() > > > The original code I was looking at had this sort of thing: > > > Hi Ian! Please don't use that much whitespace. It makes your post hard and unpleasant to read. Thank you. >

Re: [Tutor] Tuple indexing

2015-03-11 Thread Joel Goldstick
On Wed, Mar 11, 2015 at 10:08 AM, Ian D wrote: > Hi > > > > I have seen some examples that seem to use a tuple with a method called > index() > > > The original code I was looking at had this sort of thing: > > > > SENSORS = ('sensor1', 'sensor2') > > > SENSORS[0] > pin_index

[Tutor] Tuple indexing

2015-03-11 Thread Ian D
Hi I have seen some examples that seem to use a tuple with a method called index() The original code I was looking at had this sort of thing: SENSORS = ('sensor1', 'sensor2') pin_index = SENSORS.index("sensor1") so the result is that pin_index the is equal to 0 I the

[Tutor] Calculating and displaying students record in Python v12 (Odoo)

2015-03-11 Thread Elroi Henry
 Hello everyone, am a newbie in python programming language. I am working on a student management system for a primary school using Odoo (Python v12). please am having problems with the report as certain fields are not being calculated. Here is the link to the image of what I'm trying to achieve