Re: Calling Python functions from Excel

2009-11-14 Thread Carsten Haese
Cannonbiker wrote: > Please I need Calling Python functions from Excel and receive result > back in Excel. Can me somebody advise simplest solution please? I am > more VBA programmer than Python. Maybe this will help: http://oreilly.com/catalog/pythonwin32/chapter/ch12.html (Scroll down to "Implem

Re: python simply not scaleable enough for google?

2009-11-14 Thread greg
John Nagle wrote: Take a good look at Shed Skin. ... You give up some flexibility; a variable can have only one primitive type in its life, or it can be a class object. That's enough to simplify the type analysis to the point that most types can be nailed down before the program is run. Th

Calling Python functions from Excel

2009-11-14 Thread Cannonbiker
Hi, unfortunately is my question about server COM (win32com) http://groups.google.com/group/comp.lang.python/browse_thread/thread/ee804cec7f58c6a7# without answer. Please I need Calling Python functions from Excel and receive result back in Excel. Can me somebody advise simplest solution please? I

Re: python simply not scaleable enough for google?

2009-11-14 Thread Terry Reedy
John Nagle wrote: Steven D'Aprano wrote: Take a good look at Shed Skin. One guy has been able to build a system that compiles Python to C++, without requiring the user to add "annotations" about types. In *only* compiles a subset of Python, as does Cython. Both cannot (currently) do gene

Re: python simply not scaleable enough for google?

2009-11-14 Thread Rami Chowdhury
On Saturday 14 November 2009 18:42:07 Vincent Manis wrote: > > 3. Very clearly CPython can be improved. I don't take most benchmarks > very seriously, but we know that CPython interprets bytecode, and > thus suffers relative to systems that compile into native code, and > likely to some other i

Re: A "terminators' club" for clp

2009-11-14 Thread Aahz
In article <7xiqddt1fd@ruckus.brouhaha.com>, Paul Rubin wrote: > >There is automatic moderation software that auto-approves any post >from an address that has had one or two posts manually approved. >While that's susceptible to address forgery, the typical spamme

Re: Documentation bugs in 3.1 - C-API - TypeObjects

2009-11-14 Thread DreiJane
Thanks ! Okay, i've already used the call of tp_free as the last statement in tp_dealloc and do understand now, that a call of tp_dealloc should be the last statement in the code for tp_free in specific cases. And yes, "Py_Type(&Foo_Type) = &PyType_Type" will be more stable against changes of the

Re: A "terminators' club" for clp

2009-11-14 Thread Aahz
In article <877htsskox@benfinney.id.au>, Ben Finney wrote: >Terry Reedy writes: >> >> So, the only reason to use c.l.p is if one wants to post anonymously, >> like the spammers do ;-). > >Or if one has an ISP who provides a Usenet feed, like mine does. Mine does, too. >A pox upon Andrew Cu

Re: Python & Go

2009-11-14 Thread Michele Simionato
Let me add a quote from the FAQ: """ Why does Go not have exceptions? Exceptions are a similar story. A number of designs for exceptions have been proposed but each adds significant complexity to the language and run-time. By their very nature, exceptions span functions and perhaps even goroutine

Re: Python as network protocol

2009-11-14 Thread Aahz
In article , Cooch wrote: > >I want to implement such specific feature: >I have a server written in Python. I have a client written in C++. I >want to use Python as network protocol between them. I mean: client >send to server such string: "a = MyObject()", so object of this type >will appear in

Re: A different take on finding primes

2009-11-14 Thread Dave Angel
Vincent Davis wrote: Out of pure curiosity I would like to compare the efficiency of different methods of finding primes (need not be consecutive). Let me be clear, given 2min, how many primes can you find, they need not be in order or consecutive. I have not seen any examples of this. I am assum

Re: Easy way to play single musical notes in Python

2009-11-14 Thread r
On Nov 14, 6:21 pm, James Harris wrote: > Is there a simple way to play musical notes in Python? Something like >   voice.play("c4") Uhh, tksnack is pretty easy to use IMO, see this link... http://www.daniweb.com/code/snippet216655.html No python does not have access to cross platform soundcard

Re: Req. comments on "first version" ch 2 progr. intro (using Python 3.x in Windows)

2009-11-14 Thread Aahz
In article , sstein...@gmail.com wrote: >On Nov 9, 2009, at 11:54 AM, Jon Clements wrote: >> On Nov 9, 4:10 pm, "Alf P. Steinbach" wrote: >>> First, because as opposed to ch 1 there is quite a bit of code >>> here, and since I'm a >>> Python newbie I may be using non-idiomatic constructs, > >We

Re: Python & Go

2009-11-14 Thread Michele Simionato
On Nov 15, 3:00 am, Terry Reedy wrote: > It seems to me that generators are already 'channels' that connect the > calling code to the __next__ method, a semi-coroutine based on the body > of the generator function. At present, the next method waits until an > object is requested. Then it goes into

Re: Python & Go

2009-11-14 Thread Michele Simionato
On Nov 14, 7:18 pm, John Nagle wrote: >      Leaving out exceptions was a mistake.  Exceptions are well understood > now, > and they're far better than the usual "ignore errors" approach one sees in > lamer > C programs. I am also surprised about the lack of exceptions. I could infer that Rob P

Re: QuerySets in Dictionaries

2009-11-14 Thread Steven D'Aprano
On Fri, 13 Nov 2009 14:10:10 -0800, scoopseven wrote: > I actually had a queryset that was dynamically generated, so I ended up > having to use the eval function, like this... > > d = {} > for thing in things: > query_name = 'thing_' + str(thing.id) > query_string = 'Thing.object

Re: python simply not scaleable enough for google?

2009-11-14 Thread John Nagle
Steven D'Aprano wrote: On Wed, 11 Nov 2009 16:38:50 -0800, Vincent Manis wrote: I'm having some trouble understanding this thread. My comments aren't directed at Terry's or Alain's comments, but at the thread overall. 1. The statement `Python is slow' doesn't make any sense to me. Python is a

Re: Anything better than shutil?

2009-11-14 Thread Steven D'Aprano
On Sat, 14 Nov 2009 07:48:39 -0800, Roy Smith wrote: > I'm converting some old bash scripts to python. There's lots of places > where I'm doing things like "rm $source_dir/*.conf". The best way I can > see to convert this into python is: > > configs = glob.glob(os.path.join(source_dir, '*.c

Re: Python & Go

2009-11-14 Thread Steven D'Aprano
On Sat, 14 Nov 2009 11:14:04 +, kj wrote: > In <7xpr7lixnn@ruckus.brouhaha.com> Paul Rubin > writes: > >>It seems a little weird to me that they (Google) are concerned with the >>speed of the compiler, indicating that they plan to write enormous >>programs i

Re: The ol' [[]] * 500 bug...

2009-11-14 Thread Steven D'Aprano
On Fri, 13 Nov 2009 21:26:01 +, kj wrote: > ...just bit me in the "fuzzy posterior". It's not a bug. Just because it doesn't behave as you would like it to behave doesn't mean it isn't behaving as designed. > The best I can come up with is the hideous > > lol = [[] for _ in xrange(500)

Re: Vote on PyPI comments

2009-11-14 Thread Steven D'Aprano
On Fri, 13 Nov 2009 07:53:05 -0800, Michele Simionato wrote: > I am skeptical about the utility of both rating and comments. If > somebody wants to know > if a package is good, she should ask here. Because unlike people writing comments, people here are never incompetent, misinformed, dishonest,

Re: python simply not scaleable enough for google?

2009-11-14 Thread Steven D'Aprano
On Fri, 13 Nov 2009 18:25:59 -0800, Vincent Manis wrote: > On 2009-11-13, at 15:32, Paul Rubin wrote: >> This is Usenet so >> please stick with Usenet practices. > Er, this is NOT Usenet. Actually it is. I'm posting to comp.lang.python. > 1. I haven't, to the best of my recollection, made a U

Re: Simple object reference

2009-11-14 Thread Chris Rebert
On Sat, Nov 14, 2009 at 6:53 PM, Terry Reedy wrote: > Chris Rebert wrote: >> On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote: >>> Hi, I have some problem with object reference >>> Say I have this code >>> >>> a = b = c = None >>> slist = [a,b,c] >> >> Values are stored in the list, not reference

Re: Simple object reference

2009-11-14 Thread Terry Reedy
Chris Rebert wrote: On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote: Hi, I have some problem with object reference Say I have this code a = b = c = None slist = [a,b,c] Values are stored in the list, not references to names. That is not right either, or else newbies would not be surprised

Re: python simply not scaleable enough for google?

2009-11-14 Thread Vincent Manis
This whole thread has now proceeded to bore me senseless. I'm going to respond once with a restatement of what I originally said. Then I'm going to drop it, and never respond to the thread again. Much of what's below has been said by others as well; I'm taking no credit for it, just trying to pu

Re: A "terminators' club" for clp

2009-11-14 Thread Terry Reedy
Ben Finney wrote: Terry Reedy writes: So, the only reason to use c.l.p is if one wants to post anonymously, like the spammers do ;-). Or if one has an ISP who provides a Usenet feed, like mine does. Gmane is a nntp news feed, just not a usenet feed. If you can read usenet, you can read gm

Re: A "terminators' club" for clp

2009-11-14 Thread Terry Reedy
r wrote: On Nov 14, 4:52 pm, Terry Reedy wrote: So, the only reason to use c.l.p is if one wants to post anonymously, like the spammers do ;-). I don't think that completely correct. Lots of people find GG's to be more suited to their news reading pleasures, I was referring to c.l.p on a nn

Re: A "terminators' club" for clp

2009-11-14 Thread Terry Reedy
Paul Rubin wrote: Terry Reedy writes: To post from g.c.p.g, one must use a real email address and respond once to an email sent to that address. So, the only reason to use c.l.p is if one wants to post anonymously, like the spammers do ;-). No I don't think so. "Unwilling to disclose email

Re: Documentation bugs in 3.1 - C-API - TypeObjects

2009-11-14 Thread Martin v. Löwis
> This cannot work, because Foo_Type is no PyObject but a PyVarObject > (independent > of the use of PyVarObject_HEAD_INIT or PyObject_HEAD_INIT). The code > line would > work so: > > ((PyObject *)&Foo_Type)->ob_type = &PyType_Type However, this is not what you should use. Instead, use Py_Type(&

Re: Python & Go

2009-11-14 Thread Terry Reedy
Yoav Goldberg wrote: On Sun, Nov 15, 2009 at 12:10 AM, Terry Reedy > wrote: Paul Rubin wrote: Mark Chu-Carroll has a new post about Go: http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php In a couple of minutes, I w

Re: Run a external program.

2009-11-14 Thread Terry Reedy
Top-posting makes things more confusing. You cannot pass a Python file object to an external process. Pass the name instead. Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? Quoting MRAB : Yasser Almeida Hernández wrote: Hi all!! I'm writin

A different take on finding primes

2009-11-14 Thread Vincent Davis
Out of pure curiosity I would like to compare the efficiency of different methods of finding primes (need not be consecutive). Let me be clear, given 2min, how many primes can you find, they need not be in order or consecutive. I have not seen any examples of this. I am assume the solution is diffe

Re: Simple object reference

2009-11-14 Thread Ben Finney
Chris Rebert writes: > On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote: > > Hi, I have some problem with object reference > > Say I have this code > > > > a = b = c = None > > slist = [a,b,c] > > Values are stored in the list, not references to names. Modifying the > list does not change what v

Re: Easy way to play single musical notes in Python

2009-11-14 Thread James Harris
On 15 Nov, 00:12, James Harris wrote: > Is there a simple way to play musical notes in Python? Something like > >   voice.play("c4") > > to play C in octave 4 would be ideal. I included a voice parameter as > I'd like to play proper notes, not just beeps. This is for recognition > of pitch. For e

Re: A "terminators' club" for clp

2009-11-14 Thread Ben Finney
Terry Reedy writes: > So, the only reason to use c.l.p is if one wants to post anonymously, > like the spammers do ;-). Or if one has an ISP who provides a Usenet feed, like mine does. A pox upon Andrew Cuomo for bashing ISPs in the USA with the stick of “child pornography” (which he discovered

Easy way to play single musical notes in Python

2009-11-14 Thread James Harris
Is there a simple way to play musical notes in Python? Something like voice.play("c4") to play C in octave 4 would be ideal. I included a voice parameter as I'd like to play proper notes, not just beeps. This is for recognition of pitch. For example, the program plays a note and the user tries

Re: A "terminators' club" for clp

2009-11-14 Thread r
On Nov 14, 4:52 pm, Terry Reedy wrote: > So, the only reason to use c.l.p is if one wants to post anonymously, > like the spammers do ;-). I don't think that completely correct. Lots of people find GG's to be more suited to their news reading pleasures, i am one of them. I hate to have an email j

Re: Psyco on 64-bit machines

2009-11-14 Thread Russ P.
On Nov 12, 12:06 pm, "Russ P." wrote: > I have a Python program that runs too slow for some inputs. I would > like to speed it up without rewriting any code. Psyco seemed like > exactly what I need, until I saw that it only works on a 32-bit > architecture. I work in an environment of Sun Ultras t

Re: Simple object reference

2009-11-14 Thread Chris Rebert
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO wrote: > Hi, I have some problem with object reference > Say I have this code > > a = b = c = None > slist = [a,b,c] Values are stored in the list, not references to names. Modifying the list does not change what values the names a, b, and c have. There

Simple object reference

2009-11-14 Thread AON LAZIO
Hi, I have some problem with object reference Say I have this code a = b = c = None slist = [a,b,c] for i in range(len(slist)): slist[i] = 5 print slist print a,b,c I got this [5, 5, 5] None None None Question is how can I got all a,b,c variable to have value 5 also? Thanks in advance --

Re: A "terminators' club" for clp

2009-11-14 Thread Paul Rubin
Terry Reedy writes: > To post from g.c.p.g, one must use a real email address and respond > once to an email sent to that address. > > So, the only reason to use c.l.p is if one wants to post anonymously, > like the spammers do ;-). No I don't think so. "Unwilling to disclose email address or e

Re: python simply not scaleable enough for google?

2009-11-14 Thread Robert Brown
Vincent Manis writes: > The false statement you made is that `... Python *the language* is specified > in a way that makes executing Python programs quickly very very difficult. > I refuted it by citing several systems that implement languages with > semantics similar to those of Python, and do s

Re: Psyco on 64-bit machines

2009-11-14 Thread Russ P.
On Nov 14, 10:15 am, "Diez B. Roggisch" wrote: > Russ P. schrieb: > > > I have a Python program that runs too slow for some inputs. I would > > like to speed it up without rewriting any code. Psyco seemed like > > exactly what I need, until I saw that it only works on a 32-bit > > architecture. I

Re: A "terminators' club" for clp

2009-11-14 Thread Terry Reedy
r wrote: On Nov 14, 4:59 am, kj wrote: But, as I already showed, I'm out of my depth here, so I'd better shut up. Don't give up so easy! The idea is great, what Paul is saying is that most people who read this group use newsreaders and that has nothing to do with google groups. These guy's ha

Re: python simply not scaleable enough for google?

2009-11-14 Thread Terry Reedy
Willem Broekema wrote: It might have gotten a bit better, but the central message still stands: Python has made design choices that make efficient compilation hard. OK, let me try this again. My assertion is that with some combination of JITting, reorganization of the Python runtime, and opti

Re: Python & Go

2009-11-14 Thread Yoav Goldberg
On Sun, Nov 15, 2009 at 12:10 AM, Terry Reedy wrote: > Paul Rubin wrote: > > Mark Chu-Carroll has a new post about Go: >> >> >> http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php >> > > In a couple of minutes, I wrote his toy prime filter example in Python, > mostly from

Re: python simply not scaleable enough for google?

2009-11-14 Thread Edward A. Falk
In article , Terry Reedy wrote: > >I can imagine a day when code compiled from Python is routinely >time-competitive with hand-written C. I can't. Too much about the language is dynamic. The untyped variables alone are a killer. int a,b,c; ... a = b + c; In C, this c

Re: Python & Go

2009-11-14 Thread Terry Reedy
Paul Rubin wrote: Mark Chu-Carroll has a new post about Go: http://scienceblogs.com/goodmath/2009/11/the_go_i_forgot_concurrency_an.php In a couple of minutes, I wrote his toy prime filter example in Python, mostly from the text rather than the code, which I can barely stand to read. It r

Re: python simply not scaleable enough for google?

2009-11-14 Thread Terry Reedy
sturlamolden wrote: - For the few cases where a graphics program really need C, we can always resort to using ctypes, f2py or Cython. Gluing Python with C or Fortran is very easy using these tools. That is much better than keeping it all in C++. In case anyone thinks resorting to C or Fortran

Re: 3.x and 2.x on same machine (is this info at Python.org??)

2009-11-14 Thread Nobody
On Fri, 13 Nov 2009 06:05:48 -0500, Dave Angel wrote: >>> Currently i am using 2.6 on Windows and need to start writing code in >>> 3.0. I cannot leave 2.x yet because 3rd party modules are still not >>> converted. So i want to install 3.0 without disturbing my current >>> Python2.x. What i'm afra

Re: Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
All ran ok!! Thanks a lot Quoting MRAB : Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? You can't pass arbitrary values on a command line. In this case, why not just pass the path of the file? s = 'command "%s" -i file2 -w 1.4 -o file3.ou

Re: Help with database planning

2009-11-14 Thread Rob Williscroft
Juliano wrote in news:0e64893a-af82-4004-bf3c-f397f2022...@g22g2000prf.googlegroups.com in comp.lang.python: [snip] > So, for ONE *concept*, we have, usually, MANY *slots*, each *slot* has > ONE *facet*, and each *facet* can have MORE THAN ONE *filler*. > Besides, some *slots* and *fillers* are

Re: Run a external program.

2009-11-14 Thread MRAB
Yasser Almeida Hernández wrote: So, how can i pass an argument as a variable in this context...? You can't pass arbitrary values on a command line. In this case, why not just pass the path of the file? s = 'command "%s" -i file2 -w 1.4 -o file3.out' % file1 Quoting MRAB : Yasser Almeida H

Re: Run a external program.

2009-11-14 Thread Chris Rebert
> Quoting MRAB : >> Yasser Almeida Hernández wrote: >>> >>> Hi all!! >>> >>> I'm writing a script where i call a external program which receive  some >>> arguments. >>> One of this arguments is stored in a variable, that is passed as >>>  argument as well: >>> >>> import os >>> ... >>> f = open(fil

Re: Python & Go

2009-11-14 Thread Paul Rubin
sturlamolden writes: > The go keyword could be a problem as well. I suspect it could infringe > on Cilk++ patents. Perhaps Go cannot be used without a licence from > Cilk Arts? Also as somebody said, if after a while they decide to make a new version of the language, they'll have to call it Go2,

Re: Python & Go

2009-11-14 Thread sturlamolden
On 14 Nov, 19:18, John Nagle wrote: > Syntax for queues is a minor win. No, that's syntax bloat. The go keyword could be a problem as well. I suspect it could infringe on Cilk++ patents. Perhaps Go cannot be used without a licence from Cilk Arts? -- http://mail.python.org/mailman/listinfo

Re: Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
So, how can i pass an argument as a variable in this context...? Quoting MRAB : Yasser Almeida Hernández wrote: Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well:

Re: Run a external program.

2009-11-14 Thread Mark Tolonen
"Yasser Almeida Hernández" wrote in message news:20091114142611.sj45qput2c84s...@correo.fenhi.uh.cu... Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os

Re: Choosing GUI Module for Python

2009-11-14 Thread sturlamolden
On 14 Nov, 19:02, Dietmar Schwertberger wrote: > 08/23/2009 Version 3.01.63 (Beta) > 08/19/2009 Version 3.01.62 (Beta) > > I tried 3.01.63. > I can see in the Python window already that the code is not correct. 3.01.63 Did you remember to install the wxAdditions? Could you send me an .fbp file

Re: Run a external program.

2009-11-14 Thread MRAB
Yasser Almeida Hernández wrote: Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os ... f = open(file1, 'r') s = 'command $f -i file2 -w 1.4 -o file3.out' os.s

Re: python-daemon and upstart

2009-11-14 Thread Paul Rudin
Paul Rudin writes: > > So I would have expected it to be necessary in this case. Maybe this is > more an upstart issue than a python-daemon one - not sure. Aha - so I discover that if detach_process is not explicitly passed to the DaemonContext initialiser it tries to guess whether it ne

Run a external program.

2009-11-14 Thread Yasser Almeida Hernández
Hi all!! I'm writing a script where i call a external program which receive some arguments. One of this arguments is stored in a variable, that is passed as argument as well: import os ... f = open(file1, 'r') s = 'command $f -i file2 -w 1.4 -o file3.out' os.system(s) ... When i run the sc

Re: python simply not scaleable enough for google?

2009-11-14 Thread Grant Edwards
On 2009-11-14, David Robinow wrote: > On Fri, Nov 13, 2009 at 3:32 PM, Paul Rubin > wrote: >> ... ?This is Usenet so >> please stick with Usenet practices. ?If you want a web forum there are >> plenty of them out there. > Actually this is python-list@python.org Actu

Re: Python & Go

2009-11-14 Thread Paul Rubin
kj writes: > One more thing: I found Rob Pike's mutterings on generics (towards > the end of his rollout video) rather offputting, because he gave > the impression that some important aspects of the language were > not even considered before major decisions for it were set in stone. > It looks lik

Re: Python & Go

2009-11-14 Thread Paul Rubin
sturlamolden writes: > And looking at Go, I cannot understand why Google prefer this over > e.g. Lua. I thought Lua had no type system and no concurrency. -- http://mail.python.org/mailman/listinfo/python-list

Re: A "terminators' club" for clp

2009-11-14 Thread Paul Rubin
"Alf P. Steinbach" writes: > The problem with moderation isn't getting rid of spam and trolls etc., > but turnaround time. There is automatic moderation software that auto-approves any post from an address that has had one or two posts manually approved. While that's susceptible to address forger

Re: The ol' [[]] * 500 bug...

2009-11-14 Thread Paul Rubin
Ulrich Eckhardt writes: > That said, [[]]*500 is IMHO more readable. But the issue in the thread is that it does the wrong thing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Psyco on 64-bit machines

2009-11-14 Thread Diez B. Roggisch
Russ P. schrieb: I have a Python program that runs too slow for some inputs. I would like to speed it up without rewriting any code. Psyco seemed like exactly what I need, until I saw that it only works on a 32-bit architecture. I work in an environment of Sun Ultras that are all 64- bit. However

Re: python simply not scaleable enough for google?

2009-11-14 Thread Paul Rubin
sturlamolden writes: > Python on a better VM (LuaJIT, Parrot, LLVM, several > JavaScript) will easily outperform CPython by orders of magnitide. Maybe Python semantics make it more difficult to optimize than those other languages. For example, in a = foo.bar(1) b = muggle() c = foo.bar(2)

Re: A "terminators' club" for clp

2009-11-14 Thread r
On Nov 14, 7:28 am, gil_johnson wrote: > How about using a "rank this post" feature? Anybody could rank a post > as spam, and a sufficiently large number of negatives would quickly > draw the attention of someone with the power to kill the message. I > suppose even this is subject to abuse, allow

Re: Python & Go

2009-11-14 Thread John Nagle
sturlamolden wrote: On 12 Nov, 01:53, kj wrote: I'm just learning about Google's latest: the GO (Go?) language. It's interesting. The semantics are closer to Java than any other mainstream language. While Java usually is run with a "virtual machine", Go is more like Java hard-compiled (

Re: Choosing GUI Module for Python

2009-11-14 Thread Dietmar Schwertberger
sturlamolden schrieb: On 14 Nov, 15:35, Dietmar Schwertberger wrote: self.m_toolBar1 = self.CreateToolBar( wx.TB_HORIZONTAL, wx.ID_ANY ) self.m_button1 = wx.Button( self.m_toolBar1, wx.ID_ANY, u"MyButton", wx.DefaultPosition, wx.DefaultSize, 0 ) m_toolBar1.AddControl( m_button1 ) (i.

Re: How to know if a file is a text file

2009-11-14 Thread Philip Semanchuk
On Nov 14, 2009, at 11:02 AM, Luca Fabbri wrote: Hi all. I'm looking for a way to be able to load a generic file from the system and understand if he is plain text. The mimetype module has some nice methods, but for example it's not working for file without extension. Hi Luca, You have to de

Re: python-daemon and upstart

2009-11-14 Thread Paul Rudin
Paul Rudin writes: > Ben Finney writes: > >> Paul Rudin writes: >>> description "test daemon" >>> expect daemon >>> chdir /tmp >>> exec /tmp/testdaemon.py Further experimentation reveals that by omitting the "expect daemon" stanza everything works fine. But I'm still a confused - the manpage

Re: bootstrapping on machines without Python

2009-11-14 Thread Jonathan Hartley
On Nov 13, 10:25 pm, mma...@gmx.net wrote: > On Fri, 13 Nov 2009 02:40:28 -0800 (PST) > > Jonathan Hartley wrote: > > Even my very limited understanding of the issues is enough to see that > > the idea is far from trivial. Thanks heaps for the input from everyone. Martin Lemburg's 'chained' appr

Re: Choosing GUI Module for Python

2009-11-14 Thread sturlamolden
On 14 Nov, 15:35, Dietmar Schwertberger wrote: >    self.m_toolBar1 = self.CreateToolBar( wx.TB_HORIZONTAL, wx.ID_ANY ) >    self.m_button1 = wx.Button( self.m_toolBar1, wx.ID_ANY, u"MyButton", > wx.DefaultPosition, wx.DefaultSize, 0 ) >    m_toolBar1.AddControl( m_button1 ) > > (i.e. "self." is

Re: Python & Go

2009-11-14 Thread Michele Simionato
On Nov 14, 12:26 pm, kj wrote: > > The two goals of replacing C with "something more modern" and at > the same time have a "nearly zero learning curve" seem to me mutually > negating.  The closer to zero the learning curve is, the closer to > C/C++, and therefore the less modern, that language wil

Re: bootstrapping on machines without Python

2009-11-14 Thread Jonathan Hartley
On Nov 13, 1:57 pm, Tim Golden wrote: > Jonathan Hartley wrote: > > While examining py2exe et al of late, my thoughts keep returning to > > the idea of writing, in C or similar, a compiled stand-alone > > executable 'bootstrapper', which: > > 1) downloads and install a Python interpreter if none e

Re: More Python versions on an XP machine

2009-11-14 Thread DreiJane
Hi, there are several ways to do that besides starting python scripts with a double-click on a desktop icon (that can only work with the one and only python version of the registry). One is to start the new python version directly from a "DosBox". You could copy python.exe or pythonw.exe from the

Re: python-daemon and upstart

2009-11-14 Thread Paul Rudin
Ben Finney writes: > Paul Rudin writes: > >> I'm experimenting with the daemon module >> and upstart >> . > > First: Thank you for using ‘python-daemon’; it's getting more widespread > use all the time, which is really help

Re: __import__ returns module without it's attributes?

2009-11-14 Thread Dave Angel
Zac Burns wrote: I've overloaded __import__ to modify modules after they are imported... but running dir(module) on the result only returns __builtins__, __doc__, __file__, __name__, __package__, and __path__. Why is this? More importantly, where can I hook in that would allow me to see the co

Documentation bugs in 3.1 - C-API - TypeObjects

2009-11-14 Thread DreiJane
Hello, this page http://docs.python.org/3.1/c-api/typeobj.html has a bad error: " PyTypeObject* PyObject.ob_type This is the type’s type, in other words its metatype. It is initialized by the argument to the PyObject_HEAD_INIT macro, and its value should normally be &PyType_Type. However, for dy

How to know if a file is a text file

2009-11-14 Thread Luca Fabbri
Hi all. I'm looking for a way to be able to load a generic file from the system and understand if he is plain text. The mimetype module has some nice methods, but for example it's not working for file without extension. Any suggestion? -- -- luca -- http://mail.python.org/mailman/listinfo/pyth

Re: Anything better than shutil?

2009-11-14 Thread Chris Withers
Roy Smith wrote: The idea interface I see would be one like: shutil.copy([source_dir, '*.conf'], conf_dir) the idea is that if the first argument is a list (or maybe any iterable other than a string?), it would automatically get run through os.path.join(). And, the result would always get pa

Anything better than shutil?

2009-11-14 Thread Roy Smith
I'm converting some old bash scripts to python. There's lots of places where I'm doing things like "rm $source_dir/*.conf". The best way I can see to convert this into python is: configs = glob.glob(os.path.join(source_dir, '*.conf')) for conf_file in configs: shutil.copy(conf_fi

Re: feedback on function introspection in argparse

2009-11-14 Thread Chris Withers
Yuv wrote: On Nov 8, 1:33 am, Carl Banks wrote: Is the docstring expected to be formatted according to some convention? We tried to comply to PEP 257 and we're open to suggestions on this. I'd suggest at the very least supporting Sphinx docstrings that have the parameters in them... Chri

Re: run all scripts in sub-directory as subroutines?

2009-11-14 Thread Dave Angel
Tobiah wrote: This works fine, but in the sub-modules the sys.path appropriately returns the same as from the parent, I want them to know their own file names. How?? I can pass it to them, but wondered if there is a more self-sufficient way for a module to know from where it was invoked.

ANN: PyGUI 2.1

2009-11-14 Thread Greg Ewing
PyGUI 2.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Highlights of this version: * Win32: Fixed bug preventing PyGUI apps from working under pythonw Fixed incorrect mouse coordinates in ScrollableView Added more standard cursors * MacOSX:

Re: The ol' [[]] * 500 bug...

2009-11-14 Thread Ulrich Eckhardt
Diez B. Roggisch wrote: > kj schrieb: >> lol = [[] for _ in xrange(500)] > > If you call that hideous, I suggest you perform the same exercise in > Java or C++ - and then come back to python and relax I might be missing something that's not explicitly mentioned here, but I'd say that all n

Re: Choosing GUI Module for Python

2009-11-14 Thread Dietmar Schwertberger
sturlamolden schrieb: I personally feel the wxPython support in the 3.1 beta of wxFormBuilder makes the choise rather simple. It generates a Python file with classes for all WYSIWYG GUI forms/windows/dialogs. Then in our Python code, we just import and inherit the form, and implement the event ha

Re: COM Server wirh MS Excel

2009-11-14 Thread Cannonbiker
On 14 lis, 14:34, Chris Withers wrote: > Cannonbiker wrote: > > Hi, > > I would lake use win32com with Excel. I tried to use python COM > > example from 'The Quick Python Book' on page 250 but without success. > > I suggest you have a good read ofhttp://www.python-excel.org. > > You may well find

Re: python simply not scaleable enough for google?

2009-11-14 Thread Willem Broekema
On Nov 14, 8:55 am, Vincent Manis wrote: > On 2009-11-13, at 23:20, Robert Brown wrote, quoting me: > > Please look atCLPython. [...] > Ah, that does explain it. I bet you didn't even look at it. FWIW, I'm the author of CLPython. > CLOS is most definitely the wrong vehicle for implementing > Pyt

Re: More Python versions on an XP machine

2009-11-14 Thread Diez B. Roggisch
Gabor Urban schrieb: Hi guys, this a very MS specific question. I do use a rather old Python version, because we have a couple of applications written for that. Porting them to a newer Python is not allowed by the bosses. Now we will start a new project with latest stable Python. Can I have them

Re: A "terminators' club" for clp

2009-11-14 Thread Alf P. Steinbach
* gil_johnson: On Nov 13, 5:29 pm, kj wrote: [...] Or it could be set up so that at least n > 1 "delete" votes and no "keep" votes are required to get something nixed. Etc. This seems simpler than all-out moderation. ("all-out moderation"? now, there's an oxymoron for ya!) How about using

Re: COM Server wirh MS Excel

2009-11-14 Thread Cannonbiker
On 14 lis, 14:24, Cannonbiker wrote: The ServerCOM file is here http://home.tiscali.cz/fotogalerie7/ServerCOM.py -- http://mail.python.org/mailman/listinfo/python-list

More Python versions on an XP machine

2009-11-14 Thread Gabor Urban
Hi guys, this a very MS specific question. I do use a rather old Python version, because we have a couple of applications written for that. Porting them to a newer Python is not allowed by the bosses. Now we will start a new project with latest stable Python. Can I have them both on my computer, a

Re: COM Server wirh MS Excel

2009-11-14 Thread Chris Withers
Cannonbiker wrote: Hi, I would lake use win32com with Excel. I tried to use python COM example from 'The Quick Python Book' on page 250 but without success. I suggest you have a good read of http://www.python-excel.org. You may well find you don't need to use COM at all...# Chris -- Simplist

Re: A "terminators' club" for clp

2009-11-14 Thread gil_johnson
On Nov 13, 5:29 pm, kj wrote: [...] > Or it could be set up so that at least n > 1 "delete" votes and no > "keep" votes are required to get something nixed.  Etc. > > This seems simpler than all-out moderation. > > ("all-out moderation"? now, there's an oxymoron for ya!) > How about using a "rank

COM Server wirh MS Excel

2009-11-14 Thread Cannonbiker
Hi, I would lake use win32com with Excel. I tried to use python COM example from 'The Quick Python Book' on page 250 but without success. The COM Module is successfully registetred but MS Excel reported this message http://home.tiscali.cz/fotogalerie7/Error80004005.gif I tried omitted following st

Re: Help with database planning

2009-11-14 Thread Ben Finney
Juliano writes: > We've been working with an ontology at my department […] I have been > being pushed towards changing the basic plan and build a DB so that > data access will be faster and easier for both the desktop GUI and the > web app. Right now, I'm trying to work with sqlite, since it can

  1   2   >