Access to CAN-Bus

2008-06-09 Thread Thin Myrna
I'd like to access some drive hardware via CAN bus from Python under Linux (sending rec'ing PDOs). Googling around I couldn't find a Python package, but people who said that they are doing this, though. I guess they are using their home brewn software. Any pointer to - such software (anyone wil

Re: Access to CAN-Bus

2008-06-09 Thread Diez B. Roggisch
Thin Myrna schrieb: I'd like to access some drive hardware via CAN bus from Python under Linux (sending rec'ing PDOs). Googling around I couldn't find a Python package, but people who said that they are doing this, though. I guess they are using their home brewn software. Any pointer to - suc

Re: Access to CAN-Bus

2008-06-09 Thread John Schroeder
Isn't a CAN bus accessed via the COM ports (serial or parallel)? If this is the case, then you should use pySerial and/or pyParallel but you would have to define the protocol yourself. (I've used pyserial to implement a LAPB protocol.) On Mon, Jun 9, 2008 at 12:15 AM, Diez B. Roggisch <[EMAIL PR

More than one element of list changing when only one should be

2008-06-09 Thread Chuckk Hubbard
Hello. This program is clunky, I know; I'm not a programmer, but I need to use this program, so I'm writing it. The problem: I have a cursor following the mouse that shows frequency ratios of potential notes in relation to 1/1 (something like Middle C). At any time, the user may hit "t" to move 1/

Re: python's setuptools (eggs) vs ruby's gems survey/discussion

2008-06-09 Thread Alia Khouri
Might as well answer the survey myself: > A few questions (please add more) so far are: > (1) Should setuptools be standard? Not at this stage. What pythonistas need is a cross-platform package manager that is included in the stdlib. Setuptools is simply not mature enough nor pythonic enough to

Re: Access to CAN-Bus

2008-06-09 Thread Stephan Diehl
Thin Myrna schrieb: I'd like to access some drive hardware via CAN bus from Python under Linux (sending rec'ing PDOs). Googling around I couldn't find a Python package, but people who said that they are doing this, though. I guess they are using their home brewn software. Any pointer to - suc

Re: More than one element of list changing when only one should be

2008-06-09 Thread Peter Otten
Chuckk Hubbard wrote: > I can't think of any reason these lines: > > self.regionlist[self.hregion][0] = self.curnum > self.regionlist[self.hregion][1] = self.curden > self.regionlist[self.hregion][3] = self.octave11 = self.yadj > > should change self.regionlist[0] AND self.regionlist[2] in the s

Re: SQlite none english char

2008-06-09 Thread Gerhard Häring
Gandalf wrote: [...] I solved the problem by entering data manually but now the problem is that i had to delete this function: con.text_factory = str and now I can't see the data that I entered thought my sqlite manager Then apparently there is still non-UTF-8 data in the database. Perhaps SQ

Alternative to Decimal type

2008-06-09 Thread Frank Millman
Hi all I have a standard requirement for a 'decimal' type, to instantiate and manipulate numeric data that is stored in a database. I came up with a solution long before the introduction of the Decimal type, which has been working well for me. I know the 'scale' (number of decimal places) of the n

Re: Parsing a path to components

2008-06-09 Thread Duncan Booth
"Mark Tolonen" <[EMAIL PROTECTED]> wrote: >> Can you recommend a generic way to achieve this ? >> Eli > import os from os.path import normpath,abspath x=r'\foo\\bar/baz//spam.py' normpath(x) > '\\foo\\bar\\baz\\spam.py' normpath(abspath(x)) > 'C:\\foo\\bar\\baz\\spam.py'

Re: Q re documentation Python style

2008-06-09 Thread Bruno Desthuilliers
kj a écrit : (snip) I think that sometimes even simple functions require a lot of documentation. For example, I want to document a function that takes a dictionary as argument, and this dictionary is expected to have 5 keys. (When the number of mandatory arguments gets above 4, I find that it'

Problem rendering indic fonts in Tkinter

2008-06-09 Thread varun embar
Hi, I was trying to build a kannada word processor using tkinter.But i have some problem rendering conjunct consonants. For eg:- a = Text(root) a.insert(INSERT,unichr(0x0c95)+unichr(0x0ccd)+unichr(0x0c95)) this gives two separate consonants rather than one conjunct consonant -- http://mail.python.

[ANN] LAX - Logilab Appengine eXtension is a full-featured web application framework running on AppEngine

2008-06-09 Thread Arthur.Lutz
LAX version 0.3.0 was released today, see http://lax.logilab.org/ Get a new application running in ten minutes with the install guide and the tutorial: http://lax.logilab.org/INSTALL.en.html http://lax.logilab.org/tutorial.en.html Enjoy! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Mark Wooding a écrit : Russ P. <[EMAIL PROTECTED]> wrote: The idea of being able to discern properties of an object by its name alone is something that is not normally done in programming in general. Really? You obviously haven't noticed Prolog, Smalltalk, Haskell, ML, or Erlang then. And

post-mortem from core dump

2008-06-09 Thread peter
AFAIK pdb only can do postmortem debugging if fed a Python stack trace. Is there any way to obtain such a stack trace if all you've got is a core dump? Or, put another way: can I do post-mortem debugging from a core dump? Thanks, peter. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 8, 5:40 am, Mark Wooding <[EMAIL PROTECTED]> wrote: Russ P. <[EMAIL PROTECTED]> wrote: The idea of being able to discern properties of an object by its name alone is something that is not normally done in programming in general. Really? You obviously haven't noticed P

Re: Alternative to Decimal type

2008-06-09 Thread Paul Hankin
On Jun 9, 5:11 pm, Frank Millman <[EMAIL PROTECTED]> wrote: > I have a standard requirement for a 'decimal' type, to instantiate and > manipulate numeric data that is stored in a database. I came up with a > solution long before the introduction of the Decimal type, which has > been working well fo

Re: [Fwd: Re: How to make one program connect to more than one TCP?]

2008-06-09 Thread Laszlo Nagy
[EMAIL PROTECTED] wrote: i want to make one program that the steps like this: 1. download email from email account, for example: [EMAIL PROTECTED], saved in a file, for example: downloadedEmail.txt Can be done via the standard imaplib module. No need to use twisted. 2. parsing the downlo

Re: Trying out safethread patch

2008-06-09 Thread Rhamphoryncus
On Jun 8, 9:55 am, [EMAIL PROTECTED] wrote: > I'd like to take the python-safethread code out for a spin, but I'm not sure > where to start. I downloaded the latest diff: > >http://python-safethread.googlecode.com/files/safethread-bzr-36020.diff > > checked out Python 3.0 from the bzr mirror,

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Mark Wooding a écrit : Fuzzyman <[EMAIL PROTECTED]> wrote: So, you are stating that no API programmer using Python *ever* has a valid or genuine reason for wanting (even if he can't have it) genuine 'hiding' of internal state or members from consumers of his (or her...) API? I don't want to s

Re: time.clock() or Windows bug?

2008-06-09 Thread Nick Craig-Wood
Tim Roberts <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > > > >time.clock() uses QueryPerformanceCounter under windows. There are > >some known problems with that (eg with Dual core AMD processors). > > > >See http://msdn.microsoft.com/en-us/library/ms644904.aspx > > >

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 10:54 am, Paul Hankin <[EMAIL PROTECTED]> wrote: > > Hi Frank, > I don't know why you think Decimal is complicated: it has some > advanced features, but for what you seem to be doing it should be easy > to replace your 'Number' with it. In fact, it makes things simpler > since you don't h

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 6, 8:25 am, Bruno Desthuilliers wrote: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared private. Why so ? Why should the client of a class

Re: need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-09 Thread Paul Boddie
On 9 Jun, 07:40, Ivan Velev <[EMAIL PROTECTED]> wrote: > Thanks Paul, > > I have identified the "problem" - because of daylight change this > particular timesamp was observed twice in Europe/Sofia. Here is the > GMT-to-local-time conversion: > > ++-+-

Re: time.clock() or Windows bug?

2008-06-09 Thread Nick Craig-Wood
Theo v. Werkhoven <[EMAIL PROTECTED]> wrote: > The carbonbased lifeform Nick Craig-Wood inspired comp.lang.python with: > > Theo v. Werkhoven <[EMAIL PROTECTED]> wrote: > >> Output: > >> Sample 1, at 0.0 seconds from start; Output power is: 8.967 dBm > > [snip] > >> Sample 17, at 105.7 seconds

Re: Access to CAN-Bus

2008-06-09 Thread eliben
On Jun 9, 8:57 am, Thin Myrna <[EMAIL PROTECTED]> wrote: > I'd like to access some drive hardware via CAN bus from Python under Linux > (sending rec'ing PDOs). Googling around I couldn't find a Python package, > but people who said that they are doing this, though. I guess they are > using their ho

Re: Access to CAN-Bus

2008-06-09 Thread Thin Myrna
Thin Myrna wrote: Thanks for all your answers. I've just contacted the vendor for Linux support. If I went for an other vendor (I'm on a notebook, so USB-hardware is needed): Does anyone have especially good experiences with a particular one? Anyone I should stay away from? Kind regards Thin

Re: How to kill a thread?

2008-06-09 Thread Antoon Pardon
On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: >> It's always been my understanding that you can't forcibly kill a thread >> in Python (at least not in a portable way). The best you can do is >> politely ask it to die, IIRC.

Re: How to kill a thread?

2008-06-09 Thread Antoon Pardon
On 2008-06-07, David <[EMAIL PROTECTED]> wrote: > Would it be possible for a 3rd-party threading library to an > 'interruptible' version of Queue? > > The same methods as the normal Queue, but when you call a new .kill() > method on the queue, all the threads locking on the queue get a > "QueueKill

Getting current screen resolution

2008-06-09 Thread Thomas Morton
This is a "thing" that has been annoying me all morning: and I can't work out how to do it. I need a way to get the DPI or screen resolution of the monitor that a script is currently runnign on. I have a way in Windows but it doesnt port to Unix (which is important). Any ideas? -- Thomas Morto

Re: Getting current screen resolution

2008-06-09 Thread William Heymann
On Monday 09 June 2008, Thomas Morton wrote: > This is a "thing" that has been annoying me all morning: and I can't > work out how to do it. > > I need a way to get the DPI or screen resolution of the monitor that a > script is currently runnign on. > > I have a way in Windows but it doesnt port to

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Antoon Pardon
On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> Now of course noone would defend such a limitation on the grounds >> that one doesn't need the general case and that the general case >> will only save you some ve

Re: need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-09 Thread Ivan Velev
> I still don't understand why the "problematic" timestamp would affect > the latter operation, though. I can see that both timestamps could be > valid depending on which time zone is supposed to be in operation - > have the dates for daylight saving (summer vs. winter) time changed in > Bulgaria i

Re: Alternative to Decimal type

2008-06-09 Thread Mel
Frank Millman wrote: > Hi all > > I have a standard requirement for a 'decimal' type, to instantiate and > manipulate numeric data that is stored in a database. I came up with a > solution long before the introduction of the Decimal type, which has > been working well for me. I know the 'scale' (

Re: Invalid Version Number (Distutils from Cygwin)

2008-06-09 Thread Jason Tishler
On Sat, Jun 07, 2008 at 05:34:21PM -0700, newbie73 wrote: > [snip] > I'm attempting to build a project (FANN libraries) using cygwin (to > avoid installing MSVC 2003) and am receiving this error: > > Traceback (most recent call last): > [snip] > ValueError: invalid version number '2.18.50.20080523

lists to save in a tuple

2008-06-09 Thread Nader
Hello, I have two lists and would save them in a tuple. a = [1,2,3] b = ['a','b','c'] with the next statement I can do that: t = [(x,y), for x in a for y in b] This gives the next list: [(1,'a'),(1,'b'),(1,'c'), (2,'a'),(2,'b'),(2,'c'), (3,'a'),(3,'b'), (3,'c')] But I want the next list: [(

Re: lists to save in a tuple

2008-06-09 Thread Gerhard Häring
Nader wrote: Hello, I have two lists and would save them in a tuple. a = [1,2,3] b = ['a','b','c'] with the next statement I can do that: t = [(x,y), for x in a for y in b] This gives the next list: [(1,'a'),(1,'b'),(1,'c'), (2,'a'),(2,'b'),(2,'c'), (3,'a'),(3,'b'), (3,'c')] But I want the

Re: lists to save in a tuple

2008-06-09 Thread Tommy Grav
ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May 1 2007, 17:40:00) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = [1,2,3] >>> b = ['a','b','c'] >>> zip(a,b) [(1, 'a'), (

Re: lists to save in a tuple

2008-06-09 Thread Diez B. Roggisch
Nader wrote: > Hello, > > I have two lists and would save them in a tuple. > > a = [1,2,3] > b = ['a','b','c'] > > with the next statement I can do that: > > t = [(x,y), for x in a for y in b] > > This gives the next list: > > [(1,'a'),(1,'b'),(1,'c'), (2,'a'),(2,'b'),(2,'c'), (3,'a'),(3,'b'

Re: lists to save in a tuple

2008-06-09 Thread Nader
On Jun 9, 3:34 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Nader wrote: > > Hello, > > > I have two lists and would save them in a tuple. > > > a = [1,2,3] > > b = ['a','b','c'] > > > with the next statement I can do that: > > > t = [(x,y), for x in a for y in b] > > > This gives the next l

Re: Q re documentation Python style

2008-06-09 Thread bearophileHUGS
kj: > I have some functions > that require a very long docstring to document, and somehow I find > it a bit disconcerting to stick a few screenfuls of text between > the top line of a function definition and its body. You may put the main function(s) documentation in the docstring of the module, a

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 3:07 pm, Mel <[EMAIL PROTECTED]> wrote: > Frank Millman wrote: > > > class Number(object): > >     def __init__(self,value,scale): > >         self.factor = 10.0**scale > >         if isinstance(value,Number): > >             value = value.value / value.factor > > I think this could lead

Re: Alternative to Decimal type

2008-06-09 Thread Frank Millman
On Jun 9, 4:06 pm, Frank Millman <[EMAIL PROTECTED]> wrote: > > Thanks for the reply, Mel. I don't quite understand what you mean. As so often happens, after I sent my reply I re-read your post and I think I understand what you are getting at. One problem with my approach is that I am truncating

_POSIX_C_SOURCE

2008-06-09 Thread Madhur
Hi, I would like to know the difference between using the C_INCLUDE_PATH and using the -I option with compilers. How are they different? The problem which I am facing is that I am having a source base which uses python. I am currently enabling compile time option _POSIX_C_

help on self._dir

2008-06-09 Thread Kaushik
Hi, i'm new to python , and i came across a code like if ("on_%s" % handler ) in self._dir: i tried use the a similar method in my class it errors out like AttributeError: bot instance has no attribute '_dir' what am i doing wrong? Thanks, Kaushik -- http://mail.python.org/mailman/listinfo/pyt

How to find the first space?

2008-06-09 Thread Johny
How can I find the first space using regex? For example I have text Text=' This is a sample ' The last space I can remove by Text=re.sub(r"\s(?!\w)",'',Text) but I do not know how to remove the first space. Can anyone help? Thanks L. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get full path to script?

2008-06-09 Thread Mike Driscoll
On Mon, Jun 9, 2008 at 12:37 AM, bukzor <[EMAIL PROTECTED]> wrote: > On Jun 8, 12:52 pm, kj <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]> "Mark Tolonen" <[EMAIL PROTECTED]> writes: >> >> >import os >> >print os.path.abspath(__file__) >> >> Great. Thanks! >> >> Kynn >> >> -- >> NOTE: In my a

Re: help on self._dir

2008-06-09 Thread Diez B. Roggisch
Kaushik wrote: > Hi, > i'm new to python , and i came across a code like > > if ("on_%s" % handler ) in self._dir: > > i tried use the a similar method in my class it errors out like > > AttributeError: bot instance has no attribute '_dir' > > what am i doing wrong? self._dir is just an attri

money data type

2008-06-09 Thread Stephan Diehl
Hi lazyweb, I'm wondering, if there is a usable money data type for python available. A quick search in pypi and google didn't convey anything, even though the decimal data type seemed to be planned as a money data type originaly. Thanks for any pointers Stephan -- http://mail.python.org/mailman/

Can I find out (dynamically) where a method is defined?

2008-06-09 Thread allendowney
Hi All. In a complex inheritance hierarchy, it is sometimes difficult to find where a method is defined. I thought it might be possible to get this info from the method object itself, but it looks like maybe not. Here is the test case I tried: class A(object): def method(): pass cl

ANYONE CAN POST ANY TOPIC!! UPLOAD & EDIT FILES, INVITE FRIENDS!!!

2008-06-09 Thread deveeshree
ANYONE CAN POST ANY TOPIC!! UPLOAD & EDIT FILES, INVITE FRIENDS!!! Welcoming you to ENJOY my Group “ENJOY”. Please Click this Link: http://groups.google.com/group/enjoy00 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find the first space?

2008-06-09 Thread Russell Blau
"Johny" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' Why do you need to use a regex? text = text.replace(" ", "") Russ -- http://mail.python.org/mailman/listinfo/python-list

Re: Alternative to Decimal type

2008-06-09 Thread Diez B. Roggisch
Frank Millman wrote: > On Jun 9, 4:06 pm, Frank Millman <[EMAIL PROTECTED]> wrote: >> >> Thanks for the reply, Mel. I don't quite understand what you mean. > > As so often happens, after I sent my reply I re-read your post and I > think I understand what you are getting at. > > One problem with

Re: How to find the first space?

2008-06-09 Thread Diez B. Roggisch
Russell Blau wrote: > "Johny" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> How can I find the first space using regex? >> >> For example I have text >> Text=' This is a sample ' > > Why do you need to use a regex? > > text = text.replace(" ", "") You are aware that this is p

Re: How to find the first space?

2008-06-09 Thread Diez B. Roggisch
Johny wrote: > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' > > The last space I can remove by > Text=re.sub(r"\s(?!\w)",'',Text) > > but I do not know how to remove the first space. > Can anyone help? Use the strip-method, as defined on s

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Lie
On Jun 9, 7:20 pm, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > > > On Wed, Jun 4, 2008 at 2:02 PM, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> Now of course noone would defend such a limitation on the grounds > >> that one doesn't need th

Re: How to find the first space?

2008-06-09 Thread Maric Michaud
Le Monday 09 June 2008 17:02:51 Johny, vous avez écrit : > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' > > The last space I can remove by > Text=re.sub(r"\s(?!\w)",'',Text) > For spaces at the end of line, I prefer this one : re.sub(r'\s*$',

Re: Q re documentation Python style

2008-06-09 Thread kj
Wow. That was a great bunch of advice. Thank you all very much! Kynn -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Maric Michaud
Le Monday 09 June 2008 17:28:45 [EMAIL PROTECTED], vous avez écrit : > So, is there any way to inspect a method to see where (in what class) > it > is defined? In [56]: class a(object) : def a() : return def b() : return : : In [59]: class b(a) : def b() : return de

Re: How to get full path to script?

2008-06-09 Thread kj
In <[EMAIL PROTECTED]> "Mike Driscoll" <[EMAIL PROTECTED]> writes: >For my compiled scripts, I usually use this variation: >path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))) Thanks. But why the os.path.join()? (BTW, I did read the docs before posting, but they make no sense to

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Lie
On Jun 9, 10:28 pm, [EMAIL PROTECTED] wrote: > Hi All. > > In a complex inheritance hierarchy, it is sometimes difficult to find > where a > method is defined.  I thought it might be possible to get this info > from the > method object itself, but it looks like maybe not.  Here is the test > case I

Re: How to get full path to script?

2008-06-09 Thread Mike Driscoll
On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]> "Mike Driscoll" <[EMAIL PROTECTED]> writes: > >>For my compiled scripts, I usually use this variation: > >>path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]))) > > Thanks. But why the os.path.join

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread Gary Herron
Lie wrote: On Jun 9, 10:28 pm, [EMAIL PROTECTED] wrote: Hi All. In a complex inheritance hierarchy, it is sometimes difficult to find where a method is defined. I thought it might be possible to get this info from the method object itself, but it looks like maybe not. Here is the test case

Re: Can this be done with list comprehension?

2008-06-09 Thread Maric Michaud
Le Sunday 08 June 2008 02:27:54 Terry Reedy, vous avez écrit : > "Karlo Lozovina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | I figured that out few minutes ago, such a newbie mistake :). The fix I > | came up with is: > | > | result = ['something'] + [someMethod(i) for i i

Re: money data type

2008-06-09 Thread Lie
On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: > Hi lazyweb, > I'm wondering, if there is a usable money data type for python available. > A quick search in pypi and google didn't convey anything, even though the > decimal data type seemed to be planned as a money data type originaly.

Re: investigate python auth problem

2008-06-09 Thread Michael Ströder
David Hláčik wrote: I have reproduced steps, to show you sample on another module and its results in INN (becouse i really like to solve this :) Since I don't see anything related to python-ldap please don't follow-up on python-ldap-dev mailing list (removed it from Cc:). Thank you. If the

Re: Can I find out (dynamically) where a method is defined?

2008-06-09 Thread allendowney
Thanks Maric! That's very close to what I want, although using dir() can be misleading because if you invoke it on class B you get all of class A's methods as well. I took your idea and wrote it up like this: def find_defining_class(obj, meth_name): """find and return the class object that w

Re: money data type

2008-06-09 Thread Stephan Diehl
Lie wrote: > On Jun 9, 10:22 pm, Stephan Diehl <[EMAIL PROTECTED]> wrote: >> Hi lazyweb, >> I'm wondering, if there is a usable money data type for python available. >> A quick search in pypi and google didn't convey anything, even though the >> decimal data type seemed to be planned as a money da

Separators inside a var name

2008-06-09 Thread Rainy
I have a stylistic question. In most languages words in var. name are separated by underscores or cap letters, resulting in var names like var_name, VarName and varName. I don't like that very much because all 3 ways of naming look bad and/or hard to type. From what I understand, scheme can have va

Re: Separators inside a var name

2008-06-09 Thread Gary Herron
Rainy wrote: I have a stylistic question. In most languages words in var. name are separated by underscores or cap letters, resulting in var names like var_name, VarName and varName. I don't like that very much because all 3 ways of naming look bad and/or hard to type. From what I understand, sch

Re: How to get full path to script?

2008-06-09 Thread Sebastian "lunar" Wiesner
Mike Driscoll <[EMAIL PROTECTED]> at Montag 09 Juni 2008 18:20: > On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]> "Mike Driscoll" >> <[EMAIL PROTECTED]> writes: >> >>>For my compiled scripts, I usually use this variation: >> >>>path = os.path.abspath(os.pa

Web Crawler - Python or Perl?

2008-06-09 Thread disappearedng
Hi all, I am currently planning to write my own web crawler. I know Python but not Perl, and I am interested in knowing which of these two are a better choice given the following scenario: 1) I/O issues: my biggest constraint in terms of resource will be bandwidth throttle neck. 2) Efficiency issu

Re: How to get full path to script?

2008-06-09 Thread Mike Driscoll
On Mon, Jun 9, 2008 at 12:42 PM, Sebastian lunar Wiesner <[EMAIL PROTECTED]> wrote: > Mike Driscoll <[EMAIL PROTECTED]> at Montag 09 Juni 2008 18:20: > >> On Mon, Jun 9, 2008 at 11:07 AM, kj <[EMAIL PROTECTED]> wrote: >>> In <[EMAIL PROTECTED]> "Mike Driscoll" >>> <[EMAIL PROTECTED]> writes: >>> >

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 1:42 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > Rainy wrote: > > I have a stylistic question. In most languages words in var. name are > > separated by underscores or cap letters, resulting in var names like > > var_name, VarName and varName. I don't like that very much because all > >

Re: Separators inside a var name

2008-06-09 Thread Sebastian "lunar" Wiesner
Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > I have a stylistic question. In most languages words in var. name are > separated by underscores or cap letters, resulting in var names like > var_name, VarName and varName. I don't like that very much because all > 3 ways of naming look b

Re: Web Crawler - Python or Perl?

2008-06-09 Thread subeen
On Jun 9, 11:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of reso

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > 1) I/O issues: my biggest constraint in terms of resource will be > bandwidth throttle neck. > 2) Efficiency issues: The crawlers have to be fast, robust and as > "memory efficient" as possible. I am running all of my crawlers on > cheap pcs with about 500 mb RAM and P3 t

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Stefan Behnel
subeen wrote: > can use urllib2 module and/or beautiful soup for developing crawler Not if you care about a) speed and/or b) memory efficiency. http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:23 am, Bruno Desthuilliers wrote: > Mark Wooding a écrit : > > > > > Fuzzyman <[EMAIL PROTECTED]> wrote: > > >> So, you are stating that no API programmer using Python *ever* has a > >> valid or genuine reason for wanting (even if he can't have it) genuine > >> 'hiding' of internal sta

Re: Web Crawler - Python or Perl?

2008-06-09 Thread subeen
On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: > subeen wrote: > > can use urllib2 module and/or beautiful soup for developing crawler > > Not if you care about a) speed and/or b) memory efficiency. > > http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/ > > Stefan

GIL cpu multi core usage problem

2008-06-09 Thread Pau Freixes
Hi List, Surly this is a recurring theme into python dev world, but I need your help for confirm if the follow image it's really http://www.milnou.net/~pfreixes/img/cpu_usage_gil_problem.png I'm writing a brief article for my blog

Using ElementTree as backend for a chat web application issues

2008-06-09 Thread Marcelo de Moraes Serpa
Hello list, I've built a chat with a front-end Ajax client and backend usign ElementTree to persist the data. The problem is that the xml structure I use to persist some of the global configuration of the application usually gets corrupted, for example, let's say the structure is something like:

Does the python library of Google Data API is truly free?

2008-06-09 Thread Kless
The Python Client Library for Google Data APIs [1] has been licensed as Apache 2.0 -a free license- but at the same time they are restricting the rights of the users with these conditions [2], and I don't like for anything this. --With a hand I show you one thing but with the another one I make an

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:22 am, Bruno Desthuilliers wrote: > > Does > > anyone object to not having access from outside a function to local > > variables within the function? I doubt it. The other thing is that the > > vast majority of Python software, I would guess, is provided with > > source code. How many

Re: Separators inside a var name

2008-06-09 Thread Roger Miller
On Jun 9, 7:29 am, Rainy <[EMAIL PROTECTED]> wrote: > ... Another question I have is what > other languages allow this naming scheme? The most widely used such language would probably be COBOL, where you write things like SUBTRACT DISCOUNT FROM LIST-PRICE GIVING AMOUNT-DUE I doubt that syntax

Numpy, adding a row to a matrix

2008-06-09 Thread sapsi
Hello, I have a numpy array (2 rows 3 colums) import numpy a=numpy.array( [ [1,2,3] , [3,3,1] ]) I wish to add a row, this is how i do it s=a.shape numpy.resize(a,s[0]+1,s[1]) a[s[0]]=new row vector. Q: Is this a costly operation? What happens if i have to it several (and unknown) number of ti

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Ray Cote
At 11:21 AM -0700 6/9/08, subeen wrote: On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: subeen wrote: > can use urllib2 module and/or beautiful soup for developing crawler Not if you care about a) speed and/or b) memory efficiency. > http://blog.ianbicking.org/2008/03/30/pyt

Re: Getting current screen resolution

2008-06-09 Thread Miki
Hello, > This is a "thing" that has been annoying me all morning: and I can't > work out how to do it. > > I need a way to get the DPI or screen resolution of the monitor that a > script is currently runnign on. > > I have a way in Windows but it doesnt port to Unix (which is important). > > Any i

Re: Numpy, adding a row to a matrix

2008-06-09 Thread Robert Kern
sapsi wrote: Hello, I have a numpy array (2 rows 3 colums) import numpy a=numpy.array( [ [1,2,3] , [3,3,1] ]) I wish to add a row, this is how i do it s=a.shape numpy.resize(a,s[0]+1,s[1]) a[s[0]]=new row vector. Q: Is this a costly operation? It can be if you have large arrays. What hap

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Sebastian "lunar" Wiesner
subeen <[EMAIL PROTECTED]> at Montag 09 Juni 2008 20:21: > On Jun 10, 12:15 am, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> subeen wrote: >> > can use urllib2 module and/or beautiful soup for developing crawler >> >> Not if you care about a) speed and/or b) memory efficiency. >> >> http://blog.ia

Re: How to kill a thread?

2008-06-09 Thread Rhamphoryncus
On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > >> It's always been my understanding that you can't forcibly kill a thread > >> in Python (at least not in a po

Re: Web Crawler - Python or Perl?

2008-06-09 Thread Nick Craig-Wood
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of resource

Re: _POSIX_C_SOURCE

2008-06-09 Thread Nick Craig-Wood
Madhur <[EMAIL PROTECTED]> wrote: >I would like to know the difference between using the > C_INCLUDE_PATH and using the -I option with compilers. How are they > different? No idea on that - I always just use -I > The problem which I am facing is that I am having a > s

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:24 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "dj" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Hello again, > > > Does anyone know which method in the time module will generate and am > > or pm ? > > If none of the method will do this for me. Can I produce

Re: Web Crawler - Python or Perl?

2008-06-09 Thread George Sakkis
On Jun 9, 1:48 pm, [EMAIL PROTECTED] wrote: > Hi all, > I am currently planning to write my own web crawler. I know Python but > not Perl, and I am interested in knowing which of these two are a > better choice given the following scenario: > > 1) I/O issues: my biggest constraint in terms of reso

Re: Separators inside a var name

2008-06-09 Thread Rainy
On Jun 9, 2:05 pm, "Sebastian \"lunar\" Wiesner" <[EMAIL PROTECTED]> wrote: >  Rainy <[EMAIL PROTECTED]> at Montag 09 Juni 2008 19:29: > > > I have a stylistic question. In most languages words in var. name are > > separated by underscores or cap letters, resulting in var names like > > var_name, V

Re: time module methods give an am or pm value ?

2008-06-09 Thread dj
On Jun 7, 9:40 am, Scott David Daniels <[EMAIL PROTECTED]> wrote: > dj wrote: > > Hello again, > > > Does anyone know which method in the time module will generate and am > > or pm ? > > If none of the method will do this for me. Can I produce the value on > > my own ? > > Any suggestions ? > > Rea

Re: Does the python library of Google Data API is truly free?

2008-06-09 Thread Lie
On Jun 10, 1:36 am, Kless <[EMAIL PROTECTED]> wrote: > The Python Client Library for Google Data APIs [1] has been licensed > as Apache 2.0 -a free license- but at the same time they are > restricting the rights of the users with these conditions [2], and I > don't like for anything this. > > --Wit

Re: How to kill a thread?

2008-06-09 Thread Fuzzyman
On Jun 9, 9:20 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > > >> It's always been my understanding

Odd behavior of python module listing

2008-06-09 Thread Lie
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to the python interpreter, I happen to do this: ### START OF PYTHON SESSION ### Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more

  1   2   >