Re: sql escaping module - Frank Millman Followup

2005-12-09 Thread Steve Holden
David Bear wrote: >>Steve Holden wrote: > > >>Fredrik Lundh wrote: >> >>>Frank Millman wrote: >>> >>> >>> Each of the API's includes the capability of passing commands in the form of 'string + parameters' directly into the database. This means that the data values are never embedded i

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Zeljko Vrba
On 2005-12-08, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > Making a mistake in indentation level is precisely analogous to leaving > out markers in other languages. If your editor is smart enough, and the > But look at the following example: if a: some_code1 if b: some_code2 If I accidenta

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Fredrik Lundh
Zeljko Vrba wrote: > But look at the following example: > > if a: > some_code1 > if b: > some_code2 > > If I accidentaly delete if b:, then some_code2 gets under the if a: which is > not intended. not to mention that if you have if a: some_code1 some_code2 and accidental

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Antoon Pardon
Op 2005-12-08, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Thu, 08 Dec 2005 08:23:52 +, Antoon Pardon wrote: > >> Op 2005-12-07, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >>> On Wed, 07 Dec 2005 15:26:59 +, Zeljko Vrba wrote: >>> Braces are very convenient to match block start

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread D H
Fredrik Lundh wrote: > Zeljko Vrba wrote: > > >>But look at the following example: >> >>if a: >> some_code1 >>if b: >> some_code2 >> >>If I accidentaly delete if b:, then some_code2 gets under the if a: which is >>not intended. > > > not to mention that if you have > > if a: > so

Re: ElementTree - Why not part of the core?

2005-12-09 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > >> ElementTree on the other hand provides incredibly easy access to XML > >> elements and works in a more Pythonic way. Why has the API not been > >> included in the Python core? > > Magnus> I'd really like to see that too. Sure, it's fairly trivial to >

Re: Moving a package in cygwin

2005-12-09 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, > > I'm using python 2.4 and windows XP. > > I have two packages in the windows version of python in site-packages. > They are PyVisa and ctypes, and both live in > c:\python24\lib\site-packages > > I'd like to move these to the cygwin version of python on the same

register keyevent in wxpython

2005-12-09 Thread ash
hi, is there a way to register application wide hotkey in wxpython? i tried wxWindow::RegisterHotKey(). but the problem is it registers the hotkey as a system wide hotkey. this causes problems in other applications running concurrently which use the same hotkey. i want to do this because i want my

pyparsing and LaTeX?

2005-12-09 Thread Ezequiel, Justin
> Anyone parsing simple LaTeX constructs with pyparsing? Greetings Tim, Have always wanted a way to parse LaTeX myself. Unfortunately, I have been moved to a different project. However, I am still very much interested. Did you ever get a reply? -- http://mail.python.org/mailman/listinfo/python-l

Re: Using printf in a C Extension

2005-12-09 Thread Frithiof Andreas Jensen
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > > I am extending python with C and trying to debug with printf. The code > below succssfully returns the string "hello" when compiled and called, > but the "can print from in here phrase" does not reach python stdout. It shou

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Christophe
David Rasmussen a écrit : > Antoon Pardon wrote: > >>> >>> Write shorter functions ;) >> >> >> This has little to do with long functions. A class can contain >> a large number of methods, whitch are all rather short, and your >> class will still be spread over several pages. >> > > Write classes

idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I have an idea to build python module to speed up python code in some of field where pyrex shines such as numeric, code which needs a lot of looping etc. What do you think? Sincerely Yours, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the extension of a filename from the path

2005-12-09 Thread Tom Anderson
On Thu, 8 Dec 2005, gene tani wrote: > Lad wrote: > >> what is a way to get the the extension of a filename from the path? > > minor footnote: windows paths can be raw strings for os.path.split(), > or you can escape "/" > tho Tom's examp indicates unescaped, non-raw string works with > splitext(

Re: efficient 'tail' implementation

2005-12-09 Thread Bengt Richter
On Thu, 08 Dec 2005 02:09:58 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] writes: >> I have a file which is very large eg over 200Mb , and i am going to use >> python to code a "tail" >> command to get the last few lines of the file. What is a good algorithm >> for this type of

Re: Using printf in a C Extension

2005-12-09 Thread Just
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I am extending python with C and trying to debug with printf. The code > below succssfully returns the string "hello" when compiled and called, > but the "can print from in here phrase" does not reach python stdout. > Is there somethi

Re: idea of building python module using pyrex

2005-12-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hello, > > I have an idea to build python module to speed up python code in some > of field where pyrex shines such as numeric, code which needs a lot of > looping etc. Isn't numeric already written in C? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailma

Re: idea of building python module using pyrex

2005-12-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have an idea to build python module to speed up python code in some > of field where pyrex shines such as numeric, code which needs a lot of > looping etc. > > What do you think? I don't think you need anyone's permission to do that, really. Just grab the tools and s

Re: Encoding of file names

2005-12-09 Thread Tom Anderson
On Thu, 8 Dec 2005, "Martin v. Löwis" wrote: utabintarbo wrote: Fredrik, you are a God! Thank You^3. I am unworthy For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 50% grayish square) and U+2524 (B

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-09 Thread Maurice LING
>>> Since copy_reg lets you specify arbitrary code to serialize arbitrary >>> objects, you shouldn't run into any single object that you cannot >>> serialize to a pickle. >> >> >> [snip - example of pickling code objects] >> >> >> I cannot understand 2 things, which I seek assistance for: >> 1. Is

Validating an email address

2005-12-09 Thread Tom Anderson
Hi all, A hoary old chestnut this - any advice on how to syntactically validate an email address? I'd like to support both the display-name-and-angle-bracket and bare-address forms, and to allow everything that RFC 2822 allows (and nothing more!). Currently, i've got some regexps which recogni

Re: Is there anything that pickle + copy_reg cannot serialize?

2005-12-09 Thread Fredrik Lundh
Maurice LING wrote: > Sorry for not specifying clearly enough. Given that copy_reg lets you > specify arbitrary code to serialize arbitrary objects, of which some are > taken care of by pickle, in the set of possible Python types, the types module contains a selection of type objects; the set of

slice notation as values?

2005-12-09 Thread Antoon Pardon
Now slices are objects in python, I was wondering if slice notation will be usable outside subscribtion in the future. Will it ever be possible to write things like: a = 4:9 for key, value in tree.items('alfa.': 'beta.'): -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-l

Re: uuDecode problem

2005-12-09 Thread py
Alex Martelli wrote: I suggest a redesign...! What would you suggest? I have to encode/decode in chunks b/c of the 45 byte limitation. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: slice notation as values?

2005-12-09 Thread Steve Holden
Antoon Pardon wrote: > Now slices are objects in python, I was wondering if slice > notation will be usable outside subscribtion in the future. > > Will it ever be possible to write things like: > > a = 4:9 > for key, value in tree.items('alfa.': 'beta.'): > Do you mean for key, value in

Re: uuDecode problem

2005-12-09 Thread Fredrik Lundh
"py" wrote: > What would you suggest? I have to encode/decode in chunks b/c of the > 45 byte limitation. so use 45-byte chunks, instead of one-byte chunks. but why are you using UU encoding in a nonstandard way ? why not just use the "uu" module to do the chunking for you? the third example o

Re: slice notation as values?

2005-12-09 Thread Antoon Pardon
Op 2005-12-09, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Now slices are objects in python, I was wondering if slice >> notation will be usable outside subscribtion in the future. >> >> Will it ever be possible to write things like: >> >> a = 4:9 >> for key, value in

Re: slice notation as values?

2005-12-09 Thread Duncan Booth
Antoon Pardon wrote: > Will it ever be possible to write things like: > > a = 4:9 > for key, value in tree.items('alfa.': 'beta.'): The first of these works fine, except you need to use the correct syntax: >>> a = slice(4,9) >>> range(10)[a] [4, 5, 6, 7, 8] >>> The second also works fine,

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I just wonder if someone has already build it. Thanks for the response. Best Regards, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: slice notation as values?

2005-12-09 Thread Antoon Pardon
Op 2005-12-09, Duncan Booth schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> Will it ever be possible to write things like: >> >> a = 4:9 >> for key, value in tree.items('alfa.': 'beta.'): > > The first of these works fine, except you need to use the correct syntax: Sure, I know that.

Re: idea of building python module using pyrex

2005-12-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I just wonder if someone has already build it. built what? it's not like nobody's ever built a Python module using Pyrex before, so I guess you have to be a bit more precise if you want feedback. -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
For example stastical module like commulative probability function for t distribution, or other numerical module which incorporate looping to get the result. I found that pyrex is very helpfull when dealing with looping things. pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Benji York
Christophe wrote: > David Rasmussen a écrit : > >>Antoon Pardon wrote: >> >> Write shorter functions ;) >>> >>> >>>This has little to do with long functions. A class can contain >>>a large number of methods, whitch are all rather short, and your >>>class will still be spread over several pages

Re: slice notation as values?

2005-12-09 Thread Duncan Booth
Antoon Pardon asked: > If we have lst = range(10), we can write > >lst[slice(3,7)] > > instead of > >lst[3:7] > > Now my impression is that should we only have the upper notation, slices > would be less usefull, because it would make using them more cumbersome. Quite right, but the s

Re: efficient 'tail' implementation

2005-12-09 Thread Magnus Lycka
[EMAIL PROTECTED] wrote: > hi > > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading eve

Re: how to put form and display its result(data from database) on the same window?

2005-12-09 Thread lli
Thank you Peter. I will read it. LLI -- http://mail.python.org/mailman/listinfo/python-list

Re: Another newbie question

2005-12-09 Thread BartlebyScrivener
>>http://en.wikipedia.org/wiki/Law_of_Demeter << That was fun. Thanks, Kent. -- http://mail.python.org/mailman/listinfo/python-list

Freeze doesn't import all modules . . .

2005-12-09 Thread Michael Williams
Is there any way to FORCE freeze to import all necessary modules no matter what? I have noticed that a few 3rd party modules simply don't get included in a "compiled" bundle. More specifically, "PEXPECT", and some of the required "AMARA" xml modules aren't included when you freeze a pyth

Re: How to stop a linux process

2005-12-09 Thread Michael Williams
You may check out the  http://pexpect.sourceforge.net/ module.  This gives you pretty good control over running processes.  It even allows you to "interact" with them.Regards,MichaelOn Nov 28, 2005, at 4:00 PM, [EMAIL PROTECTED] wrote:From: Glen <[EMAIL PROTECTED]> Date: November 28, 2005 2:10:05 P

Re: slice notation as values?

2005-12-09 Thread Antoon Pardon
Op 2005-12-09, Duncan Booth schreef <[EMAIL PROTECTED]>: > Antoon Pardon asked: > > >> If we have lst = range(10), we can write >> >>lst[slice(3,7)] >> >> instead of >> >>lst[3:7] >> >> Now my impression is that should we only have the upper notation, slices >> would be less usefull, be

Re: idea of building python module using pyrex

2005-12-09 Thread David M. Cooke
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > For example stastical module like commulative probability function for > t distribution, or other numerical module which incorporate looping to > get the result. > > I found that pyrex is very helpfull when dealing with looping > things. Pyrex is

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello David, Is SciPy works with python 2.4.2, Windows XP? I thought it is only for python 2.3? pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Validating an email address

2005-12-09 Thread Jean-Paul Calderone
On Fri, 9 Dec 2005 11:10:04 +, Tom Anderson <[EMAIL PROTECTED]> wrote: >Hi all, > >A hoary old chestnut this - any advice on how to syntactically validate an >email address? I'd like to support both the display-name-and-angle-bracket >and bare-address forms, and to allow everything that RFC 282

Re: installer question

2005-12-09 Thread Larry Bates
Take a look at Inno Installer. You should be able to do everything you list. You may also want to consider using py2exe to package up your python program into .exe prior to creating installer file. That way you eliminate the requirement of having python, pythonwin32 installed and you don't have

Re: Encoding of file names

2005-12-09 Thread utabintarbo
Part of the reason (I think) is that our CAD/Data Management system (which produces the aforementioned .MODEL files) substitutes (stupidly, IMNSHO) non-printable characters for embedded spaces in file names. This is part of what leads to my consternation here. And yeah, Windows isn't helping matte

Re: slice notation as values?

2005-12-09 Thread Duncan Booth
Antoon Pardon wrote: >> If the user can write >> >>for key in tree['a':'b']: >> >> then he can write: >> >>for key in tree['a':'b'].iteritems(): > > No he can't. tree['a':'b'] would provide a list > of keys that all start with an 'a'. Such a list > doesn't have an iteritems method. It wou

Dectecting dir changes

2005-12-09 Thread chuck
I need to write a daemon for Solaris that monitors a directory for incoming FTP transfers. Under certain conditions, when the transfer is complete I need to send an email notification, and do other stuff. Win32 provides FindFirstChangeNotification(), but as best I can tell this isn't supported on

Re: pyparsing and LaTeX?

2005-12-09 Thread Tim Arnold
>"Ezequiel, Justin" <[EMAIL PROTECTED]> wrote in message > >news:[EMAIL PROTECTED] >> Anyone parsing simple LaTeX constructs with pyparsing? > > Greetings Tim, > > Have always wanted a way to parse LaTeX myself. > Unfortunately, I have been moved to a different project. > However, I am still very

Re: efficient 'tail' implementation

2005-12-09 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > hi > > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading eve

heartbeats

2005-12-09 Thread Yves Glodt
Hi, I need to write a heartbeat solution to monitor some external clients, and what is different as in the examples that I have seen so far is that I want my central server to poll the clients, and not the clients "pinging" the central server. In detail I need a daemon on my central server whi

Re: uuDecode problem

2005-12-09 Thread Alex Martelli
py <[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > I suggest a redesign...! > > > What would you suggest? I have to encode/decode in chunks b/c of the > 45 byte limitation. Not quite: >>> s=45*'v' >>> a=binascii.b2a_uu(s) >>> len(a) 62 >>> b=binascii.a2b_uu(a) >>> len(b) 45 >>> b==s True

Re: Another newbie question

2005-12-09 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > Mike Meyer <[EMAIL PROTECTED]> wrote: > >> My standard object interface is modeled after Meyer's presentation in > >> OOSC: an objects state is manipulated with methods and examined with > >> attributes; manipula

Re: Dectecting dir changes

2005-12-09 Thread Fredrik Lundh
"chuck" <[EMAIL PROTECTED]> wrote: > I need to write a daemon for Solaris that monitors a directory for > incoming FTP transfers. Under certain conditions, when the transfer is > complete I need to send an email notification, and do other stuff. > Win32 provides FindFirstChangeNotification(), but

Re: Dectecting dir changes

2005-12-09 Thread Sybren Stuvel
chuck enlightened us with: > The doco indicates to read the source for fcntl.py to lookup the > constants representing the different types of events/signals that > are avaiable. However fcntl on some platforms seems to be > implemented as a binary leaving no way to look up the contants for > the p

Re: heartbeats

2005-12-09 Thread Sybren Stuvel
Yves Glodt enlightened us with: > In detail I need a daemon on my central server which e.g. which in a > loop pings (not really ping but you know what I mean) each 20 > seconds one of the clients. You probably mean "really a ping, just not an ICMP echo request". > The only thing the client has to

Re: Dectecting dir changes

2005-12-09 Thread chuck
Is this on Solaris? I think you may have missed my point. I don't have fcntl.py on my Solaris box so how do I know what signals that I can used to monitor a directory for modification. In other words will the following work? fcntl.fcntl(self.fd, fcntl.F_NOTIFY, fcntl.DN_DELETE|fcntl.DN_CREATE|f

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, David Isaac <[EMAIL PROTECTED]> wrote: > >"Cameron Laird" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> Jibes against the lambda-clingers lead eventually to serious >> questions of style in regard to variable namespacing, >> lifespan, cl

Re: Dectecting dir changes

2005-12-09 Thread Fredrik Lundh
"chuck" wrote: > I think you may have missed my point. I don't have fcntl.py on my > Solaris box so how do I know what signals that I can used to monitor a > directory for modification. In other words will the following work? > > fcntl.fcntl(self.fd, fcntl.F_NOTIFY, > fcntl.DN_DELETE|fcntl.DN_CR

Re: pickle - recursion - stack size limit - MS windows

2005-12-09 Thread Christian Tismer
Andy Leszczynski wrote: > I need to pickle quite complex objects and first limitation was default > 200 for the recursion. sys.setrecursionlimit helped, but still bigger > objects fail to be pickled because of XP stack size limitation. > > Any idea how to get around the problem ... If you can liv

Re: Dectecting dir changes

2005-12-09 Thread chuck
ty - more useful than 'works here' -- http://mail.python.org/mailman/listinfo/python-list

How to find the type ...

2005-12-09 Thread Lad
Hello How can I find out in Python whether the operand is integer or a character and change from char to int ? Regards, L. -- http://mail.python.org/mailman/listinfo/python-list

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-09 Thread tutufan
Re using the same variable name over and over for different objects in the same scope: Argh--don't do this. It makes a mess for the guy (or gal) that comes after you and has to understand the code. Our forefathers fought and died so that we could have as many unique variable names as we like. So

Re: heartbeats

2005-12-09 Thread Steve Holden
Yves Glodt wrote: > Hi, > > I need to write a heartbeat solution to monitor some external clients, > and what is different as in the examples that I have seen so far is that > I want my central server to poll the clients, and not the clients > "pinging" the central server. > > In detail I need

Re: How to find the type ...

2005-12-09 Thread robert . dowell
>>> thisisastring = "1" >>> thisisanint = 1 >>> type(thisisastring) >>> type(thisisanint) >>> thisisastring = int(thisisastring) >>> thisisanint = str(thisisanint) >>> type(thisisastring) >>> type(thisisanint) >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Dectecting dir changes

2005-12-09 Thread Steve Holden
chuck wrote: > I need to write a daemon for Solaris that monitors a directory for > incoming FTP transfers. Under certain conditions, when the transfer is > complete I need to send an email notification, and do other stuff. > Win32 provides FindFirstChangeNotification(), but as best I can tell > t

Re: How to find the type ...

2005-12-09 Thread Magnus Lycka
Lad wrote: > Hello > How can I find out in Python whether the operand is integer or a > character and change from char to int ? I'm not sure what you mean by "character" in a Python context. A string? "i = int(i)" will make sure both 5 and "5" are used as 5, and "five" will be rejected with a Val

Re: uuDecode problem

2005-12-09 Thread py
Thanks...I think base64 will work just fine...and doesnt seem to have 45 byte limitations, etc. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find the type ...

2005-12-09 Thread Steve Holden
Lad wrote: > Hello > How can I find out in Python whether the operand is integer or a > character and change from char to int ? > Regards, > L. > Easiest would just be to apply the int() type function to whatever you have and trap any resulting exception. >>> getInt(1) 1 >>> getInt("32767")

Re: How to find the type ...

2005-12-09 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: thisisastring = "1" thisisanint = 1 type(thisisastring) > > > type(thisisanint) > > > thisisastring = int(thisisastring) thisisanint = str(thisisanint) type(thisisastring) > > > type(thisisanint) > > >>> print repr(thisisastring)

Re: How to find the type ...

2005-12-09 Thread Steven Bethard
Lad wrote: > How can I find out in Python whether the operand is integer or a > character and change from char to int ? Python doesn't have a separate character type, but if you want to convert a one-character string to it's ASCII number, you can use ord(): >>> ord('A'), ord('z') (65, 122) The

Re: How to find the type ...

2005-12-09 Thread Xavier Morel
Lad wrote: > Hello > How can I find out in Python whether the operand is integer or a > character and change from char to int ? > Regards, > L. > You may want to try the "type" command. And there is no character type in cPython (unless you're using ctypes that is) There is not much point though

Overloading

2005-12-09 Thread Johannes Reichel
Hi! In C++ you can overload functions and constructors. For example if I have a class that represents a complex number, than it would be nice if I can write two seperate constructors class Complex: def __init__(self): self.real=0 self.imag=0 def __init__self(self,r,i):

Re: Dectecting dir changes

2005-12-09 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 16:50:05 +, Steve Holden <[EMAIL PROTECTED]> wrote: >chuck wrote: >> I need to write a daemon for Solaris that monitors a directory for >> incoming FTP transfers. Under certain conditions, when the transfer is >> complete I need to send an email notification, and do other s

Re: Overloading

2005-12-09 Thread Jean-Paul Calderone
On Fri, 09 Dec 2005 18:29:12 +0100, Johannes Reichel <[EMAIL PROTECTED]> wrote: >Hi! > >In C++ you can overload functions and constructors. For example if I have a >class that represents a complex number, than it would be nice if I can >write two seperate constructors > >class Complex: > >def __ini

Re: Overloading

2005-12-09 Thread jepler
On Fri, Dec 09, 2005 at 06:29:12PM +0100, Johannes Reichel wrote: > Hi! > > In C++ you can overload functions and constructors. For example if I have a > class that represents a complex number, than it would be nice if I can > write two seperate constructors Python doesn't support this, but it do

Re: How to find the type ...

2005-12-09 Thread Martin Christensen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > "Lad" == Lad <[EMAIL PROTECTED]> writes: Lad> How can I find out in Python whether the operand is integer or a Lad> character and change from char to int ? In Python, the canonical way of doing this would be to simply assume that the argument c

Re: HTML parsing/scraping & python

2005-12-09 Thread alex_f_il
Take a look at SW Explorer Automation (http://home.comcast.net/~furmana/SWIEAutomation.htm)(SWEA). SWEA creates an object model (automation interface) for any Web application running in Internet Explorer. It supports all IE functionality:frames, java script, dialogs, downloads. The runtime can a

Re: heartbeats

2005-12-09 Thread Tom Anderson
On Fri, 9 Dec 2005, Sybren Stuvel wrote: > Yves Glodt enlightened us with: > >> In detail I need a daemon on my central server which e.g. which in a >> loop pings (not really ping but you know what I mean) each 20 seconds >> one of the clients. Do you mean pings one client every 20 sec, or each

Re: Dectecting dir changes

2005-12-09 Thread chuck
Hmmm, that is an interesting idea. I've noticed the new book on Twisted, thinking about picking it up. I assume that this little snippet will handle multiple/concurrent incoming transfers via threading/sub-process, is scalable, secure, etc? I could even run it on a non-standard port making it a

Re: Documentation suggestions

2005-12-09 Thread Trent Mick
[EMAIL PROTECTED] wrote] > > Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather > Trent> than running an actually Ruby interactive session ("bastion'ed" > Trent> or not). > > I don't think so. I tried typing some stuff at the prompt that it wasn't > asking for, lik

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, I reported: . . . >"Python has more web application frameworks than keywords." - Skip >Montanaro (but probably others going back years) . .

Re: small inconsistency in ElementTree (1.2.6)

2005-12-09 Thread Damjan
>> Do I need to check the output of ElementTree everytime, or there's some >> hidden switch to change this behaviour? > > no. > > ascii strings and unicode strings are perfectly interchangable, with some > minor exceptions. It's not only translate, it's decode too... probably other methods and beh

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-09 Thread skip
Cameron> In article <[EMAIL PROTECTED]>, Cameron> I reported: >> "Python has more web application frameworks than keywords." - Skip >> Montanaro (but probably others going back years) Cameron> Incorrect. Thanks to Fredrik Lundh ... Yeah, I wondered about that. I was only p

getting host and path from url

2005-12-09 Thread Steve Young
Hi, this is probably an easy question but is there a way to get the host and path seperatly out of an url? Example:url = "">and i want some way of getting:host = http://news.yahoo.com and path = /fc/world/iraqthanks.-Steve   Yahoo! Shopping Find Great Deals on Holi

Re: small inconsistency in ElementTree (1.2.6)

2005-12-09 Thread Fredrik Lundh
Damjan wrote: > > ascii strings and unicode strings are perfectly interchangable, with some > > minor exceptions. > > It's not only translate, it's decode too... why would you use decode on the strings you get back from ET ? > probably other methods and behaviour differ too. > > And the bigger p

How to detect the presence of a html file

2005-12-09 Thread Phoe6
Operating System: Windows Python version: 2.4 I have bookmarks.html and wumpus.c under my c: When I tried to check the presence of the bookmarks.html, I fail. >>> os.path.isfile('c:\bookmarks.html') False >>> os.path.isfile('c:\wumpus.c') True >>> os.path.exists('c:\wumpus.c') True >>> os.path.

Re: Overloading

2005-12-09 Thread Christopher Subich
Johannes Reichel wrote: > Hi! > > In C++ you can overload functions and constructors. For example if I have a > class that represents a complex number, than it would be nice if I can > write two seperate constructors > > class Complex: Please do note, if you want this for the exact use of a Comp

build_opener()

2005-12-09 Thread Steve Young
Hello, I had a question about urllib2's build_opener() statement. I am trying to just get the html from any webpage as a string but I need everything on the page to be the same as what it'd be if I would browse to that page (and at the very least, all the href's). This is my code: url =

Re: Using printf in a C Extension

2005-12-09 Thread Lonnie Princehouse
printf will generally work in C extensions (although, as others have said, it goes to STDOUT which is not necessarily the same as Python sys.stdout) Try explicitly flushing the buffer with fflush(stdout) -- http://mail.python.org/mailman/listinfo/python-list

small exe for cross compile for linux-mips tool chain

2005-12-09 Thread niclane
Hi, I'm trying to port the python interpreter to an AP running OpenWRT with the linux-mips tool chain. I'd like to have the interpreter as small as possible and was wanted see if others in the community had done this and if I could learn from them. I've gotten fairly far into the cross compilation

Catching error text like that shown in console?

2005-12-09 Thread Peter A.Schott
I know there's got to be an easy way to do this - I want a way to catch the error text that would normally be shown in an interactive session and put that value into a string I can use later. I've tried just using a catch statement and trying to convert the output to string, but this doesn't alway

Re: getting host and path from url

2005-12-09 Thread Michael Spencer
Steve Young wrote: > Hi, this is probably an easy question but is there a way to get the host and > path seperatly out of an url? > > Example: > > url = http://news.yahoo.com/fc/world/iraq > > and i want some way of getting: > > host = http://news.yahoo.com > and > path =

Re: How to detect the presence of a html file

2005-12-09 Thread Kent Johnson
Phoe6 wrote: > Operating System: Windows > Python version: 2.4 > > I have bookmarks.html and wumpus.c under my c: > > When I tried to check the presence of the bookmarks.html, I fail. > > os.path.isfile('c:\bookmarks.html') > > False > os.path.isfile('c:\wumpus.c') > > True The prob

new in programing

2005-12-09 Thread Efrain Marrero
i want to now how to do this in python this is java for(int i=1 ; i<=lim ; i++){ for(int j=i+1; j<=lim+1; j++){ for(int k =j+1; k<=lim+2;k++){

PHP = Perl Improved

2005-12-09 Thread Xah Lee
recently i got a project that involves the use of php. In 2 days, i read almost the entirety of the php doc. Finding it a breeze because it is roughly based on Perl, of which i have mastery. i felt a sensation of neatness, as if php = Perl Improved, for a dedicated job of server-side scripting. Ev

Re: Documentation suggestions

2005-12-09 Thread A.M. Kuchling
On Thu, 8 Dec 2005 18:17:59 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > cool. can you post a sample page somewhere? It's not terribly interesting at the moment. The generated LaTeX looks like this: \seeurl{http://effbot.org/librarybook/zlib.htm}{The zlib module} And that gets f

Re: How to detect the presence of a html file

2005-12-09 Thread Phoe6
Kent Johnson wrote: > The problem is that \ is special in string literals. \b is a backspace > character, not the two-character sequence you expect. \w has no special > meaning so it *is* the two-character sequence you expect. > The simplest fix is to use raw strings for all your Windows path need

Re: new in programing

2005-12-09 Thread Brett Hoerner
Efrain Marrero wrote: > i want to now how to do this in python > this is java > > > for(int i=1 ; i<=lim ; i++){ > > for(int j=i+1; j<=lim+1; j++){ > > for(int k =j+1; k<=lim+2;k++){ > > for(int l=k+1 ; l<=lim+3;l++){ > >

Re: Moving a package in cygwin

2005-12-09 Thread 63q2o4i02
Ok, thanks. I actually hadn't considered the build system, figuring that function names, etc., would somehow magically be "exported" to anyone wanting to use the .pyd library. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading

2005-12-09 Thread Josef Meile
>>In C++ you can overload functions and constructors. For example if I have a >>class that represents a complex number, than it would be nice if I can >>write two seperate constructors > > > Python doesn't support this, but it does support default arguments: Yes, in part you are right since the p

Thoughts on object representation in a dictionary

2005-12-09 Thread py
Say I have classes which represent parts of a car such as Engine, Body, etc. Now I want to represent a Car in a nested dictionary like... {string_id:{engine_id:engine_object, body_id:body_object}}ok? Well the other thing is that I am allowed to store strings in this dictionary...so I can't j

  1   2   >