problem with money datatype based calculations in python

2009-05-02 Thread Krishnakant
hello all, I am using postgresql as a database server for my db application. The database is related to accounts and point of sales and many calculations involve money datatype. The application logic is totally done in python. Now the problem is that there is a situation where we calculate tax o

interesting float to money conversion problem

2009-05-02 Thread Krishnakant
hello all, > > I am using postgresql as a database server for my db application. > > > > The database is related to accounts and point of sales and many > > calculations involve money datatype. > > > > The application logic is totally done in python. Now the problem is > > that there is a situat

Re: Why bool( object )?

2009-05-02 Thread Arnaud Delobelle
Steven D'Aprano writes: > On Fri, 01 May 2009 15:03:30 -0700, Aaron Brady wrote: > >> On May 1, 4:30 am, Steven D'Aprano > cybersource.com.au> wrote: >>> On Fri, 01 May 2009 16:30:19 +1200, Lawrence D'Oliveiro wrote: >>> > I have never written anything so unbelievable in my life. And I hope >>> >

Re: eval(WsgiApplication)

2009-05-02 Thread Arnaud Delobelle
gert writes: > I would like to read the following from a text file > > from json import loads > from gert.db import Db > def application(environ, response): > v = loads(environ['wsgi.input'].read(int(environ > ['CONTENT_LENGTH'])).decode('utf-8')) > db = Db() > db.execute('UPDATE vote

File handling problem.

2009-05-02 Thread subhakolkata1234
Dear Group, I am using Python2.6 and has created a file where I like to write some statistical values I am generating. The statistical values are generating in a nice way, but as I am going to write it, it is not taking it, the file is opening or closing properly but the values are not getting sto

Re: File handling problem.

2009-05-02 Thread Pascal Chambon
subhakolkata1...@gmail.com a écrit : Dear Group, I am using Python2.6 and has created a file where I like to write some statistical values I am generating. The statistical values are generating in a nice way, but as I am going to write it, it is not taking it, the file is opening or closing prop

Re: eval(WsgiApplication)

2009-05-02 Thread paul
gert schrieb: I would like to read the following from a text file Hi gert, I'm puzzled, what is wrong with using wsgi as advertised? Just import your code and insert it in the wsgi chain no? cheers Paul from json import loads from gert.db import Db def application(environ, response):

Re: eval(WsgiApplication)

2009-05-02 Thread gert
On May 2, 10:25 am, Arnaud Delobelle wrote: > gert writes: > > I would like to read the following from a text file > > > from json import loads > > from gert.db import Db > > def application(environ, response): > >     v = loads(environ['wsgi.input'].read(int(environ > > ['CONTENT_LENGTH'])).deco

Re: Warning of missing side effects

2009-05-02 Thread Pascal Chambon
Tobias Weber a écrit : Hi, being new to Python I find remarkable that I don't see any side effects. That's especially true for binding. First, it is a statement, so this won't work: if x = q.pop(): print x # output only true values Second, methods in the standard library either retu

Re: web access through vpn client

2009-05-02 Thread Martin P. Hellwig
mark.sea...@gmail.com wrote: On May 1, 5:57 pm, "Martin P. Hellwig" wrote: mark.sea...@gmail.com wrote: Hi; I am trying to retrieve financial data off website for stock market analysis. Just hobby not for pay. I actually am impressed that urllib2 and BeautifulSoup work pretty well to do what

Re: Warning of missing side effects

2009-05-02 Thread Martin v. Löwis
> But I'm used to exploiting side effect, and sometimes forget this rule > in my own classes. IS THERE A WAY to have the following produce a > runtime error? > >def f(): > x = 5 > # no return > >y = f() Typically, this will produce a runtime error fairly quickly, namely whe

Re: Multiprocessing.Queue - I want to end.

2009-05-02 Thread Hendrik van Rooyen
: "Roel Schroeven" wrote: > Hendrik van Rooyen schreef: > > I have always wondered why people do the one queue many getters thing. > > Because IMO it's the simplest and most elegant solution. That is fair enough... > > > > Given that the stuff you pass is homogenous in that it will require a

Re: Question about the wording in the python documents.

2009-05-02 Thread Sebastian Wiesner
> I don't understand your objection. Is it that the documentation calls it > Request instead of urllib2.Request? Or that it calls it an object instead > of an instance? I guess the latter ... > In either case, I think you're picking a nit so small that it isn't > actually there. All objects are i

Re: Question about the wording in the python documents.

2009-05-02 Thread Lawrence D'Oliveiro
In message , grocery_stocker wrote: > req is clearly an instance of urllib2.Request and not a Request object. "Object" is a term commonly used to mean "instance of a class". In Python, classes are also objects, but if classes were meant rather than instances, I imagine it would say so. -- http

Re: stuck with PyOBEX

2009-05-02 Thread alejandro
I am having problems with connect() it says that it doesn't have sendall atribute. Error: Traceback (most recent call last): File "novi_pokusaj.py", line 25, in client.connect() File "C:\Python25\lib\PyOBEX\client.py", line 356, in connect return Client.connect(self, header_list = [

Re: File handling problem.

2009-05-02 Thread Steven D'Aprano
On Sat, 02 May 2009 01:26:14 -0700, subhakolkata1234 wrote: > Dear Group, > > I am using Python2.6 and has created a file where I like to write some > statistical values I am generating. The statistical values are > generating in a nice way, but as I am going to write it, it is not > taking it, t

Re: object query assigned variable name?

2009-05-02 Thread David Stanek
On Fri, May 1, 2009 at 12:48 PM, Steven D'Aprano wrote: > On Fri, 01 May 2009 09:24:10 -0700, warpcat wrote: > >> I'd like it to print, when instanced, something like this: >> > s = Spam() >> I’m assigned to s! >> >> But it seems prohibitively hard (based on my web and forum searches) for >> a

Re: Warning of missing side effects

2009-05-02 Thread Dave Angel
Tobias Weber wrote: Hi, being new to Python I find remarkable that I don't see any side effects. That's especially true for binding. First, it is a statement, so this won't work: if x = q.pop(): print x # output only true values Second, methods in the standard library either return

Re: problem with money datatype based calculations in python

2009-05-02 Thread Günther Dietrich
Krishnakant wrote: ['money datatype' for database stored values] What ist the real problem? Do you have problems converting results of float calculations to the 'money datatype' before storing them in the database, or do you want to avoid the precision issues which come with the conversion od

Re: problem with money datatype based calculations in python

2009-05-02 Thread anusha k
Do calculations in postgresql and then call that calculated value from the python.So no need to calculate in python at all Njoy the share of Freedom, Anusha Kadambala On Sat, May 2, 2009 at 1:15 PM, Krishnakant wrote: > hello all, > I am using postgresql as a database server for my db applicati

Re: Warning of missing side effects

2009-05-02 Thread Arnaud Delobelle
Dave Angel writes: > Python allows multiple assignments in the same statement, but they're > all to the same object. Unless they are to different objects: a, b = 1, 2 -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with money datatype based calculations in python

2009-05-02 Thread Dave Angel
Krishnakant wrote: hello all, I am using postgresql as a database server for my db application. The database is related to accounts and point of sales and many calculations involve money datatype. The application logic is totally done in python. Now the problem is that there is a situation whe

Re: debian apt somehow created python hell! - help

2009-05-02 Thread Paulo Repreza
Hi, Try this. # aptitude update # aptitude update # aptitude upgrade you can also use # aptitude safe-upgrade Hope it helps. Paulo Repreza On May 1, 2009 7:20 PM, "watermod" wrote: I was doing one of those auto apt-get gui things with update manager in Debian and not watching the error log so

Re: stuck with PyOBEX

2009-05-02 Thread David Boddie
On Saturday 02 May 2009 14:25, alejandro wrote: > I am having problems with connect() it says that it doesn't have sendall > atribute. > > Error: > > Traceback (most recent call last): > File "novi_pokusaj.py", line 25, in > client.connect() > File "C:\Python25\lib\PyOBEX\client.py", li

for with decimal values?

2009-05-02 Thread Esmail
Hello all, Is there a Python construct to allow me to do something like this: for i in range(-10.5, 10.5, 0.1): ... If there is such a thing already available, I'd like to use it, otherwise I can write a function to mimic this, but I thought I'd check (my search yielded nothing). Thank

Re: Profiling gives very different predictions of best algorithm

2009-05-02 Thread Rick
On May 1, 7:38 pm, Terry Reedy wrote: > I presume in your overall time text, you ran the two versions of the > algorith 'naked'.  But, for some reason, you are profiling them embedded > inside a test suite and runner.  It does not seem that this should > affect relative timing, but I have seen so

Re: for with decimal values?

2009-05-02 Thread Aahz
In article , Esmail wrote: > >Is there a Python construct to allow me to do something like this: > >for i in range(-10.5, 10.5, 0.1): > ... > >If there is such a thing already available, I'd like >to use it, otherwise I can write a function to mimic this, >but I thought I'd check (my sea

Re: Warning of missing side effects

2009-05-02 Thread Dave Angel
Arnaud Delobelle wrote: Dave Angel writes: Python allows multiple assignments in the same statement, but they're all to the same object. Unless they are to different objects: a, b = 1, 2 You're right, of course. I was referring to the multiple '=' form, and my statement wa

Re: Question about the wording in the python documents.

2009-05-02 Thread grocery_stocker
On May 2, 4:14 am, Sebastian Wiesner wrote: > > I don't understand your objection. Is it that the > documentation calls it > > Request instead of urllib2.Request? Or that it calls it an object instead > > of an instance? > > I guess the latter ... > > > In either case, I think you're picking a ni

Re: for with decimal values?

2009-05-02 Thread Pascal Chambon
Aahz a écrit : In article , Esmail wrote: Is there a Python construct to allow me to do something like this: for i in range(-10.5, 10.5, 0.1): ... If there is such a thing already available, I'd like to use it, otherwise I can write a function to mimic this, but I thought I'd chec

Re: problem with money datatype based calculations in python

2009-05-02 Thread D'Arcy J.M. Cain
On Sat, 02 May 2009 15:43:23 +0200 "Günther Dietrich" wrote: > Krishnakant wrote: > > ['money datatype' for database stored values] > > What ist the real problem? Do you have problems converting results of > float calculations to the 'money datatype' before storing them in the > database, or

Re: problem with money datatype based calculations in python

2009-05-02 Thread Peter Pearson
On Sat, 02 May 2009 13:15:22 +0530, Krishnakant wrote: > hello all, > I am using postgresql as a database server for my db application. > > The database is related to accounts and point of sales and many > calculations involve money datatype. [snip] As far as I can tell, Python has no type "money

Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread jorma kala
Hi, I'd like to process files in a directory which is in fact a short cut link to another directory (under windows XP). If the path to the directory is for instance called c:\test. I have tried both following code snipets for printing all names of files in the directory: ++ snippet 1++ for f

Re: Daemonic processes in multiprocessing - solved

2009-05-02 Thread Pascal Chambon
Pascal Chambon a écrit : Hello everyone I've just read the doc of the (awesome) "multiprocessing" module, and there are some little things I don't understand, concerning daemon processes (see quotes below). When a python process exits, the page says it attempts to join all its children. I

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
jorma kala wrote: Hi, I'd like to process files in a directory which is in fact a short cut link to another directory (under windows XP). If the path to the directory is for instance called c:\test. I have tried both following code snipets for printing all names of files in the directory: ++ sni

Re: for with decimal values?

2009-05-02 Thread Arnaud Delobelle
Esmail writes: > Hello all, > > Is there a Python construct to allow me to do something like > this: > >for i in range(-10.5, 10.5, 0.1): > ... > > If there is such a thing already available, I'd like > to use it, otherwise I can write a function to mimic this, > but I thought I'd check

Re: Accessing files in a directory which is a shortcut link (Windows)

2009-05-02 Thread Tim Golden
Tim Golden wrote: Windows shortcuts are Shell (ie GUI Desktop) objects rather than filesystem objects. The filesystem doesn't treat them specially; just returns the .lnk file (or whatever it's called). As a caveat: they don't actually *have* to be called .lnk (altho' they almost universally ar

Re: for with decimal values?

2009-05-02 Thread Mark Dickinson
On May 2, 4:12 pm, Esmail wrote: > Is there a Python construct to allow me to do something like > this: > >     for i in range(-10.5, 10.5, 0.1): >       ... I'd recommend using integer arithmetic: for ten_times_i in range(-105, 106): i = ten_times_i / 10.0 ... This has the advantage th

Re: for with decimal values?

2009-05-02 Thread Esmail
Thanks all, I appreciate the various suggestions and caveats. Just wanted to make sure I'm not re-inventing the wheel as Python seems to have already so much. Cheers, Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there any way this queue read can possibly block?

2009-05-02 Thread John Nagle
That wasn't the problem. An incoherent bug report from a user was the problem. John Nagle Carl Banks wrote: On Apr 30, 11:48 am, John Nagle wrote: def draininput(self) : # consume any queued input try: while True : ch = self.inqu

Re: Question about the wording in the python documents.

2009-05-02 Thread Sebastian Wiesner
> On May 2, 4:14 am, Sebastian Wiesner wrote: >> > >> > In either case, I think you're picking a nit so small that it isn't >> > actually there. All objects are instances (in Python), and all >> > instances are objects. >> >> Exactly, so strictly seen, "Request object" could possibly refer to th

Convert variable directly into a string (no ASCII)

2009-05-02 Thread Justin Rajewski
Hello, I need to print variables out over serial, however I need them to not be in ASCII, ie if the variable is 5 then print 5 not "5". The function that writes to the serial port requires a string and I can send non-variables out with the string "/x05" for 5. Is this even possible? Thanks, Jus

Re: for with decimal values?

2009-05-02 Thread bearophileHUGS
Esmail: > Is there a Python construct to allow me to do something like > this: >     for i in range(-10.5, 10.5, 0.1): Sometimes I use an improved version of this: http://code.activestate.com/recipes/66472/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: for with decimal values?

2009-05-02 Thread Esmail
bearophileh...@lycos.com wrote: Esmail: Is there a Python construct to allow me to do something like this: for i in range(-10.5, 10.5, 0.1): Sometimes I use an improved version of this: http://code.activestate.com/recipes/66472/ neat .. lots of code to study there. Thanks, Esmail -- htt

Re: Multiprocessing.Queue - I want to end.

2009-05-02 Thread Roel Schroeven
Hendrik van Rooyen schreef: > : "Roel Schroeven" wrote: >> ... > This is all true in the case of a job that starts, runs and finishes. > I am not so sure it applies to something that has a long life. It's true that I'm talking about work units with relatively short lifetimes, mostly a few secon

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Stephen Hansen
> I need to print variables out over serial, however I need them to not be > in ASCII, ie if the variable is 5 then print 5 not "5". > > The function that writes to the serial port requires a string and I can > send non-variables out with the string "/x05" for 5. > > Is this even possible? > Check

Re: problem with money datatype based calculations in python

2009-05-02 Thread Krishnakant
On Sat, 2009-05-02 at 11:57 -0400, D'Arcy J.M. Cain wrote: > And if you use PyGreSQL (http://www.PyGreSQL.org/) to connect to > the database then the money type is already converted to Decimal. > d'arcy, I visited the home page for pygresql and discovered that you wrote > the library. I am happy t

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Martin v. Löwis
> I need to print variables out over serial, however I need them to not be > in ASCII, ie if the variable is 5 then print 5 not "5". > > The function that writes to the serial port requires a string and I can > send non-variables out with the string "/x05" for 5. > > Is this even possible? So yo

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Ulrich Eckhardt
Justin Rajewski wrote: > I need to print variables out over serial, however I need them to not be > in ASCII, ie if the variable is 5 then print 5 not "5". > > The function that writes to the serial port requires a string and I can > send non-variables out with the string "/x05" for 5. Take a loo

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Günther Dietrich
Justin Rajewski wrote: >I need to print variables out over serial, however I need them to not be >in ASCII, ie if the variable is 5 then print 5 not "5". > >The function that writes to the serial port requires a string and I can >send non-variables out with the string "/x05" for 5. See module st

writing consecutive data to subprocess command 'more'

2009-05-02 Thread SanPy
I have this method that prints a given text via a subprocess command 'more' . It is like this: def print_by_page(text): if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(): viewer = 'more -EMR' proc = subprocess.Popen([viewer], shell=True, stdin=subprocess.PIPE,

Re: Convert variable directly into a string (no ASCII)

2009-05-02 Thread Tim Roberts
Justin Rajewski wrote: > >I need to print variables out over serial, however I need them to not be >in ASCII, ie if the variable is 5 then print 5 not "5". > >The function that writes to the serial port requires a string and I can >send non-variables out with the string "/x05" for 5. > >Is this ev

Re: How to measure the memory cost in Python?

2009-05-02 Thread CTO
> > PS) The asizeof(obj) function from this recipe > code.activestate.com/recipes/546530> does size the object plus its > > references, recursively. > > Correction, the last sentence should be: The asizeof(obj) ... plus its > referents, recursively. I will admit, I have *no idea* what that code i

Re: Help! Can't get program to run.

2009-05-02 Thread seanm . py
On May 1, 6:10 pm, Ned Deily wrote: > In article <7618rjf1a3t8...@mid.uni-berlin.de>, >  "Diez B. Roggisch" wrote: > > > > > seanm...@gmail.com schrieb: > > > I think this is maybe the most basic problem possible, but I can't get > > > even the most basic Python to run on OS X using Terminal or I

Re: Help! Can't get program to run.

2009-05-02 Thread Arnaud Delobelle
seanm...@gmail.com writes: > sean-marimpietris-computer:~ seanmarimpietri$ python > Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > Type "help", "copyright", "credits" or "license" for more information. python module1.py > File ""

Re: writing consecutive data to subprocess command 'more'

2009-05-02 Thread Gabriel Genellina
En Sat, 02 May 2009 15:53:17 -0300, SanPy escribió: I have this method that prints a given text via a subprocess command 'more' . It is like this: def print_by_page(text): if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(): viewer = 'more -EMR' proc = subprocess.Popen

Most Basic Question Ever - please help

2009-05-02 Thread seanm . py
I am going to try posting here again with more detail to see if I can finally get my first program to work. I am working on a MacBook Pro with OS X 10.4.11. I opened a new window in IDLE to create a file. The file had only one line of code and was saved as module1.py. I saved it to Macintosh HD. T

Re: writing consecutive data to subprocess command 'more'

2009-05-02 Thread Piet van Oostrum
> SanPy (S) wrote: >S> I have this method that prints a given text via a subprocess command >S> 'more' . It is like this: >S> def print_by_page(text): >S> if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty(): >S> viewer = 'more -EMR' >S> proc = subprocess.Popen([viewe

eric not working on ubuntu 9.04

2009-05-02 Thread bvidinli
any idea ? here is output: bvidi...@bvidinli-yenihdd:~$ eric Warning: translation file 'qt_tr_TR'could not be loaded. Using default. Warning: translation file 'qscintilla_tr_TR'could not be loaded. Using default. Exception RuntimeError: 'maximum recursion depth exceeded while calling a Python obje

Re: Help! Can't get program to run.

2009-05-02 Thread seanm . py
On May 2, 4:30 pm, Arnaud Delobelle wrote: > seanm...@gmail.com writes: > > sean-marimpietris-computer:~ seanmarimpietri$ python > > Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) > > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > > Type "help", "copyright", "credits" or "license" for

return functions

2009-05-02 Thread gert
Aldo i like the cerrypy wsgi server very much, i do not like the tools that go with it so i am stuck with a configuration file that looks like this http://pastebin.com/m4d8184bc After 152 line I finally arrived to a point where i was thinkig "thats it, this is like going to work on a uni cycle an

Re: Multiprocessing.Queue - I want to end.

2009-05-02 Thread Dave Angel
Hendrik van Rooyen wrote: : "Roel Schroeven" wrote: Hendrik van Rooyen schreef: I have always wondered why people do the one queue many getters thing. Because IMO it's the simplest and most elegant solution. That is fair enough... Given that the stuff you pass is hom

Re: return functions

2009-05-02 Thread gert
On May 2, 10:44 pm, gert wrote: > Aldo i like the cerrypy wsgi server very much, i do not like the tools > that go with it > so i am stuck with a configuration file that looks like this > > http://pastebin.com/m4d8184bc > > After 152 line I finally arrived to a point where i was thinkig "thats > i

Re: writing consecutive data to subprocess command 'more'

2009-05-02 Thread SanPy
Thanks, that works beautifully! Regards, Sander On 2 mei, 22:35, "Gabriel Genellina" wrote: > En Sat, 02 May 2009 15:53:17 -0300, SanPy escribió: > > > > > > > I have this method that prints a given text via a subprocess command > > 'more' . It is like this: > > > def print_by_page(text): > >  

Re: Help! Can't get program to run.

2009-05-02 Thread Rhodri James
On Sat, 02 May 2009 21:42:03 +0100, wrote: Awesome. Thank you, Arnaud. I moved the file to that folder, and I got it to work in Terminal. However, I still can't get it to run using IDLE. Any idea why that might be? Thanks again. -Sean To repeat what you were told earlier, IDLE is an interacti

Re: Help! Can't get program to run.

2009-05-02 Thread Ned Deily
In article <8f6634a2-c977-430a-b9f2-90ef9356d...@x6g2000vbg.googlegroups.com>, seanm...@gmail.com wrote: > Thank you for both for the help. I still cannot get the program to run > though. Below I've copied my commands and the error messages for you > (in IDLE then Terminal): > > IDLE 2.6.2 > >>>

Need Help with str.replace & tuples

2009-05-02 Thread mikefromvt
Hello. I am very very unfamiliar with Python and need to update a Python script. What I need to do is to replace three variables (already defined in the script) within a string. The present script correctly replaces two of the three variables. I am unable to add a third variable. Specifically,

Re: Most Basic Question Ever - please help

2009-05-02 Thread Stephen Hansen
> > IDLE 2.6.2 > >>> python module1.py > SyntaxError: invalid syntax > The ">>>" prompt is Python's interactive interpreter. Once you are here, you already are in python-- so typing "python" again is redundant and invalid. >From this prompt you type in python code. I have never used IDLE so can't

Re: Most Basic Question Ever - please help

2009-05-02 Thread Dave Angel
seanm...@gmail.com wrote: I am going to try posting here again with more detail to see if I can finally get my first program to work. I am working on a MacBook Pro with OS X 10.4.11. I opened a new window in IDLE to create a file. The file had only one line of code and was saved as module1.py. I

Re: Dictionary, integer compression

2009-05-02 Thread bearophileHUGS
dineshv: > Thanks for that about Python3.  My integers range from 0 to 9,999,999 > and I have loads of them.  Do you think Python3 will help? Nope. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: return functions

2009-05-02 Thread gert
On May 2, 10:58 pm, gert wrote: > On May 2, 10:44 pm, gert wrote: > > > Aldo i like the cerrypy wsgi server very much, i do not like the tools > > that go with it > > so i am stuck with a configuration file that looks like this > > >http://pastebin.com/m4d8184bc > > > After 152 line I finally arr

Re: Need Help with str.replace & tuples

2009-05-02 Thread bearophileHUGS
mikefromvt: > I am very very unfamiliar with Python and need to update a Python > script.  What I need to do is to replace three variables (already > defined in the script) within a string.  The present script correctly > replaces two of the three variables.  I am unable to add a third > variable.

Re: Most Basic Question Ever - please help

2009-05-02 Thread John Machin
On May 3, 7:46 am, Dave Angel wrote: > seanm...@gmail.com wrote: > > I am going to try posting here again with more detail to see if I can > > finally get my first program to work. > > > I am working on a MacBook Pro with OS X 10.4.11. I opened a new window > > in IDLE to create a file. The file h

Re: problem with money datatype based calculations in python

2009-05-02 Thread John Machin
On May 3, 12:09 am, Dave Angel wrote: > Krishnakant wrote: > > hello all, > > I am using postgresql as a database server for my db application. > > > The database is related to accounts and point of sales and many > > calculations involve money datatype. > > > The application logic is totally done

Re: for with decimal values?

2009-05-02 Thread Ben Finney
Esmail writes: > Hello all, > > Is there a Python construct to allow me to do something like > this: > >for i in range(-10.5, 10.5, 0.1): > ... Note that those values are of type ‘float’, which is a distinct type from ‘Decimal’ with very different behaviour. > If there is such a thin

Re: Help! Can't get program to run.

2009-05-02 Thread seanm . py
On May 2, 5:30 pm, Ned Deily wrote: > In article > <8f6634a2-c977-430a-b9f2-90ef9356d...@x6g2000vbg.googlegroups.com>, > >  seanm...@gmail.com wrote: > > Thank you for both for the help. I still cannot get the program to run > > though. Below I've copied my commands and the error messages for you

Re: Most Basic Question Ever - please help

2009-05-02 Thread seanm . py
On May 2, 6:25 pm, John Machin wrote: > On May 3, 7:46 am, Dave Angel wrote: > > > > > seanm...@gmail.com wrote: > > > I am going to try posting here again with more detail to see if I can > > > finally get my first program to work. > > > > I am working on a MacBook Pro with OS X 10.4.11. I opene

Re: web access through vpn client

2009-05-02 Thread mark . seagoe
On May 2, 3:01 am, "Martin P. Hellwig" wrote: > mark.sea...@gmail.com wrote: > > On May 1, 5:57 pm, "Martin P. Hellwig" > > wrote: > >> mark.sea...@gmail.com wrote: > >>> Hi; > >>> I am trying to retrieve financial data off website for stock market > >>> analysis.  Just hobby not for pay.  I actu

Re: for with decimal values?

2009-05-02 Thread Esmail
Ben Finney wrote: Note that those values are of type ‘float’, which is a distinct type from ‘Decimal’ with very different behaviour. If there is such a thing already available, I'd like to use it, otherwise I can write a function to mimic this, but I thought I'd check (my search yielded nothin

Can someone please explain to me this code?

2009-05-02 Thread Soumen banerjee
Hello, I was trying to find a method to make global hotkeys with python in linux. I found this one which uses a library called python-xlib. The point is that since i dont have much experience with this, i cant understand some of the code. Can someone please explain to me how this code works? Accor

Re: eval(WsgiApplication)

2009-05-02 Thread Дамјан Георгиевски
>> > How do I do this in python3? >> >> What's wrong with importing it? > > The problem is that my wsgi files have a wsgi extention for mod_wsgi > use .. > mod_wsgi has a .wsgi handler because it is recommended to rename the > wsgi file with wsgi extensions to avoid double imports > cherrypy serve

Re: eval(WsgiApplication)

2009-05-02 Thread gert
On May 2, 2:15 pm, Дамјан Георгиевски wrote: > >> > How do I do this in python3? > > >> What's wrong with importing it? > > > The problem is that my wsgi files have a wsgi extention for mod_wsgi > > use > .. > > mod_wsgi has a .wsgi handler because it is recommended to rename the > > wsgi file wit

Re: return functions

2009-05-02 Thread gert
On May 3, 12:17 am, gert wrote: > On May 2, 10:58 pm, gert wrote: > > > > > On May 2, 10:44 pm, gert wrote: > > > > Aldo i like the cerrypy wsgi server very much, i do not like the tools > > > that go with it > > > so i am stuck with a configuration file that looks like this > > > >http://pasteb

yet another list comprehension question

2009-05-02 Thread Ross
I'm trying to set up a simple filter using a list comprehension. If I have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] and I wanted to filter out all tuples containing None, I would like to get the new list b = [(1,2), (3,4),(6,7)]. I tried b = [i for i in a if t for t in i is

Re: yet another list comprehension question

2009-05-02 Thread Chris Rebert
On Sat, May 2, 2009 at 7:13 PM, Ross wrote: > I'm trying to set up a simple filter using a list comprehension. If I > have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] > and I wanted to filter out all tuples containing None, I would like to > get the new list b = [(1,2), (3,4),

Re: yet another list comprehension question

2009-05-02 Thread Ross
On May 2, 7:21 pm, Chris Rebert wrote: > On Sat, May 2, 2009 at 7:13 PM, Ross wrote: > > I'm trying to set up a simple filter using a list comprehension. If I > > have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] > > and I wanted to filter out all tuples containing None, I wou

Re: yet another list comprehension question

2009-05-02 Thread CTO
On May 2, 10:13 pm, Ross wrote: > I'm trying to set up a simple filter using a list comprehension. If I > have a list of tuples, a = [(1,2), (3,4), (5,None), (6,7), (8, None)] > and I wanted to filter out all tuples containing None, I would like to > get the new list b = [(1,2), (3,4),(6,7)]. try

Re: Can someone please explain to me this code?

2009-05-02 Thread CTO
On Sat, May 2, 2009 at 9:41 PM, Soumen banerjee wrote: Hello, I was trying to find a method to make global hotkeys with python in linux. I found this one which uses a library called python-xlib. The point is that since i dont have much experience with this, i cant understand s

Multiprocessing + Frozen bug?

2009-05-02 Thread Stephen Hansen
In the multiprocessing.forking module, there's: def get_command_line(): ... if getattr(sys, 'frozen', False): return [sys.executable, '--multiprocessing-fork'] else: prog = 'from multiprocessing.forking import main; main()' return [_p

Re: problem with money datatype based calculations in python

2009-05-02 Thread D'Arcy J.M. Cain
On Sun, 03 May 2009 00:07:17 +0530 Krishnakant wrote: > On Sat, 2009-05-02 at 11:57 -0400, D'Arcy J.M. Cain wrote: > > And if you use PyGreSQL (http://www.PyGreSQL.org/) to connect to > > the database then the money type is already converted to Decimal. > > d'arcy, I visited the home page for pygr

Re: Can someone please explain to me this code?

2009-05-02 Thread Soumen banerjee
Hello, I'd like a little more help with the following lines: root.change_attributes(event_mask = X.KeyPressMask) for keycode in keys: root.grab_key(keycode, X.AnyModifier, 1,X.GrabModeAsync, X.GrabModeAsync) what exactly do they do? regards Sou

Re: Most Basic Question Ever - please help

2009-05-02 Thread CM
On May 2, 4:36 pm, seanm...@gmail.com wrote: > I am going to try posting here again with more detail to see if I can > finally get my first program to work. > > I am working on a MacBook Pro with OS X 10.4.11. I opened a new window > in IDLE to create a file. The file had only one line of code and

Doc strings in descriptors

2009-05-02 Thread Kevin D . Smith
I have a simple descriptor to create a cached property as shown below. class cproperty(object): """ Property whose value is only calculated once and cached """ def __init__(self, func): self._func = func self.__doc__ = func.__doc__ def __get__(self, obj, type=None):

Re: eval(WsgiApplication)

2009-05-02 Thread Graham Dumpleton
On May 2, 10:15 pm, Дамјан Георгиевски wrote: > >> > How do I do this in python3? > > >> What's wrong with importing it? > > > The problem is that my wsgi files have a wsgi extention for mod_wsgi > > use > .. > > mod_wsgi has a .wsgi handler because it is recommended to rename the > > wsgi file wi

Re: return functions

2009-05-02 Thread Graham Dumpleton
On May 3, 6:44 am, gert wrote: > Aldo i like the cerrypywsgiserver very much, i do not like the tools > that go with it > so i am stuck with a configuration file that looks like this > > http://pastebin.com/m4d8184bc > > After 152 line I finally arrived to a point where i was thinkig "thats > it,

Re: eric not working on ubuntu 9.04

2009-05-02 Thread Stefan Behnel
bvidinli wrote: > An unhandled exception occurred. Please report the problem > using the error reporting dialog or via email to > . > A log has been written to "/home/bvidinli/.eric4/eric4_error.log". Did you try that? Stefan -- http://mail.python.org/mailman/listinfo/python-list