Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Steven D'Aprano
On 30/04/13 08:00, Dave Angel wrote: One byte floating point? Nonsense. While it can be defined (see eryksun's response, which tracks the IEEE standard quite well), it wouldn't store enough precision to be used for anything but a toy. Minifloats have their uses. Probably the best use is te

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Oscar Benjamin
On 29 April 2013 22:03, eryksun wrote: > On Mon, Apr 29, 2013 at 12:16 PM, Alan Gauld > wrote: >>> I have to interpret a one-byte floating point number >> >> I'm curious, what does a one byte floating point number look like? >> I've never come across such a beast, the smallest FP representation

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Dave Angel
On 04/29/2013 10:28 AM, sparkle Plenty wrote: Hi, I need some hints on where to start solving this problem. I have to interpret a one-byte floating point number as a range between 0 and 240. This is for a gui that controls an amplifier. I am getting a value such as 0.8367 from a fader control,

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread eryksun
On Mon, Apr 29, 2013 at 12:16 PM, Alan Gauld wrote: >> I have to interpret a one-byte floating point number > > I'm curious, what does a one byte floating point number look like? > I've never come across such a beast, the smallest FP representation I've > come across is 16 bits or two bytes. But t

Re: [Tutor] does anyone know a good module for automation

2013-04-29 Thread Emile van Sebille
I recently automated a scheduled task to retrieve content from an https site that uses javascript for site interaction using iMacros, ahk and the related firefox extension. Not a python solution, but it got the job done. Emile On 4/26/2013 8:28 AM, Frank Schiro wrote: Pywinauto is not work

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Dave Angel
On 04/29/2013 12:31 PM, Joseph Parkton wrote: Yupp I totally agree on the errors. I finally had to change the def hotel_cost(nights): nights = nights * 140 return nights to def hotel_cost(nights): return hotel_cost(nights) * 140 for it to work. Strange errors

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-29 Thread boB Stepp
On Mon, Apr 29, 2013 at 4:08 AM, Alan Gauld wrote: > On 29/04/13 03:57, boB Stepp wrote: > [Major snip] > >> Unfortunately in most instances the window would have to be generated >> at runtime. > > > The whole window? Or just a panel within it? > If its only for display could you use formatted t

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Joseph Parkton
Yupp I totally agree on the errors. I finally had to change the def hotel_cost(nights): nights = nights * 140 return nights to def hotel_cost(nights): return hotel_cost(nights) * 140 for it to work. Strange errors but decent exercises for beginners. On Mon, Apr 29,

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Alan Gauld
On 29/04/13 15:28, sparkle Plenty wrote: Hi, I need some hints on where to start solving this problem. I have to interpret a one-byte floating point number I'm curious, what does a one byte floating point number look like? I've never come across such a beast, the smallest FP representation I've

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Chris “Kwpolska” Warrick
On Mon, Apr 29, 2013 at 5:28 PM, Joseph Parkton wrote: > I tried both suggestions from Chris and I get Oops, try again! Did you > create a function called trip_cost? Not really sure why Your problem is: codecademy is dumb and its errors are, too. >>> def trip_cost(city, days): ... totalCost

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Steven D'Aprano
On 30/04/13 00:28, sparkle Plenty wrote: Hi, I need some hints on where to start solving this problem. I have to interpret a one-byte floating point number as a range between 0 and 240. This is for a gui that controls an amplifier. I am getting a value such as 0.8367 from a fader control, and m

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Joseph Parkton
I tried both suggestions from Chris and I get Oops, try again! Did you create a function called trip_cost? Not really sure why On Mon, Apr 29, 2013 at 9:24 AM, Sacha Rook wrote: > Hi > Do you need to; > > return totalCost in the function trip_cost > > so when you call trip_cost(city, days) it

Re: [Tutor] Associate decimal values with an integer range

2013-04-29 Thread Oscar Benjamin
On 29 April 2013 15:28, sparkle Plenty wrote: > Hi, I need some hints on where to start solving this problem. > I have to interpret a one-byte floating point number as a range between 0 > and 240. This is for a gui that controls an amplifier. I am getting a > value such as 0.8367 from a fader co

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Sacha Rook
Hi Do you need to; return totalCost in the function trip_cost so when you call trip_cost(city, days) it gives you something back? Hope it helps S On 29 April 2013 16:15, Joseph Parkton wrote: > I am working on a codeacademy problem and I am stuck. The instructions are > as follows: > > INST

Re: [Tutor] Codeacademy Problem

2013-04-29 Thread Chris “Kwpolska” Warrick
On Mon, Apr 29, 2013 at 5:15 PM, Joseph Parkton wrote: > I am working on a codeacademy problem and I am stuck. The instructions are > as follows: > > INSTRUCTIONS > > Below your existing code, write a function called trip_cost that takes two > inputs, city and days. cityshould be the city that you

[Tutor] Codeacademy Problem

2013-04-29 Thread Joseph Parkton
I am working on a codeacademy problem and I am stuck. The instructions are as follows: INSTRUCTIONS Below your existing code, write a function called trip_cost that takes two inputs, city and days. cityshould be the city that you are going to visit and days should be the number of days that you a

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-29 Thread boB Stepp
Alan, I am at work now, so I will try to reply to those things I can answer quickly. Today is a full planning day, not a programming day! On Mon, Apr 29, 2013 at 4:08 AM, Alan Gauld wrote: >> my situations, it would have to result in the proper window generation >> with no tweaking. > > > Thats

[Tutor] Associate decimal values with an integer range

2013-04-29 Thread sparkle Plenty
Hi, I need some hints on where to start solving this problem. I have to interpret a one-byte floating point number as a range between 0 and 240. This is for a gui that controls an amplifier. I am getting a value such as 0.8367 from a fader control, and my Python is interpreting it as either a 0 o

Re: [Tutor] Helpful little book

2013-04-29 Thread ALAN GAULD
Apparently they have added an index. At least for the 4th edition that >I have for Python it contains a full index, which I go to all of the >time.You're right! I don't know why I thought they didn't have an index...  how odd. I just checked 4 of them and they all have indexes. Senility beckons!

Re: [Tutor] Helpful little book

2013-04-29 Thread boB Stepp
On Mon, Apr 29, 2013 at 4:16 AM, Alan Gauld wrote: > On 28/04/13 20:03, boB Stepp wrote: >> >> I have found the following book quite helpful and keep it handy: >> >> "Python Pocket Reference" by Mark Lutz, 4th ed., c. 2010. >> > > I have an earlier version but yes these pocket books byy O'reilly a

Re: [Tutor] point distance analysis

2013-04-29 Thread Alan Gauld
On 28/04/13 11:01, Ramy Brooks wrote: Hi I am looking for suggestions to fix my script to add an additional field. This looks like is more of an arcpy question than a Python one. I suggest you try the arcpy support fora. Meantime a quick comment on your code... def main(): pass if

Re: [Tutor] How to zoom in matplotlib without a mouse ?

2013-04-29 Thread Dave Angel
On 04/29/2013 05:07 AM, eryksun wrote: On Fri, Apr 26, 2013 at 4:50 PM, Peter Rowat wrote: To "zoom" a matplotlib graph, the matplotlib docs all say "use R mouse button". But my laptop has no mouse, only a touchpad (running OSX Mountain Lion). I've tried lots of "click plus key" combinations,

Re: [Tutor] point distance analysis

2013-04-29 Thread eryksun
On Sun, Apr 28, 2013 at 6:01 AM, Ramy Brooks wrote: > > Here is the script that I used and it calculates the distances that I was > trying to get, but I need to create an additional field in my table [] > import arcpy Try asking on the GIS Stack Exchange. Best of luck. http://gis.stackexchan

Re: [Tutor] Helpful little book

2013-04-29 Thread Alan Gauld
On 28/04/13 20:03, boB Stepp wrote: I have found the following book quite helpful and keep it handy: "Python Pocket Reference" by Mark Lutz, 4th ed., c. 2010. I have an earlier version but yes these pocket books byy O'reilly are generally useful once you know what to look for. The don't have

Re: [Tutor] Long post: How to design a Python program to generate GUI elements in a proprietary scripting language.

2013-04-29 Thread Alan Gauld
On 29/04/13 03:57, boB Stepp wrote: I'd suggest building a Python program that reads a resource file (maybe using the configparser module and data format? I am not familiar with this module. I will have to look up its documentation. Does it exist in Python 2.4? Yes, the format is essentially

Re: [Tutor] How to zoom in matplotlib without a mouse ?

2013-04-29 Thread eryksun
On Fri, Apr 26, 2013 at 4:50 PM, Peter Rowat wrote: > To "zoom" a matplotlib graph, the matplotlib docs all say "use R mouse > button". > > But my laptop has no mouse, only a touchpad (running OSX Mountain Lion). > I've tried lots of "click plus key" combinations, no luck yet. > > Any ideas? I'

[Tutor] point distance analysis

2013-04-29 Thread Ramy Brooks
Hi I am looking for suggestions to fix my script to add an additional field. Here is the script that I used and it calculates the distances that I was trying to get, but I need to create an additional field in my table that identifies the classification of the near_field ID so that I can use the v

[Tutor] How to zoom in matplotlib without a mouse ?

2013-04-29 Thread Peter Rowat
To "zoom" a matplotlib graph, the matplotlib docs all say "use R mouse button". But my laptop has no mouse, only a touchpad (running OSX Mountain Lion). I've tried lots of "click plus key" combinations, no luck yet. Any ideas? Thanks, Peter R ___ Tuto