Re: RESTful API for own python application

2013-02-02 Thread dieter
Julio F Schwarzbeck writes: > I am developing an application, the application stores small text > snippets (think of something similar to evernote), and it has the > standard CRUD operations of any other application. > > Now my question is, how much would you recommend creating the entire > CRUD

Re: Please provide a better explanation of tuples and dictionaries

2013-02-02 Thread Chris Angelico
On Sun, Feb 3, 2013 at 6:14 PM, Michael Torrie wrote: > TL;DR: I find your list freezing proposal to be needlessly complicated. > No the burden of proof is not on me to explain why tuples are so. We have a list-freezing mechanism already. >>> list=[1,2,3,'logical'] >>> staticList=tuple(list) E

Re: Please provide a better explanation of tuples and dictionaries

2013-02-02 Thread Michael Torrie
On 02/02/2013 10:20 PM, Rick Johnson wrote: > *school-bell* I'm already regretting typing this, but really? The term, "tuple," was used rather consistently all through my university years. And Python's use of it is consistent with how it is used all through computer science. And for that matter

Re: Please provide a better explanation of tuples and dictionaries

2013-02-02 Thread Rick Johnson
# Quote: Daniel Rouse Jr. # # To me, this looks like an array. Is tuple just the # # Python name for an array?

Re: Floating point calculation problem

2013-02-02 Thread Michael Torrie
On 02/02/2013 06:25 PM, Steven D'Aprano wrote: > Michael Torrie wrote: > >> def squeeze_duck (duck): >> // return the quack >> return duck.squeeze() > > I'm curious, what language were you thinking of when you wrote the comment > using // instead of # ? Oh darn. Blew my cover. I'm beta

Re: Floating point calculation problem

2013-02-02 Thread Dave Angel
On 02/02/2013 08:25 PM, Steven D'Aprano wrote: Michael Torrie wrote: def squeeze_duck (duck): // return the quack return duck.squeeze() I'm curious, what language were you thinking of when you wrote the comment using // instead of # ? I'm guessing that would probably be C++. Or

Re: Floating point calculation problem

2013-02-02 Thread Steven D'Aprano
Michael Torrie wrote: > def squeeze_duck (duck): > // return the quack > return duck.squeeze() I'm curious, what language were you thinking of when you wrote the comment using // instead of # ? -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Pygtk entry readline

2013-02-02 Thread Matthias Fulz
Hi, does anybody know howto connect / use a gtk entry as "frontend" for readline in- / output? I couldn't find anything on the net for my problem. Basicly I've a working readline autocomplete, which I can use without problems via input function, but I want to use that in an gtk gui inside an ent

Re: CamelCase vs. all-lowercase package names

2013-02-02 Thread Terry Reedy
On 2/2/2013 3:03 AM, dieter wrote: Rhubarb Sin writes: PEP-8 calls for "short, all-lowercase names" for packages: http://www.python.org/dev/peps/pep-0008/#package-and-module-names This is mainly to support case insensitive file systems (and file systems with quite limited path length). It

Re: Maximum Likelihood Estimation

2013-02-02 Thread Oscar Benjamin
On 2 February 2013 18:26, Wolfgang Keller wrote: >> I am looking for a Python implementation of Maximum Likelihood >> Estimation. If any one can kindly suggest. With a google search it >> seems scipy,numpy,statsmodels have modules, but as I am not finding >> proper example workouts I am failing to

Re: Cheat Engine In Python

2013-02-02 Thread alex23
On Feb 1, 11:46 pm, rusi wrote: > On Feb 1, 2:59 pm, Stefan Behnel wrote: > > > wheelman...@gmail.com, 01.02.2013 05:16: > > > > Are there any softwares like cheat engine and written in python > > > What's a "cheat engine"? > > I'm guessing its this (in Ruby) required in > Python:http://cheat.er

RESTful API for own python application

2013-02-02 Thread Julio F Schwarzbeck
Howdy folks, I have a couple of questions that imo requires some feedback by the smarts, I'd appreciate any comments you can add to this issue, here's my situation: I am developing an application, the application stores small text snippets (think of something similar to evernote), and it has t

Re: mySQLdb

2013-02-02 Thread Stefan Behnel
Michael Torrie, 02.02.2013 19:29: > On 02/02/2013 03:19 AM, Luuk wrote: >> On 02-02-2013 11:01, Armin Karner wrote: >>> MySQLdb for python versions 3.3 or higher >> >> http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher > > Embarrassingly, most of the links on the google search results

Re: Maximum Likelihood Estimation

2013-02-02 Thread Wolfgang Keller
> I am looking for a Python implementation of Maximum Likelihood > Estimation. If any one can kindly suggest. With a google search it > seems scipy,numpy,statsmodels have modules, but as I am not finding > proper example workouts I am failing to use them. For statistics I would suggest using R (h

Re: mySQLdb

2013-02-02 Thread Michael Torrie
On 02/02/2013 03:19 AM, Luuk wrote: > On 02-02-2013 11:01, Armin Karner wrote: >> MySQLdb for python versions 3.3 or higher > > http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher Embarrassingly, most of the links on the google search results page are about people asking the same quest

Re: Floating point calculation problem

2013-02-02 Thread Michael Torrie
On 02/02/2013 08:48 AM, Schizoid Man wrote: > Also, if the cast is necessary, then now exactly does the dynamic typing > work? Dynamic typing isn't referring to numeric type coercion. It refers to the fact that a name can be bound to an object of any type. So if you made a function like this:

Re: pip and distutils

2013-02-02 Thread Kwpolska
On Mon, Jan 28, 2013 at 10:31 PM, Vraj Mohan wrote: > I have created a source distribution using distutils which specifies > external packages using: > > setup( > ..., > requires = ['Foo (>= 0.7)', 'Bar (>= 2.4.5)'], > ... > ) > > When I use pip to install this distribution

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sun, Feb 3, 2013 at 2:48 AM, Schizoid Man wrote: > def Numer(s, k): >return math.log(s / k) > > s = float(input("Enter s: ")) > k = float(input("Enter k: ")) > print("Result: ", Numer(s, k)) > > For the v2.7 version, the only difference is the input lines: > > s = input("Enter s: ") >

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
"Schizoid Man" wrote in message news:kejcfi$s70$1...@dont-email.me... So for values of s=60 and k=50, the first code returns 0.1823215567939546 (on the PC), whereas the second returns 0.0 (on the Mac). This this expression is evaluated in the numerator, it never returns a divide by zero erro

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
Ah, there may well be something in that. Definitely post the code and outputs; chances are someone'll spot the difference. Ok, I *think* I found the source of the difference: This is the base code that runs fine in v 3.3.0 (the output is correct): def Numer(s, k): return math.log(s / k) s =

Re: Problem with my nose test plugin

2013-02-02 Thread R. Osinga
On Saturday, February 2, 2013 3:43:45 PM UTC+1, R. Osinga wrote: > Hi all, > > > > I want to execute unit tests from web2py and I want to automatically > discover, so I think it is wise to use nose tests for that. That way, I can > write a plugin to receive the test results in stead of heaving

Problem with my nose test plugin

2013-02-02 Thread Roald
Hi all, I want to execute unit tests from web2py and I want to automatically discover, so I think it is wise to use nose tests for that. That way, I can write a plugin to receive the test results in stead of heaving to parse the output stream. I use nose.run(addPlugins[MyPlugin()]), and althoug

Re: Floating point calculation problem

2013-02-02 Thread Steven D'Aprano
Schizoid Man wrote: > I know this is probably redundant but Python 2.7.3 is running on a Mac and > 3.3.0 on a PC, so it's not exactly an apples-v-apples comparison. It's not impossible that there is a slight difference in some of the floating point functions. E.g. when you call math.log(s), one v

Re: Floating point calculation problem

2013-02-02 Thread Steven D'Aprano
Schizoid Man wrote: > I have a program that performs some calculations that runs perfectly on > Python 2.7.3. However, when I try to execute it on Python 3.3.0 I get the > following error: > numer = math.log(s) > TypeError: a float is required > > The quantity s is input with the following li

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 10:51 PM, Schizoid Man wrote: >> If your input has no decimal point in it, eval (or input) will return >> an integer, not a float. Other than that, I can't see any obvious >> reason for there to be a difference. Can you put together a simple >> script that demonstrates the p

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
If your input has no decimal point in it, eval (or input) will return an integer, not a float. Other than that, I can't see any obvious reason for there to be a difference. Can you put together a simple script that demonstrates the problem and post it, along with the exact input that you're giving

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
Highly unlikely. I'd say impossible, unless you type a different value for x of course. By the time the input() function returns, the result is already a float. Wrapping it in float() again cannot possibly change the value. If you have found a value that does change, please tell us what it is. T

Re: Floating point calculation problem

2013-02-02 Thread Steven D'Aprano
Schizoid Man wrote: > "Chris Angelico" wrote in message > news:mailman.1289.1359801291.2939.python-l...@python.org... >> On Sat, Feb 2, 2013 at 9:27 PM, Schizoid Man >> wrote: >>> The quantity s is input with the following line: s = input("Enter s: >>> ") >>> >>> To get rid of the compile erro

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 10:34 PM, Schizoid Man wrote: >> raw_input() takes a line from the keyboard (handwave) and returns it >> as a string. >> >> input() in 2.X takes a line from the keyboard and evaluates it as a >> Python expression. >> >> float() takes a string, float, int, etc, and returns th

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
raw_input() takes a line from the keyboard (handwave) and returns it as a string. input() in 2.X takes a line from the keyboard and evaluates it as a Python expression. float() takes a string, float, int, etc, and returns the nearest-equivalent floating point value. What's the input you're givi

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 10:14 PM, Schizoid Man wrote: > Scratch that, I'm not sure which result is right now, so need to look at the > full calculations in details. What would be the difference between > raw_input() and float(input())? > > Thanks again. Depends on what you type in. raw_input() ta

Re: Floating point calculation problem

2013-02-02 Thread Schizoid Man
"Chris Angelico" wrote in message news:mailman.1289.1359801291.2939.python-l...@python.org... On Sat, Feb 2, 2013 at 9:27 PM, Schizoid Man wrote: The quantity s is input with the following line: s = input("Enter s: ") To get rid of the compile error, I can cast this as a float: s = float(in

Re: Floating point calculation problem

2013-02-02 Thread Chris Rebert
On Sat, Feb 2, 2013 at 2:27 AM, Schizoid Man wrote: > I have a program that performs some calculations that runs perfectly on > Python 2.7.3. However, when I try to execute it on Python 3.3.0 I get the > following error: >numer = math.log(s) > TypeError: a float is required > > The quantity s

Re: Floating point calculation problem

2013-02-02 Thread Chris Angelico
On Sat, Feb 2, 2013 at 9:27 PM, Schizoid Man wrote: > The quantity s is input with the following line: s = input("Enter s: ") > > To get rid of the compile error, I can cast this as a float: s = > float(input("Enter s: ")) > > However, then the result returned by the method is wrong. Why does

Floating point calculation problem

2013-02-02 Thread Schizoid Man
I have a program that performs some calculations that runs perfectly on Python 2.7.3. However, when I try to execute it on Python 3.3.0 I get the following error: numer = math.log(s) TypeError: a float is required The quantity s is input with the following line: s = input("Enter s: ") To

Re: mySQLdb

2013-02-02 Thread Luuk
On 02-02-2013 11:01, Armin Karner wrote: MySQLdb for python versions 3.3 or higher http://lmgtfy.com/?q=MySQLdb+for+python+versions+3.3+or+higher -- http://mail.python.org/mailman/listinfo/python-list

mySQLdb

2013-02-02 Thread Armin Karner
Dear Sir or Madam, I am curious if there is an update of MySQLdb for python versions 3.3 or higher. Because I really need this for a diploma thesis.  I've tried several of them, including various 2.x versions, but it didn't work.  The system I use is a Microsoft Windows 7 64 bit.  I really hop

Re: CamelCase vs. all-lowercase package names

2013-02-02 Thread dieter
Rhubarb Sin writes: > PEP-8 calls for "short, all-lowercase names" for packages: > > http://www.python.org/dev/peps/pep-0008/#package-and-module-names This is mainly to support case insensitive file systems (and file systems with quite limited path length). With mixed case, some packages/modules