Re: How to return an "not string' error in function?

2006-09-21 Thread Camellia
I've learned a lot from you two, thank you:) Peace -- http://mail.python.org/mailman/listinfo/python-list

Help with JPEG support with PIL 1.1.5 and OSX

2006-09-21 Thread Jack Wu
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please help me... I've scoured all the documentation, google, and mailing lists to no avail. I believe the pro

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread Hans Georg Krauthaeuser
[EMAIL PROTECTED] wrote: > Hans Georg Krauthaeuser wrote: >> [EMAIL PROTECTED] wrote: >> >>> Can objects be saved and reloaded by "Pickle" ? I have tried but no >>> success. >>> >>> >> Yes, that's the intended use of pickle/cPickle. There are examples in >> the docs: >> >> http://docs.pyth

Re: How does IPython modify the sys.path?

2006-09-21 Thread Fredrik Lundh
Daniel Mark wrote: > However, I cannot figure out how IPython can change my sys.path. > > I refer to all the following sources > 1> http://www.python.org/doc/current/inst/search-path.html Installing > Python Modules > 2> KEY_LOCAL_MACHINE\Software\Python\PythonCore\2.4\PythonPath > 3> My machine

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread [EMAIL PROTECTED]
Hans Georg Krauthaeuser wrote: > [EMAIL PROTECTED] wrote: > >> Can objects be saved and reloaded by "Pickle" ? I have tried but no >> success. >> >> > Yes, that's the intended use of pickle/cPickle. There are examples in > the docs: > > http://docs.python.org/lib/module-pickle.html > > Wh

Re: How does IPython modify the sys.path?

2006-09-21 Thread Robert Kern
Daniel Mark wrote: > So how dos IPython modify my sys.path without trace??? sys.path.append() Specifically, line 321 of ipmaker.py -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as thou

Re: Using py2exe to wrap a service?

2006-09-21 Thread MaR
CONCLUSION: Tim Golden sent me a patched version of his active_directory.py ver 0.4 and that solved my problem! Thanks all for your attention and in particular, Tim! //Maria 111a112 > from win32com.client.gencache import EnsureDispatch 180c181 < _connection = Dispatch ("ADODB.Connection") ---

How does IPython modify the sys.path?

2006-09-21 Thread Daniel Mark
Hello all: I installed IPython on my XP machine today and find that my sys.path has been changed as follows: >> import sys >> print sys.path ['', 'C:\\Program Files\\Python24\\scripts', 'C:\\WINDOWS\\system32\\python24.zip', 'C:\\Documents and Settings\\Daniel\\Desktop', 'C:\\Program Files\

Re: Don't use regular expressions to "validate" email addresses

2006-09-21 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > The best advice I've seen when people ask "How do I validate > > whether an email address is valid?" was "Try sending mail to it". > > > That only applies if it's a likely-looking email address. If someone > asks me to send mail to

Re: Building things with setup.py

2006-09-21 Thread Martin v. Löwis
James Stroud schrieb: > This is annoying. I am trying to build scipy right now but every .so > file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" > to the ld flags. That shouldn't be necessary. Linking without this should work just fine. That way, since you made libpython2.5.

Re: Strange behaviour of 'is'

2006-09-21 Thread Steve Holden
Ben Finney wrote: > "Fijoy George" <[EMAIL PROTECTED]> writes: > > >>I am a bit perplexed by the following behaviour of the 'is' comparator > > > In summary: you are seeing implementation details that the language > specification explicitly allows to vary by implementation. > > >>My understan

Re: Building things with setup.py

2006-09-21 Thread Robert Kern
James Stroud wrote: > Well I added those arguments to $LDFLAGS, but it seemed like a pretty > miserable hack, especially the "-shared" part. Hmmm. Did you have $LDFLAGS set to anything (or more likely, nothing) before? I.e. did you have something like this? export LDFLAGS="" python setup.

Re: distutils on Windows with VC++ 8

2006-09-21 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > I'm trying to install two different packages which wrap C or C++ code > and which make use of distutils.build_ext, which barfs because my only > compiler is too new. Trying this both on Python 2.4.3 and 2.5. > Evidently there is a requirement that the compiler used to

Re: Don't use regular expressions to "validate" email addresses

2006-09-21 Thread Steve Holden
Ben Finney wrote: > "John Machin" <[EMAIL PROTECTED]> writes: > > >>A little more is unfortunately not enough. The best advice you got was >>to use an existing e-mail address validator. The definition of a valid >>e-mail address is complicated. You may care to check out "Mastering >>Regular Expre

Re: Building things with setup.py

2006-09-21 Thread Robert Kern
James Stroud wrote: > I did build my own python 2.5, yesterday, requiring me to rebuild all > extensions. Do other extensions build correctly? If so, it's beginning to look like a problem in numpy.distutils . > Everything I do is compiled by hand as joe-user. I'm in a > situation where I can't

Re: Building things with setup.py

2006-09-21 Thread James Stroud
Robert Kern wrote: > James Stroud wrote: > >> Hello All, >> >> This is annoying. I am trying to build scipy right now but every .so >> file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl >> -shared" to the ld flags. > > >> I'm running Linux FC4 on a dual intel p4 (~3.2 GHz) with sun

Re: Writing Video conference software for Windows

2006-09-21 Thread Ravi Teja
> I need to write a software that allow to see the desktop That would be the VNC protocol. Don't reinvent the wheel. VNC is relatively efficient in that it only updates the portions of the screen that changed. Maybe this project could be your starting point. PyVNC http://bdash.net.nz/blog/2005/0

Re: Building things with setup.py

2006-09-21 Thread Robert Kern
James Stroud wrote: > Hello All, > > This is annoying. I am trying to build scipy right now but every .so > file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" > to the ld flags. > I'm running Linux FC4 on a dual intel p4 (~3.2 GHz) with sundry > libraries in non-standard p

Re: Building things with setup.py

2006-09-21 Thread Robert Kern
James Stroud wrote: > Hello All, > > This is annoying. I am trying to build scipy right now but every .so > file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" > to the ld flags. > > Main Question: When building with "setup.py", where can I include this > information so I d

Re: Building things with setup.py

2006-09-21 Thread James Stroud
James Stroud wrote: > Hello All, > > This is annoying. I am trying to build scipy right now but every .so > file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" > to the ld flags. > > Main Question: When building with "setup.py", where can I include this > information so I d

Building things with setup.py

2006-09-21 Thread James Stroud
Hello All, This is annoying. I am trying to build scipy right now but every .so file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared" to the ld flags. Main Question: When building with "setup.py", where can I include this information so I don't have to link every .so file by

Re: How to get ip setting, dynamic ip or static ip?

2006-09-21 Thread Roger Upole
"kode4u" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How to use python get my windows box's ip setting type? Dynamic ip, or > static ip? > > If it's static ip, what's the exact value? > You can use WMI to list properties of your network adapter(s): import win32com.client wmi=win3

Re: Don't use regular expressions to "validate" email addresses

2006-09-21 Thread Ben Finney
[Please don't top-post above the text you're replying to.] "bruce" <[EMAIL PROTECTED]> writes: > if you were creating a web app with an email form... rather than try > to check if the email is valid... Where did I advise not checking? I advised the only kind of check that actually works. > you'

Re: How to get ip setting, dynamic ip or static ip?

2006-09-21 Thread kode4u
The way has one shortcoming. That's it depend on the proper language version of Windows. If I'm using Simplified Chinese Windows, I must modify some strings. :( Duncan Booth wrote: > "kode4u" <[EMAIL PROTECTED]> wrote: > > > How to use python get my windows box's ip setting type? Dynamic ip, or >

RE: Don't use regular expressions to "validate" email addresses (was: Ineed some help with a regexp please)

2006-09-21 Thread bruce
so ben... if you were creating a web app with an email form... rather than try to check if the email is valid... you'd create something to allow anyone to potentially spam the hell out of a system... my two cents worth... try to verify/validate that the email is valid, and possibly belongs to the

Don't use regular expressions to "validate" email addresses (was: I need some help with a regexp please)

2006-09-21 Thread Ben Finney
"John Machin" <[EMAIL PROTECTED]> writes: > A little more is unfortunately not enough. The best advice you got was > to use an existing e-mail address validator. The definition of a valid > e-mail address is complicated. You may care to check out "Mastering > Regular Expressions" by Jeffery Friedl

Re: I need some help with a regexp please

2006-09-21 Thread John Machin
codefire wrote: > Hi, > > thanks for the advice guys. > > Well took the kids swimming, watched some TV, read your hints and > within a few minutes had this: > > r = re.compile(r'[EMAIL PROTECTED]@\s]+\.\w+') > > This works for me. That is if you have an invalid email such as > tony..bATblah.com it

Re: Strange behaviour of 'is'

2006-09-21 Thread Ben Finney
"Fijoy George" <[EMAIL PROTECTED]> writes: > I am a bit perplexed by the following behaviour of the 'is' comparator In summary: you are seeing implementation details that the language specification explicitly allows to vary by implementation. > My understanding was that every literal is a constr

Re: parsing java files

2006-09-21 Thread Gabriel Genellina
At Thursday 21/9/2006 17:51, stéphane bard wrote: >i would like to parse java files an detect >class name's, attributes name's type's and visibility (and or list of >methods). > >is there any module who can parse easily a java file without using >(jython)? I would get the needed info using javado

Re: Strange behaviour of 'is'

2006-09-21 Thread Erik Max Francis
Ben C wrote: > I'm as baffled as you, even more so its implication: There is no implication whatsoever. Whether immutable objects are recycled by the compiler or not is totally implementation dependent, and an irrelevant implementation detail. Since they can't be mutated, whether their ident

Re: Printing UTF-8

2006-09-21 Thread John Machin
[EMAIL PROTECTED] wrote: > I am new to unicode so please bear with my stupidity. > > I am doing the following in a Python IDE called Wing with Python 23. > > >>> s = "äöü" >From later evidence, this string is encoded as utf-8. Looks like Wing must be using an implicit "# coding: utf-8" for interac

Re: Are the CALL_FUNCTION_* opcodes ever used?

2006-09-21 Thread Peter Otten
Fabiano Sidler wrote: > Studying python byte code I encountered an interesting issue: there is no > matter, which one of the following function calls I compile: > > 1: func('foo','bar',foo='bar') > 2: func('foobar') > 3: func(foo='bar') > > The compiler always uses the simple CALL_FUNCTION for a

Re: Can I inherit member variables?

2006-09-21 Thread Gabriel Genellina
At Thursday 21/9/2006 09:14, Bruno Desthuilliers wrote: > When you construct an object instance, it is of a certain type from that > precise moment, and you can't change that afterwards. Err... Actually, in Python, you can. It's even a no-brainer. Yes, but trying to explain that to a beginner

overrideredirect and Text widget

2006-09-21 Thread Sorin Schwimmer
Hi,I'm trying to place in an undecorated window a Text widget, and a button to close the window/save widget's content. My test code is the following:from Tkinter import *root=Tk()root['bg']='' # transparent backgroundroot.overrideredirect(1) # get rid of borderroot.geometry("+80+120") # place on sc

Re: Writing Video conference software for Windows

2006-09-21 Thread sturlamolden
Paolo Pantaleo wrote: > Well I need something like 5-10 fps. An issue is the comression > method: MPEG and friends aren't good (I think) for compressing stuff > with sharp borders. Maybe I could use A sequence of PNG images, but it > isn't a great solution. You probably want to use is VideoCaptu

Re: Strange behaviour of 'is'

2006-09-21 Thread Klaas
Ben C wrote: > On 2006-09-21, Fijoy George <[EMAIL PROTECTED]> wrote: > > But my understanding does not explain the result of the second comparison. > > According to the experiment, y[0] and y[1] are the same object! > > I'm as baffled as you, even more so its implication: > >>> a = 2. > >>> b =

Are the CALL_FUNCTION_* opcodes ever used?

2006-09-21 Thread Fabiano Sidler
Hi folks! Studying python byte code I encountered an interesting issue: there is no matter, which one of the following function calls I compile: 1: func('foo','bar',foo='bar') 2: func('foobar') 3: func(foo='bar') The compiler always uses the simple CALL_FUNCTION for all of the source examples ab

Re: Tkinter button not working as expected

2006-09-21 Thread James Stroud
[EMAIL PROTECTED] wrote: > I've created a short test program that uses tkFileDialog.askdirectory > to help the user input a path into a tk entry widget. The problem I'm > having is that when I run the code as listed below, the getPath > function is called when the program initially runs, not when

Re: Tkinter button not working as expected

2006-09-21 Thread bearophileHUGS
[EMAIL PROTECTED] wrote: > I've created a short test program that uses tkFileDialog.askdirectory > to help the user input a path into a tk entry widget. The problem I'm > having is that when I run the code as listed below, the getPath > function is called when the program initially runs, not when

Re: I need some help with a regexp please

2006-09-21 Thread codefire
Hi, thanks for the advice guys. Well took the kids swimming, watched some TV, read your hints and within a few minutes had this: r = re.compile(r'[EMAIL PROTECTED]@\s]+\.\w+') This works for me. That is if you have an invalid email such as tony..bATblah.com it will reject it (note the double do

Tkinter button not working as expected

2006-09-21 Thread vagrantbrad
I've created a short test program that uses tkFileDialog.askdirectory to help the user input a path into a tk entry widget. The problem I'm having is that when I run the code as listed below, the getPath function is called when the program initially runs, not when the button is pressed. from Tkin

Re: parsing java files

2006-09-21 Thread Paul Boddie
stéphane bard wrote: > hello > i would like to parse java files an detect > class name's, attributes name's type's and visibility (and or list of > methods). > > is there any module who can parse easily a java file without using > (jython)? There are probably a number of standard parser solutions

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-21 Thread George Sakkis
robin wrote: > "George Sakkis" <[EMAIL PROTECTED]> wrote: > > >Here's what I came up with: > >http://rafb.net/paste/results/G91EAo70.html. Tested only on my > >bookmarks; see if it works for you. > > That URL is dead. Got another? Yeap, try this one: http://gsakkis-utils.googlecode.com/svn/trunk/

parsing java files

2006-09-21 Thread stéphane bard
hello i would like to parse java files an detect class name's, attributes name's type's and visibility (and or list of methods). is there any module who can parse easily a java file without using (jython)? -- http://mail.python.org/mailman/listinfo/python-list

Re: newbe's re question

2006-09-21 Thread Frederic Rentsch
[EMAIL PROTECTED] wrote: > Frederic Rentsch wrote: > >> [EMAIL PROTECTED] wrote: >> >>> Frederic Rentsch wrote: >>> >>> [EMAIL PROTECTED] wrote: > All I am after realy is to change this > > reline = re.line.split('instr', '/d$') > > into s

Printing UTF-8

2006-09-21 Thread sheldon . regular
I am new to unicode so please bear with my stupidity. I am doing the following in a Python IDE called Wing with Python 23. >>> s = "äöü" >>> print s äöü >>> print s äöü >>> s '\xc3\xa4\xc3\xb6\xc3\xbc' >>> s.decode('utf-8') u'\xe4\xf6\xfc' >>> u = s.decode('utf-8') >>> u u'\xe4\xf6\xfc' >>>

Re: Strange behaviour of 'is'

2006-09-21 Thread Ben C
On 2006-09-21, Fijoy George <[EMAIL PROTECTED]> wrote: > Hi all, > > I am a bit perplexed by the following behaviour of the 'is' comparator > x = 2. x is 2. > False y = [2., 2.] y[0] is y[1] > True > > My understanding was that every literal is a constructure of an object. > Th

Re: Strange behaviour of 'is'

2006-09-21 Thread Duncan Booth
"Fijoy George" <[EMAIL PROTECTED]> wrote: > My understanding was that every literal is a constructure of an > object. Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are > different objects. Therefore, the comparison yields false. What gave you that idea? The compiler may or may not fold tog

Strange behaviour of 'is'

2006-09-21 Thread Fijoy George
Hi all, I am a bit perplexed by the following behaviour of the 'is' comparator >>> x = 2. >>> x is 2. False >>> y = [2., 2.] >>> y[0] is y[1] True My understanding was that every literal is a constructure of an object. Thus, the '2.' in 'x = 2.' and the '2.' in 'x is 2.' are different objects.

Weekly Python Patch/Bug Summary ** REVISED **

2006-09-21 Thread Kurt B. Kaiser
Patch / Bug Summary ___ Patches : 420 open ( +4) / 3410 closed ( +2) / 3830 total ( +6) Bugs: 915 open (+17) / 6186 closed ( +6) / 7101 total (+23) RFE : 235 open ( +1) / 238 closed ( +0) / 473 total ( +1) New / Reopened Patches __ Practical

str() vs. repr() (was: How to return an "not string' error in function?)

2006-09-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: . . . >PS: Is str() the same as repr() ? . . . No http://www.thescripts.com/forum/thread19556.h

Re: Working with email and mailbox module

2006-09-21 Thread Rob Williscroft
Nirnimesh wrote in news:1158840271.942540.85640 @d34g2000cwd.googlegroups.com in comp.lang.python: > I want to extract emails from an mbox-type file which contains a number > of individual emails. > > I tried the python mailbox and email modules individually, but I'm > unable to combine them to g

Re: how to use timer in python

2006-09-21 Thread James Stroud
yxh wrote: > how to use timer in python. > the functionnality is like the MFC SetTimer() > > Try this (a little more flexible than Timer): http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464959 -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 9

Re: Retrieve HTML from site using cookies

2006-09-21 Thread James Stroud
[EMAIL PROTECTED] wrote: > Greetings gents. I'm a Railser working on a django app that needs to do > some scraping to gather its data. > > I need to programatically access a site that requires a username and > password. Once I post to the login.php page, there seems to be a > redirect and it seems

Re: How to return an "not string' error in function?

2006-09-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: (please, *stop* top-posting - corrected) > Bruno Desthuilliers wrote: >> >> [EMAIL PROTECTED] wrote: >> (OT : please dont top-post) >> >>> What I tried to do is to write a string.split() module, >> So don't waste time: >> > "ab eced f aazaz".split() >> ['ab', 'eced', '

Re: Does WSGI offer anything for web *beginner*?

2006-09-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > I love idea of WSGI and hope it succeeds. It seems to be helpful for > person > tempted to write his own framework.they can now just mix and match > existing > components with WSGI //instead//. Well, it's not that much "instead" than "with a common building block".

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Martin v. Löwis
Bjoern Schliessmann schrieb: >> To be exact, you need a 64bit Windows OS on a 64bit cpu. > > Is there a reason that can be explained in a less-than-2-KB > posting? :) I mean why Python depends on the processor type that > much. In the AMD-64 package, python.exe, python25.dll etc are declared (by

Re: I need some help with a regexp please

2006-09-21 Thread Steve Holden
codefire wrote: > Hi, > > I am trying to get a regexp to validate email addresses but can't get > it quite right. The problem is I can't quite find the regexp to deal > with ignoring the case [EMAIL PROTECTED], which is not valid. Here's > my attempt, neither of my regexps work quite how I want: >

Retrieve HTML from site using cookies

2006-09-21 Thread [EMAIL PROTECTED]
Greetings gents. I'm a Railser working on a django app that needs to do some scraping to gather its data. I need to programatically access a site that requires a username and password. Once I post to the login.php page, there seems to be a redirect and it seems that the site is using a session (pe

Re: Trouble Passing Array of Strings (using Numeric) to C Extension Module

2006-09-21 Thread goetzie
Travis E. Oliphant wrote: > > PyString_Check( *( ( PyObject ** )( pArray->data ) ) ); > Thank you very much Travis! My mistake is now quite obvious (and should have been right from the start). Regarding NumPy, I probably should upgrade from Numeric. It's just hard to change something that is c

Re: Python 2.5 and Unicode on MacOS

2006-09-21 Thread Peter Otten
Michael J. Fromberger wrote: > I'm not sure whether this is a bug, or a feature that I do not fully > understand. I would therefore appreciate some advice, if you have any, > on the following problem: > > I have just installed Python 2.5 (release) under MacOS 10.4.7 ("Tiger"). > Unfortunately, t

Does WSGI offer anything for web *beginner*?

2006-09-21 Thread [EMAIL PROTECTED]
I love idea of WSGI and hope it succeeds. It seems to be helpful for person tempted to write his own framework.they can now just mix and match existing components with WSGI //instead//. I not sure what WSGI offers the web beginner. Aren't they still better off learning an existing web framew

Re: I need some help with a regexp please

2006-09-21 Thread Neil Cerutti
On 2006-09-21, codefire <[EMAIL PROTECTED]> wrote: > I am trying to get a regexp to validate email addresses but > can't get it quite right. The problem is I can't quite find the > regexp to deal with ignoring the case [EMAIL PROTECTED], > which is not valid. Here's my attempt, neither of my regexp

Re: I need some help with a regexp please

2006-09-21 Thread [EMAIL PROTECTED]
codefire wrote: > Hi, > > I am trying to get a regexp to validate email addresses but can't get > it quite right. The problem is I can't quite find the regexp to deal > with ignoring the case [EMAIL PROTECTED], which is not valid. Here's > my attempt, neither of my regexps work quite how I want: >

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread Richard Tew
[EMAIL PROTECTED] wrote: > I have a program which will continue to run for several days. When it is > running, I can't do anything except waiting because it takes over most > of the CUP time. > > Is it possible that the program can save all running data to a file when > I want it to stop, and can r

I need some help with a regexp please

2006-09-21 Thread codefire
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case [EMAIL PROTECTED], which is not valid. Here's my attempt, neither of my regexps work quite how I want: [code] import os import re

Re: itertools.count(-3)

2006-09-21 Thread Jack Diederich
On Thu, Sep 21, 2006 at 08:29:11AM -0700, Carl Banks wrote: > > [EMAIL PROTECTED] wrote: > > itertools.count docs say: > > Does not currently support python long integers. > > Note, count() does not check for overflow and will return negative > > numbers after exceeding sys.maxint. This behavior m

Python 2.5 and Unicode on MacOS

2006-09-21 Thread Michael J. Fromberger
I'm not sure whether this is a bug, or a feature that I do not fully understand. I would therefore appreciate some advice, if you have any, on the following problem: I have just installed Python 2.5 (release) under MacOS 10.4.7 ("Tiger"). Unfortunately, the unit test "test_unicodefile.py" (in

Re: Working with email and mailbox module

2006-09-21 Thread Steve Holden
Nirnimesh wrote: > I want to extract emails from an mbox-type file which contains a number > of individual emails. > > I tried the python mailbox and email modules individually, but I'm > unable to combine them to get what I want. Mailbox allows me to iterate > over all the mails but doesn't give

Re: How to return an "not string' error in function?

2006-09-21 Thread breakfastea
Thank you for your reminder:) However I saw the split() function in the first place and that why I'm trying write one myself:) Peace Bruno Desthuilliers wrote: > [EMAIL PROTECTED] wrote: > (OT : please dont top-post) > > > Thank you for your inputing which has been great inspirational:) > > > >

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread John Machin
Bjoern Schliessmann wrote: > Christophe wrote: > > > To be exact, you need a 64bit Windows OS on a 64bit cpu. > > Is there a reason that can be explained in a less-than-2-KB > posting? :) I mean why Python depends on the processor type that > much. > Python doesn't depend on the processor type in

Re: access to xml_rpc server problem

2006-09-21 Thread Steve Holden
Ted Zeng wrote: > HI, > > I run a xml_rpc server like the following:(sample code from internet) > > server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 8000)) > server.serve_forever() > > If my client is on the same machine, I use :(also from internet sample > code) > > server = xmlrpc

Re: How to return an "not string' error in function?

2006-09-21 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: (OT : please dont top-post) > Thank you for your inputing which has been great inspirational:) > > What I tried to do is to write a string.split() module, So don't waste time: >>> "ab eced f aazaz".split() ['ab', 'eced', 'f', 'aazaz'] >>> "ab-eced-ff-aazaz".split('-')

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Christophe
Bjoern Schliessmann a écrit : > Christophe wrote: > >> To be exact, you need a 64bit Windows OS on a 64bit cpu. > > Is there a reason that can be explained in a less-than-2-KB > posting? :) I mean why Python depends on the processor type that > much. > > Regards, Easy : a 64bit version of Windo

Re: Writing Video conference software for Windows

2006-09-21 Thread Paolo Pantaleo
19 Sep 2006 09:42:51 -0700, Jordan <[EMAIL PROTECTED]>: > If you're going to need win32 system access use the win32all python > extension (very, very good extension). Do you need single frame image > capture, or constant video stream? PIL can be used for the first, it > might also be usable for vi

Re: How to return an "not string' error in function?

2006-09-21 Thread breakfastea
Thank you for your inputing which has been great inspirational:) What I tried to do is to write a string.split() module, so I started with: def spilt(a): l=[] index=0 if not isinstance(a, basestring): #Or isinstance(a, str) return for i in len(a): if a[i]=' ':

Re: Nested Looping SQL Querys

2006-09-21 Thread Steve Holden
Carsten Haese wrote: > On Thu, 2006-09-21 at 01:12, Dennis Lee Bieber wrote: > >>On Wed, 20 Sep 2006 13:21:54 -0400, Steve Holden <[EMAIL PROTECTED]> >>declaimed the following in comp.lang.python: >> >> >>>.execute() is a cursor method, not a connection method. Some DB API >>>modules do implement

Re: How to return an "not string' error in function?

2006-09-21 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: >Thank you so much it answers my humble question perfectly:) > HOWEVER, to answer you final question, yes, there is a different and, in general, better, way. While there's a lot to say about good Python style and typing, I'll summarize a

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Bjoern Schliessmann
Christophe wrote: > To be exact, you need a 64bit Windows OS on a 64bit cpu. Is there a reason that can be explained in a less-than-2-KB posting? :) I mean why Python depends on the processor type that much. Regards, Björn -- BOFH excuse #52: Smell from unhygienic janitorial staff wrecked t

Re: How to return an "not string' error in function?

2006-09-21 Thread breakfastea
Or yes that seems a handy way:) Thanks for all wonderful people here:) Peace Duncan Booth wrote: > Tim Chase <[EMAIL PROTECTED]> wrote: > > > This will return true for both regular strings and for unicode > > strings. If that's a problem, you can use > > > > >>> import types > > >>> isinstance

Re: itertools.count(-3)

2006-09-21 Thread Carl Banks
[EMAIL PROTECTED] wrote: > itertools.count docs say: > Does not currently support python long integers. > Note, count() does not check for overflow and will return negative > numbers after exceeding sys.maxint. This behavior may change in the > future. > > But it seems it doesn't support negative

Re: get process id...

2006-09-21 Thread billie
Fredrik Lundh ha scritto: > billie wrote: > > >> under linux, do: > > > >> import os > >> os.getpid() > > > > Under Windows: > > > > import ctypes > > ctypes.windll.kernel32.GetCurrentProcessId() > > getpid() works just fine on Windows too: > > >>> import ctypes > >>> ctypes.windll.kernel

Re: Changing behaviour of namespaces - solved, I think

2006-09-21 Thread Mikael Olofsson
Peter Otten wrote: > Clearly more elegant than: > > print open(filename).read() > b = a > dummy = 42 names = [] while 1: > ... ns = dict((n, dummy) for n in names) > ... try: > ... execfile(filename, ns) > ... except Name

Re: How to return an "not string' error in function?

2006-09-21 Thread Duncan Booth
Tim Chase <[EMAIL PROTECTED]> wrote: > This will return true for both regular strings and for unicode > strings. If that's a problem, you can use > > >>> import types > >>> isinstance("hello", types.StringType) > True > >>> isinstance(u"hello", types.StringType) > False > >>> isinstance("hello"

Re: Using Beautiful Soup to entangle bookmarks.html

2006-09-21 Thread robin
"George Sakkis" <[EMAIL PROTECTED]> wrote: >Here's what I came up with: >http://rafb.net/paste/results/G91EAo70.html. Tested only on my >bookmarks; see if it works for you. That URL is dead. Got another? - robin noisetheatre.blogspot.com -- http://mail.python.org/mailman/listinfo/python-lis

itertools.count(-3)

2006-09-21 Thread bearophileHUGS
itertools.count docs say: Does not currently support python long integers. Note, count() does not check for overflow and will return negative numbers after exceeding sys.maxint. This behavior may change in the future. But it seems it doesn't support negative numbers too: >>> from itertools import

Re: Is it possible to save a running program and reload next time ?

2006-09-21 Thread Hans Georg Krauthaeuser
[EMAIL PROTECTED] wrote: > > Can objects be saved and reloaded by "Pickle" ? I have tried but no > success. > Yes, that's the intended use of pickle/cPickle. There are examples in the docs: http://docs.python.org/lib/module-pickle.html What have you tried and what didn't work? Hans Georg --

Re: How to return an "not string' error in function?

2006-09-21 Thread breakfastea
Thank you so much it answers my humble question perfectly:) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to return an "not string' error in function?

2006-09-21 Thread Jean-Paul Calderone
On Thu, 21 Sep 2006 09:26:20 -0500, Tim Chase <[EMAIL PROTECTED]> wrote: >> def test(s): >>if type(s) != ? : >> return >> #So here I want establish a situation about that if is not string >> #then , but how should write the ? >> #Or is there any other way to do it? > > >>> isins

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Brendan
Thanks. Christophe wrote: > Brendan a écrit : > > Hello, > > I just tried to use the Windows XP installer for Python 2.5 AMD64 but I > > get the error message: "Installation package not supported by processor > > type" > > > > I am running Windows XP Pro on an AMD Athon 64 Processor. > > > > Do I

Re: How to return an "not string' error in function?

2006-09-21 Thread Tim Chase
> def test(s): >if type(s) != ? : > return > #So here I want establish a situation about that if is not string > #then , but how should write the ? > #Or is there any other way to do it? >>> isinstance("hello", basestring) True >>> isinstance(u"hello", basestring) True This

Re: Changing behaviour of namespaces - solved, I think

2006-09-21 Thread Peter Otten
Mikael Olofsson wrote: > Peter Otten wrote: >> To feed an arbitrary mapping object to execfile() you need to upgrade to >> Python 2.4. > > Thanks! As clear as possible. I will do that. > > FYI: I think I managed to achieve what I want in Py2.3 using the > compiler module: > > def getNamesFr

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Christophe
Brendan a écrit : > Hello, > I just tried to use the Windows XP installer for Python 2.5 AMD64 but I > get the error message: "Installation package not supported by processor > type" > > I am running Windows XP Pro on an AMD Athon 64 Processor. > > Do I need to have a 64-bit OS to use this versio

How to return an "not string' error in function?

2006-09-21 Thread breakfastea
first of all I have to claim that I'm a noob so please help me don't blame me:) for example: def test(s): if type(s) != ? : return #So here I want establish a situation about that if is not string #then , but how should write the ? #Or is there any other way to do it? Any sugg

Tk eventloop

2006-09-21 Thread swell
Hi I try/struggle to use an ActiveX component in a Tk app. When i execute it i can catch the first event and then when i try to change the value of the w widget everything blocks and nothing is updated anymore. Does someone have an idea of what is wrong and how to smartly integrate these events wi

Re: How to get ip setting, dynamic ip or static ip?

2006-09-21 Thread Duncan Booth
"kode4u" <[EMAIL PROTECTED]> wrote: > How to use python get my windows box's ip setting type? Dynamic ip, or > static ip? > > If it's static ip, what's the exact value? > Here's one way: def ipinfo(interface="Local Area Connection"): dhcpenabled = False staticip = None s

Re: Decorator cllass hides docstring from doctest?

2006-09-21 Thread Peter Otten
Berthold Höllmann wrote: > Saving the following code to a file and running the code through > python does not give the expected error. disableling the "@decor" line > leads to the expected error message. Is this a bug or an overseen > feature? Neither, I'd say. Just an unfortunate interaction bet

Re: Python and CORBA

2006-09-21 Thread Paul McGuire
"rodmc" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks to everyone for their help. I had tried OmniORB and while the > base library worked ok, the Python bit OmniORBpy seems to dislike > working... Perhaps there is something wrong with my settings. > > I will also try the Pyt

Python 2.5 WinXP AMD64

2006-09-21 Thread Brendan
Hello, I just tried to use the Windows XP installer for Python 2.5 AMD64 but I get the error message: "Installation package not supported by processor type" I am running Windows XP Pro on an AMD Athon 64 Processor. Do I need to have a 64-bit OS to use this version? -- http://mail.python.org/mai

Re: Decorator cllass hides docstring from doctest?

2006-09-21 Thread Michele Simionato
Berthold Höllmann wrote: > Saving the following code to a file and running the code through > python does not give the expected error. disableling the "@decor" line > leads to the expected error message. Is this a bug or an overseen > feature? Others have already pointed out the mistake. I wrote a

  1   2   >