Re: wxStyledTextCtrl problem ?

2004-11-29 Thread Jean Brouwers
If you are running GTK+ try using self.Editor.SetSTCFocus(True) in addition to or instead of SetFocus(). Plus maybe wx.CallAfter(self.Editor.EnsureCaretVisible) It solved the 'dissapearing caret' problem for our application. /Jean Brouwers In article <[EMAIL PROTECTED]>,

ANN: TestGen 0.05 C/C++ Test Generator Released

2004-11-29 Thread Dan Gass
TestGen 0.05 is now available and contains significant enhancements. What's New -- Significant Enhancements/Changes 1) added manipc.py, a generic C/C++ source manipulator that can be used for function/method isolation and stubbing for the purposes of unit testing with any test frame

Re: wxStyledTextCtrl problem ?

2004-11-29 Thread Jean Brouwers
Here is the recent thread about this particular problem: /Jean Brouwers In article <[EMAIL PROTECTED]>, Jean Brouwers <[EMAIL PROTECTED]> wrote: > If you are running GTK+ try using > > self.Edito

Re: deleting os files

2004-11-29 Thread John Aherne
Kent Johnson <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > John Aherne wrote: > > Unfortunately, when it comes to delete, I get a permission error. And > > yes, when I run the program and try to delete the file from the > > command prompt, I get a permission error. > > > > As

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread alastair
Hi, I'm using MySQLdb with mysql 4.1 and I've seen this too - to get around it go to the following link: http://dev.mysql.com/doc/mysql/en/Old_client.html Hope this helps, Alastair. -- http://mail.python.org/mailman/listinfo/python-list

Re: Protecting Python source

2004-11-29 Thread Armin Steinhoff
Alan Sheehan wrote: Hi pythonistas, I am looking for methods of deploying applications with end users so that the python code is tamper proof. What are my options ? I understand I can supply .pyc or .pyo files but they can easily be reverse engineered I am told. Is it possible to load the scripts f

Re: Psycopg2 mirror availability

2004-11-29 Thread Gerhard Haering
On Sun, Nov 28, 2004 at 10:06:20PM +, Andrew James wrote: > Gerhard, > What's your public key? Your messages are all showing up as having an > invalid signature! The key should be on the keyservers now. -- Gerhard signature.asc Description: Digital signature -- http://mail.python.org/mailm

Re: Help on creating a HTML by python

2004-11-29 Thread Gert-Jan den Besten
sepgy writes: Can anyone help me to use a python to create an HTML photo gallery generator. When it's finished, it will be able find all the picture files (i.e. .jpg, .gif. .png files) in any given folder on the computer, automatically create smaller thumbnails for each image, and then generate a c

website hosting

2004-11-29 Thread [EMAIL PROTECTED]
Here is the link to the web hosting company that I use for my 3 sites. http://frontpage-web-hosting.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Building web graphics with Python

2004-11-29 Thread Peter Maas
Steven Feil schrieb: I am wondering if there is a light weight Python library for producing web graphics on-the-fly. There is a C-language library called gd that can be used in a CGI program to produce gif images. The Library can be used to produce graphics images that are dynamically generated.

Re: Building web graphics with Python

2004-11-29 Thread Gerhard Haering
On Mon, Nov 29, 2004 at 10:35:00AM +0100, Peter Maas wrote: > Steven Feil schrieb: > >I am wondering if there is a light weight Python library for producing > >web graphics on-the-fly. There is a C-language library called gd that > >can be used in a CGI program to produce gif images. The Library c

Re: SysLogHandler is drivin me nuts PEBCAC

2004-11-29 Thread michael
Vinay Sajip <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > michael wrote: > > Yep it was incomplete heres the complete config as it has to be > > > [config file snipped] > > The complete file looks OK. Thx. with this file it is working. The syslogd configuration under AIX was

Re: Building web graphics with Python

2004-11-29 Thread Fredrik Lundh
Steven Feil wrote: >I am wondering if there is a light weight Python library for producing > web graphics on-the-fly. There is a C-language library called gd that > can be used in a CGI program to produce gif images. The Library can > be used to produce graphics images that are dynamically genera

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Leon
new version MySQL use new Password encode . you can use ¡upassword()¡v(modify user table)¡Ato change new password encode to old password.. good luck ^^ ---by Leon-- "Dave Merrill" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D:[EMAIL PROTECTED] > Sorry for the newbness... Win2K, Python 2.3.3, MySQL

Re: Protecting Python source

2004-11-29 Thread Peter Maas
RCS schrieb: I am looking for methods of deploying applications with end users so that the python code is tamper proof. What are my options ? An interesting question is, what makes your source code so innovative as to mandate this tamper proof thing? I can think of 3 reasons to prevent tampering:

Python Design Patterns

2004-11-29 Thread Tony Ha
Hello I am learning Python for in the pass ten months, and have brought a few books about Python. Most of them are good books by its only right, and all of them only teach you how to write Python programs using Python syntax and Python ways, but no one single Python book explicitly teaches you

Re: Help on creating a HTML by python

2004-11-29 Thread M.E.Farmer
[EMAIL PROTECTED] (sepgy) wrote in message > Can anyone help me to use a python to create an HTML photo gallery > generator. When it's finished, it will be able find all the picture > files (i.e. .jpg, .gif. .png files) in any given folder on the > computer, automatically create smaller thumbnails

Re: how to drop all thread ??

2004-11-29 Thread Diez B. Roggisch
Leon wrote: > if class A( > use threading,thread module > ) to produce 100 thread,how to drop its (100 thread) when its running By exiting. There is no other way to stop a thread by force. Of course you can write a run()-method like this: def run(self): while self.running_condition:

error import _bsddb module

2004-11-29 Thread Falko Zurell
Hi Newsgroup, I installed a python 2.3.4 on my linux box and some Berkeley DB version (4.2.21 and 4.1.25). Then I installed also the BSDDB3 package for python linked against the given older version of DB. The I tried to run a program (Current Servers cadmin) which makes oviously use of bsddb but

Re: protocols, inheritance and polymorphism

2004-11-29 Thread Dirk Thierbach
Dirk Thierbach <[EMAIL PROTECTED]> wrote: > Donn Cave <[EMAIL PROTECTED]> wrote: >> Quoth Jacek Generowicz <[EMAIL PROTECTED]>: >>> Specifically, dynamic polymorphism is impossible without dynamic >>> typing. > I haven't heard the term "dynamic typing" in this context, Sorry, that should have b

Load module on IRIX 6

2004-11-29 Thread Roland Van Praag
Dear All, I try to prepare a new module named using python 1.5 on IRIX6. The shared library created is named igg.so and contains the initializarion routine initigg. I call in this routine Py_InitModule giving as first argument "igg". Whe I try to import this module, I always have the message : Sy

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Tim Williams
"Dave Merrill" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Sorry for the newbness... Win2K, Python 2.3.3, MySQL 4.1.7. Downloaded and > extracted MySQL-python-1.0.0.win32-py2.3.zip. Put the whole extracted > directory into C:\Program Files\Python23\Lib\site-packages\ and rena

Re: wxStyledTextCtrl problem ?

2004-11-29 Thread Paul Robson
On Sun, 28 Nov 2004 23:43:32 -0800, Josiah Carlson wrote: > I don't know why the problem you are having happens, but I would just > make a call to self.Editor.SetFocus() on an EVT_ACTIVATE event. Tried that, it doesn't work :( Or to be precise, it works every other time :) -- http://mail.pytho

Re: wxStyledTextCtrl problem ?

2004-11-29 Thread Paul Robson
On Mon, 29 Nov 2004 08:10:18 +, Jean Brouwers wrote: > If you are running GTK+ try using > > self.Editor.SetSTCFocus(True) > > in addition to or instead of SetFocus(). Plus maybe > > wx.CallAfter(self.Editor.EnsureCaretVisible) > > It solved the 'dissapearing caret' proble

Re: wxPython: how to update a panel content/layout according to a variable content

2004-11-29 Thread Lo?c Mah?
Thanks for the answer. I will try the method you talked about. For the moment, I am creating a new sizer and new panel and call the SetSizer(...) and SetAutoLayout(...) but this is not satisfying me. Loïc "F. GEIGER" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > wxWindow h

Re: Closing files

2004-11-29 Thread Daniel Dittmar
Henrik Holm wrote: I have recently started playing around with Python. Some of the things I have done have involved reading files. The way I do this is along the lines of f = file('file.txt') lines = f.readlines() f.close() I have noticed that it is possible to do this in one line: lines

PyQt on a Server

2004-11-29 Thread Bob Parnes
I have an application importing qt on a linux server and am missing something in trying to run it from a workstation via nfs. The workstation has the server /usr directory mounted to its own /usr directory, so it can access the necessary files. The error I get is Traceback (most recent call las

Re: PyQt on a Server

2004-11-29 Thread Phil Thompson
This is likely to be a Qt/X setup problem - PyQt doesn't explicitly call Xrender. Does your workstation /etc/ld.so.conf contain a line for /usr/X11R6/lib? Phil > I have an application importing qt on a linux server and am missing > something in trying to run it from a workstation via nfs. The >

Re: Closing files

2004-11-29 Thread Timo Virkkala
Daniel Dittmar wrote: And then there are a lot of people who think that changing all the readlines one liner would be quite easy should the need of a Jython port arrive, so why bother about it now? The problem with this approach is, when the time for the Jython port arrives, do you remember to d

Re: network programming without goto (refactoring)

2004-11-29 Thread Sibylle Koczian
Nick Coghlan schrieb: Roy Smith wrote: Jeff Shannon <[EMAIL PROTECTED]> wrote: In Python, exceptions use 'raise', not 'throw'... Doh! I guess it shows that I've been doing a lot of C++ lately :-) Heh. I'm working on a Python test harness that uses a C++ hardware interface module. I keep writing

Re: Protecting Python source

2004-11-29 Thread Craig Ringer
On Mon, 2004-11-29 at 18:04, Peter Maas wrote: > I can think of 3 reasons to prevent tampering: > > - You need money and want to sell your software on a "per seat" basis. If you mean that you therefore must add built-in copy-protection, then sure. Users will always get around it if they really w

Re: how to drop all thread ??

2004-11-29 Thread Peter Hansen
Diez B. Roggisch wrote: Leon wrote: if class A( use threading,thread module ) to produce 100 thread,how to drop its (100 thread) when its running By exiting. There is no other way to stop a thread by force. Note that even trying to exit won't work, if the threads are not marked as "daemon" threa

Re: PyQt on a Server

2004-11-29 Thread Jerry Sievers
Bob Parnes <[EMAIL PROTECTED]> writes: > I have an application importing qt on a linux server and am missing > something in trying to run it from a workstation via nfs. The > workstation has the server /usr directory mounted to its own /usr > directory, so it can access the necessary files. The

Re: Closing files

2004-11-29 Thread Daniel Dittmar
Timo Virkkala wrote: Daniel Dittmar wrote: And then there are a lot of people who think that changing all the readlines one liner would be quite easy should the need of a Jython port arrive, so why bother about it now? The problem with this approach is, when the time for the Jython port arrives,

[OT] Re: SysLogHandler is drivin me nuts PEBCAC

2004-11-29 Thread Jan Dries
Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's keyboard and not ceyboard? Regards, Jan michael wrote: Vinay Sajip <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... michael wrote: Yep it was incomplete heres the complete config as it has to be [config file

Re: Newbie MySQLdb / MySQL version problem, I think

2004-11-29 Thread Dave Merrill
Thanks Allastair, Leon, Tim, anyone else I missed. Bingo, that was it. I didn't even try looking at mysql.com, duh. In my defense (;-), I'd already spent a bunch of time in incompatible version hell with other things, so I was (too) ready to think it either wouldn't work period, or I'd borked it u

Parallel Python on PowerMac?

2004-11-29 Thread Wolfgang Keller
Hello, as I might get a dual-G5 PowerMac someday in the not to distant future, I was wondering what options are available for making Python benefit from the second CPU? Running two interpreters and using Pyro would not be the most efficient (and easiest) way, I guess? TIA, Best regards Wolfgang

knowing a file's own name

2004-11-29 Thread Scott Frankel
I'm looking for a way to identify a filename remotely. Put differently, is there a way a file can get its own name from its globals()? doit.py calls exec() on a second py script, tpairs.py, to obtain a dict of the globals in tpairs.py. How can I add the filename, "tpairs.py," to the resulting d

Re: how to drop all thread ??

2004-11-29 Thread Andrew Koenig
This reply is off topic but I couldn't resist: The best way to get rid of thread is to adopt a kitten. In fact, one of my cats is named Snobol because she is such a good string manipulator. -- http://mail.python.org/mailman/listinfo/python-list

date diff calc

2004-11-29 Thread tertius
Hi, Is there a more pythonic way to write or do a date difference calculation? I have as input two date fields in the form '-MM-DD' TIA Terius from datetime import date bdl = '2004-11-25'.split('-') edl = '2004-11-30'.split('-') bd = date(int(bdl[0]), int(bdl[1]), int(bdl[2])) ed = date(in

Re: knowing a file's own name

2004-11-29 Thread Fredrik Lundh
Scott Frankel wrote: > I'm looking for a way to identify a filename remotely. Put differently, > is there a way a file can get its own name from its globals()? > > doit.py calls exec() on a second py script, tpairs.py, to obtain a dict of > the globals in > tpairs.py. How can I add the filenam

Re: C API PyErr_Clear vs PyObject_HasAttrString

2004-11-29 Thread Andrew MacIntyre
On Sun, 28 Nov 2004, Robin Becker wrote: > > I had a look at the source (from a CVS checkout this morning), and the > > only thing that looks like a source of such trouble would be an extension > > class with a tp_getattr implementation. > > It is such a beast, but the exciting test case looks lik

unicode in doctests

2004-11-29 Thread Bjorn Tillenius
I'm trying to combine documentation and testing, by using DocFileSuite from Python 2.4. But the problem is that I need to write non-ascii characters in the test, and I can't get it to work. I haven't found a way to specify which encoding the file is in, so it gets decoded to unicode. Anyone know i

Question on sorting

2004-11-29 Thread Lad
Hi, I have a file of records of 4 fields each. Each field is separated by a semicolon. That is Filed1;Ffield2;Field3;Field4 But there may be also empty records such as (only semicolons). For sorting I used # lines = file('Config.txt').readlines()# a file I want to sort lines

Re: date diff calc

2004-11-29 Thread Diez B. Roggisch
> bdl = '2004-11-25'.split('-') > edl = '2004-11-30'.split('-') > bd = date(int(bdl[0]), int(bdl[1]), int(bdl[2])) > ed = date(int(edl[0]), int(edl[1]), int(edl[2])) using time.strptime and datetime.date.fromtimestamp is surely the better alternative, as it lets specify you the format by a str

Re: [OT] Re: SysLogHandler is drivin me nuts PEBCAC

2004-11-29 Thread Lloyd Zusman
Jan Dries <[EMAIL PROTECTED]> writes: > Slightly OT, but regarding the title, shouldn't it be PEBKAC, since it's > keyboard and not ceyboard? Your computer didn't come with a ceyboard? :) -- Lloyd Zusman [EMAIL PROTECTED] God bless you. -- http://mail.python.org/mailman/listinfo/python-li

Re: date diff calc

2004-11-29 Thread tertius
Diez B. Roggisch wrote: > I can't imagine what could possibly be easier than subtracting two dates - in fact, most times one has to jump through much more hoops to achieve these results, e.g. in java. I'll try that. Thanks, T -- http://mail.python.org/mailman/listinfo/python-list

Re: Question on sorting

2004-11-29 Thread wes weston
Lad wrote: Hi, I have a file of records of 4 fields each. Each field is separated by a semicolon. That is Filed1;Ffield2;Field3;Field4 But there may be also empty records such as (only semicolons). For sorting I used # lines = file('Config.txt').readlines()# a file I want to so

pdb with emacs

2004-11-29 Thread Yuri Shtil
Hi, I am trying to learn python and use the gud/pdb from emacs. The functionality that I am used to under gud/gdb and gud/perldb is missing, or I don't know how to make it work. Specifically: when I start pdb on a script file, the source does not show in an another window as it does with perldb an

Re: Parallel Python on PowerMac?

2004-11-29 Thread Alan Kennedy
[Wolfgang Keller] > as I might get a dual-G5 PowerMac someday in the not to distant > future, I was wondering what options are available for making Python > benefit from the second CPU? Running two interpreters and using Pyro > would not be the most efficient (and easiest) way, I guess? Qualifier:

Re: date diff calc

2004-11-29 Thread Skip Montanaro
tertius> Is there a more pythonic way to write or do a date difference tertius> calculation? I have as input two date fields in the form tertius> '-MM-DD' How about: import datetime import time bd = "2004-11-25" ed = "2004-11-30" start = datetime.date.fromti

Re: Protecting Python source

2004-11-29 Thread Peter Maas
Craig Ringer schrieb: On Mon, 2004-11-29 at 18:04, Peter Maas wrote: I can think of 3 reasons to prevent tampering: [...] My understanding is that that's never guaranteed safe, no? Or are restrictions against reverse engineering now commonly enforcable? It's not guaranteed but if protection works

Re: Protecting Python source

2004-11-29 Thread Grant Edwards
On 2004-11-29, Peter Maas <[EMAIL PROTECTED]> wrote: > If the "reverse engineering" argument boils down to "protecting source > doesn't make sense" then why does Microsoft try so hard to protect > its sources? To avoid embarassment. -- Grant Edwards grante Yow! W

Re: A lock that times out but doesn't poll

2004-11-29 Thread Jive
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jive wrote: > > Oh, there will be no bugs. > > ?? What kind of a statement is that? Humorous? Imagine Carl Spackler in Caddy Shack saying, "Oh, there will be no money." > Seriously, why are you so confident about that

Re: Parallel Python on PowerMac?

2004-11-29 Thread Wolfgang Keller
Hello, and thanks for your reply. > But I would venture to say that, *in the general case*, the "most > efficient" way to benefit from a second cpu, both in terms of coding > time and execution efficiency, is to use either jython *cough* *choke* Err, no, sorry, not for me. > Although, iff yo

httplib question

2004-11-29 Thread Laszlo Zsolt Nagy
Hello, This is from the docs, from section 11.6.1 (HTTPConnection Objects) HTTPConnection instances have the following methods: request( method, url[, body[, headers]]) [.] The headers argument should be a mapping of extra HTTP headers to send with the request. AFAIK the only standard map

Re[2]: httplib question

2004-11-29 Thread Laszlo Zsolt Nagy
Hello Stuart, Monday, November 29, 2004, 8:59:57 PM, you wrote: > Laszlo, > The "request" method call expects a "body" parameter that defaults to None > as the 3rd method parameter. You will either need to pass in an empty > string as the body parameter, or assign the headers property by named

Re: Operator Overloading

2004-11-29 Thread Bengt Richter
On 25 Nov 2004 06:35:23 -0800, [EMAIL PROTECTED] (Sebastien Boisgerault) wrote: >Peter Maas <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... >> Sebastien Boisgerault schrieb: >> > I wonder if the following quotation from the Python Reference Manual >> > (release 2.3.3) about opera

Re: Protecting Python source

2004-11-29 Thread Dave Reed
On Monday 29 November 2004 14:13, Grant Edwards wrote: > On 2004-11-29, Peter Maas <[EMAIL PROTECTED]> wrote: > > > If the "reverse engineering" argument boils down to "protecting source > > doesn't make sense" then why does Microsoft try so hard to protect > > its sources? > > To avoid embaras

Re: date diff calc

2004-11-29 Thread Rick Holbert
Here's how to do it as a one-liner: python -c "import datetime; import time; print 'Only %d days until Christmas' % (datetime.date(2004, 12, 25) - datetime.date.fromtimestamp(time.time())).days" Here's a slightly shorter way of doing it: python -c "import time; print 'Only %f more days until Ch

Re: Building web graphics with Python

2004-11-29 Thread Larry Bates
ReportLab Graphics module can produce graphics and then save into many formats via Python Imaging Library (PIL). Larry Bates Steven Feil wrote: I am wondering if there is a light weight Python library for producing web graphics on-the-fly. There is a C-language library called gd that can be used i

POSH on PowerMac? (was: Parallel Python on PowerMac?)

2004-11-29 Thread Wolfgang Keller
>> Although, iff your prospective machine supports System V IPC, > > No clue whether MacOS X does so. [EMAIL PROTECTED]&! Read before you post. According to "Mac OS X for UNIX Users" there's a compatibility library included in Mac OS X that does so. Now who's got a the tools and the know-how to

Python UPS / FedEx Shipping Module

2004-11-29 Thread Gabriel Cooper
Is there an existing UPS and FedEx capable shipping (as in, price quotes) module out there? I have UPS working but now I need FedEx and was curious whether I'd be reinventing the wheel. ;) Web searches didn't reveal anything particularly interesting. Also, anyone know what happened to the "paym

slicing, mapping types, ellipsis etc.

2004-11-29 Thread Jerry Sievers
Fellow Pythonists; I am totally puzzled on the use of slicing on mapping types and especially unsure on use of the Ellipsis... and slicing syntax that has two or more groups seperated by comma. I am referring to (from the manual); Slice objects Slice objects are used to

Random number generation from functions

2004-11-29 Thread drs
Is there any way to generate random numbers based on arbitrary real valued functions? I am looking for something like random.gauss() but with natural log and exponential functions. thanks, -d -- http://mail.python.org/mailman/listinfo/python-list

Re: how to drop all thread ??

2004-11-29 Thread Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.
Hi ! The best method, it is the suicide (of the threads). -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchat and threading

2004-11-29 Thread Eric S. Johansson
Anthony Baxter wrote: twisted is too large to go into the python core as is - in addition, there's a mismatch between Python's release cycle speed and twisted's release cycle speed (although the current delayed-until-who-knows-when Twisted 2.0 might be a harbinger of twisted slowing down to Python

PIL 1.1.4 paste PNG's with transparency problem

2004-11-29 Thread Caleb Hattingh
Here's hoping effbot is around :) I have a really simple situation where I have 2 png images, and open them so: '>>> iconBallImage = Image.open('sampleTextures/iconBall.png').resize(DimensionSize) '>>> iconShieldImage = Image.open('sampleTextures/iconShield.png').resize(DimensionSize) The 2

Re: Parallel Python on PowerMac?

2004-11-29 Thread Robert Kern
Alan Kennedy wrote: Although, iff your prospective machine supports System V IPC, you might want to check out PoSH. http://poshmodule.sourceforge.net It uses inline assembly, so that's a no-go on the PPC unless someone ports the assembly code. -- Robert Kern [EMAIL PROTECTED] "In the fields of

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Caleb Hattingh
I'm going to assume the following is self-explanatory - type the commands in yourself. '>>> a = 'hello my name is caleb' '>>> b = a.split() '>>> b ['hello', 'my', 'name', 'is', 'caleb'] '>>> b[0] 'hello' '>>> b[1] 'my' '>>> b[0:1] ['hello'] '>>> b[0:2] ['hello', 'my'] '>>> b[-1] 'caleb' '>>> b[:

Re: asynchat and threading

2004-11-29 Thread Caleb Hattingh
I heartily support something like this, but alas I have not the time to help out with it. I like the Enthought python distribution because it installs several packages in one shot. A pity there isn't a similar thing for python addons in Linux (or is there?). Something apt-get-like would be

using os

2004-11-29 Thread Juliano Freitas
how can i get just the directories in other directorie without a files using the os module in Python?? Juliano -- http://mail.python.org/mailman/listinfo/python-list

Re: The use of :

2004-11-29 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, bruno modulix wrote: > > In fact, from a purely technical POV, the ':' could have been omitted > from the Python syntax, since indentation does the whole job of defining > blocks. It's only here for readability AFAIK. > The ':' serves as a very good hint to "python awa

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Jerry Sievers
"Caleb Hattingh" <[EMAIL PROTECTED]> writes: > I'm going to assume the following is self-explanatory - type the commands > in yourself. [snip] Yes, it certainly is self-explanatory. And, I appreciate your response. However, my question pertains to advanced use of the slicing features which I

Re: using os

2004-11-29 Thread Jeffrey Froman
Juliano Freitas wrote: > how can i get just the directories in other directorie without a files > using the os module in Python?? You can test using os.path.isdir, for example: >>> import os >>> [x for x in os.listdir('.') if os.path.isdir(x)] Jeffrey -- http://mail.python.org/ma

Re: using os

2004-11-29 Thread Jean Brouwers
Check the os.walk() and os.path.walk() functions. More details and some examples are at resp. /Jean Brouwers In article <[EMAIL PROTECTED]>, Juliano Freitas <[EMAIL PROTECTED]> wrote: > how

tkinter manual question

2004-11-29 Thread Sean McIlroy
The 'Canvas Methods' section of the online Intro to Tkinter (http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm) refers (without explanation) to something called "bbox". What is this? TIA -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchat and threading

2004-11-29 Thread Jp Calderone
On Mon, 29 Nov 2004 16:05:14 -0500, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > If I could simply do: py-get twisted > and have all of the dependencies resolved, it would be wonderful. as a > prototype, I would suggest wrapping apt-get with a python envelope which > automatically invokes

Re: Help on creating a HTML by python

2004-11-29 Thread Jarek Zgoda
sepgy wrote: Can anyone help me to use a python to create an HTML photo gallery generator. When it's finished, it will be able find all the picture files (i.e. .jpg, .gif. .png files) in any given folder on the computer, automatically create smaller thumbnails for each image, and then generate a co

Anybody using Arch?

2004-11-29 Thread Gustavo Córdova Avila
Does anybody have an Arch archive with the current python source I could slurp it from? Thanks in advance :-) -- Gustavo Córdova Avila <[EMAIL PROTECTED]> *Tel:* +52 (81) 8130-1919 ext. 127 Integraciones del Norte, S.A. de C.V. Padua #6047, Colonia Satélite Acueducto M

Re: using os

2004-11-29 Thread Jerry Sievers
Juliano Freitas <[EMAIL PROTECTED]> writes: > how can i get just the directories in other directorie without a > files using the os module in Python?? If there's a command for listing only dirs, I've not stumbled on it. Here's a one-liner using filter and lambda; from os import listdir from os.

Re: unicode question

2004-11-29 Thread Bengt Richter
On Tue, 23 Nov 2004 20:37:04 +0100, =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= <[EMAIL PROTECTED]> wrote: >Steve Holden wrote: >> Am I the only person who found it scary that Bengt could apparently >> casually drop on a polynomial the would decode to " Löwis"? Well, don't give me too much credit

Re: tkinter manual question

2004-11-29 Thread Richard Townsend
On 29 Nov 2004 13:58:05 -0800, Sean McIlroy wrote: > The 'Canvas Methods' section of the online Intro to Tkinter > (http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm) > refers (without explanation) to something called "bbox". What is this? > TIA Do you mean this section ?

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Steven Bethard
Jerry Sievers wrote: 1. what the Ellipsis object or ... syntax is used for 2. what a slice [..., j:k:l] does My understanding is that the Ellipsis object is intended primarily for Numeric/numarray use. Take a look at: http://stsdas.stsci.edu/numarray/numarray-1.1.html/node26.html 3. how slices a

Question of Optionparse

2004-11-29 Thread Pekka Niiranen
Hi, How can I STOP Optionparse to process boolean value as parameter. See this: >>> parser = optparse.OptionParser() >>> parser.add_option("-x",dest='xxx', action="store_true",help="xxx") >>> parser.add_option("-r",dest='root',help="directory",type="string") >>> args = ["-r", "d:", "-x"] >>> parser

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Scott David Daniels
Jerry Sievers wrote: I'd like to know; 1. what the Ellipsis object or ... syntax is used for Use the Numeric (or numarray) package to really see these in use. Otherwise, you mostly get to implement it yourself. > 2. what a slice [..., j:k:l] does Again, see numeric. Essentially, select parts of a

Re: using os

2004-11-29 Thread Jeremy Jones
Jerry Sievers wrote: Juliano Freitas <[EMAIL PROTECTED]> writes: how can i get just the directories in other directorie without a files using the os module in Python?? If there's a command for listing only dirs, I've not stumbled on it. Here's a one-liner using filter

Numeric: 'where' function conditions

2004-11-29 Thread Jorl Shefner
Could anyone tell me the efficient way to do this? Extracting values from an array for a single condition (say all values greater than 'x') using 'where' and 'compress' is simple enough. >>> from Numeric import arange,where,compress >>> data= arange(10) >>> data= [0, 1, 2, 3, 4, 5, 6, 7, 8,

Re: tkinter manual question

2004-11-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Sean McIlroy <[EMAIL PROTECTED]> wrote: >The 'Canvas Methods' section of the online Intro to Tkinter >(http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm) >refers (without explanation) to something called "bbox". What is this? >TIA "bounding bo

Re: Numeric: 'where' function conditions

2004-11-29 Thread Robert Kern
Jorl Shefner wrote: Could anyone tell me the efficient way to do this? Extracting values from an array for a single condition (say all values greater than 'x') using 'where' and 'compress' is simple enough. from Numeric import arange,where,compress data= arange(10) data= [0, 1, 2, 3, 4, 5,

pre-PEP generic objects

2004-11-29 Thread Steven Bethard
I promised I'd put together a PEP for a 'generic object' data type for Python 2.5 that allows one to replace __getitem__ style access with dotted-attribute style access (without declaring another class). Any comments would be appreciated! Thanks! Steve -

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Bengt Richter
On 29 Nov 2004 16:45:52 -0500, Jerry Sievers <[EMAIL PROTECTED]> wrote: >"Caleb Hattingh" <[EMAIL PROTECTED]> writes: > >> I'm going to assume the following is self-explanatory - type the commands >> in yourself. > >[snip] > >Yes, it certainly is self-explanatory. And, I appreciate your >respon

python API wrapper for C++ API

2004-11-29 Thread Mark Doberenz
I'm fairly new at Python, but I've got a project I really want to do.   I'm working with a real-time 3D program called Deep Creator, and it has a C++ API written for it.  I'm wondering what it would take to create a Python wrapper that would allow me to write Python programs that would call

Re: knowing a file's own name

2004-11-29 Thread Scott Frankel
Thanks for the responses! I'd forgotten about using the sys module: import sys filename = sys.argv[0] Using "__file__" also works. Thanks Scott On Nov 29, 2004, at 9:37 AM, Scott Frankel wrote: I'm looking for a way to identify a filename remotely. Put differently, is there a way

Re: Python-list Digest, Vol 14, Issue 377

2004-11-29 Thread Jamie Saker
On Mon, 29 Nov 2004 16:05:14 -0500, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > If I could simply do: py-get twisted or how about 'emerge twisted' works fine for me! When twisted2 comes out, emerge world will catch it for me too. Check out Gentoo at http://www.gentoo.org for more info, or

Re: Random number generation from functions

2004-11-29 Thread Bengt Richter
On Mon, 29 Nov 2004 20:51:50 GMT, "drs" <[EMAIL PROTECTED]> wrote: >Is there any way to generate random numbers based on arbitrary real valued >functions? I am looking for something like random.gauss() but with natural >log and exponential functions. > >thanks, Don't know what you mean. This kind

documentation for PyArg_ParseTupleAndKeywords

2004-11-29 Thread Steven Bethard
I'm just starting to play around with the Python source. (Specifically, I'm looking at adding a key argument to max/min like sorted has.) Can anyone direct me to the documentation on how PyArg_ParseTupleAndKeywords, etc. work? In particular, I can't figure out how the format arg to vgetargsk

Re: A lock that times out but doesn't poll

2004-11-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jive <[EMAIL PROTECTED]> wrote: . . . >B) Writing bug-free code is quite possible when the job is well-defined and >"from scratch." . .

Re: Python-list Digest, Vol 14, Issue 377

2004-11-29 Thread Jamie Saker
On Mon, 29 Nov 2004 16:05:14 -0500, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote: > If I could simply do: py-get twisted And I forgot to mention, the Gentoo 'emerge' tool is actually written in Python, so in a sense, your py-get is already there in Gentoo. From the header of /usr/bin/python:

Re: Number of colors in an image

2004-11-29 Thread David Bolen
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes: > A set seems more appropriate in this case: > > color_count = len(set(izip(r, g, b))) # untested code Well, while potentially premature optimization, I was trying for performance in this case. In Python 2.3, the sets module is coded in P

  1   2   >