Re: surprising behaviour of os.environ.clear

2008-06-27 Thread s0suk3
On Jun 27, 4:05 pm, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > If I call os.environ.clear in a python program child processes still > see the deleted entries. But when I iterate over the keys like so > > names = os.environ.keys > for k in names: > del os.environ[k] > > then the entries are al

Re: Problems with file IO in a thread, and shutil

2008-06-27 Thread Roopesh
> Maybe it's a Windows service, eg the indexing service or generating > thumbnails. Anyway, retrying after a delay would still be worth it. Yes, this thing works :-) Thanks a lot. Thanks Roopesh -- http://mail.python.org/mailman/listinfo/python-list

Re: Pygame, how to show window without loop? no loop=popupand close...

2008-06-27 Thread Carl Banks
On Jun 27, 10:58 pm, defn noob <[EMAIL PROTECTED]> wrote: > right. im an idiot anyway. i can just draw the lines before entering > the loop, problem solved... Do not do that; it'll create a busy loop and use 100% of CPU. Use pygame.event.wait() instead. It waits for an event to occur, without us

Re: surprising behaviour of os.environ.clear

2008-06-27 Thread Tim Roberts
Benjamin <[EMAIL PROTECTED]> wrote: > >On Jun 27, 4:05 pm, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: >> If I call os.environ.clear in a python program child processes still >> see the deleted entries. But when I iterate over the keys like so >> >> names =  os.environ.keys >> for k in names: >>     d

Re: problem compiling extensions with mingw

2008-06-27 Thread John Machin
On Jun 28, 3:41 pm, eliben <[EMAIL PROTECTED]> wrote: > On Jun 27, 3:10 pm, eliben <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > I'm trying to compile the minimal example > > fromhttp://en.wikibooks.org/wiki/Python_Programming/Extending_with_Cwith > > MinGW (latest version) and Python 2.5 (lates

Re: Working with the Windows Registry

2008-06-27 Thread Tim Roberts
teh_sAbEr <[EMAIL PROTECTED]> wrote: >Hi everybody. I'm trying to write a script that'll change desktop >wallpaper every time its run. Heres what I've gotten so far: > >#random wallpaper changer! >import _winreg >from os import walk >from os.path import exists >from random import randint > >#first

Re: this is simple...

2008-06-27 Thread Daniel da Silva
ToshiBoy, You might want to take a look at the filter() function, it can also be used for the kind of the thing you're doing. http://docs.python.org/tut/node7.html#SECTION00713 >>> B = range(1,27) >>> def test(b): ... if b*b in B: ... return True ... else: ...

Re: problem compiling extensions with mingw

2008-06-27 Thread eliben
On Jun 27, 3:10 pm, eliben <[EMAIL PROTECTED]> wrote: > Hello, > I'm trying to compile the minimal example > fromhttp://en.wikibooks.org/wiki/Python_Programming/Extending_with_Cwith > MinGW (latest version) and Python 2.5 (latest ActiveState binary > install). When running the setup file, the foll

Re: this is simple...

2008-06-27 Thread ToshiBoy
On Jun 28, 2:48 pm, Mel <[EMAIL PROTECTED]> wrote: > ToshiBoy wrote: > > I have two lists A and B that are both defined as range(1,27) I want > > to find the entries that are valid for A = BxB > [ ... ] > > I get, as expected 1,4,9,16,25 printed out being the only members of B > > where the conditi

Re: lxml and links

2008-06-27 Thread Stefan Behnel
Ampedesign wrote: > I'm trying to extract all the links on a page with lxml. Ideally, I > would like it to return me a list of hrefs of each link on the page, > in a list. > > How would I go about doing this? Read the manual? http://codespeak.net/lxml/dev/lxmlhtml.html#working-with-links http://

Re: Mako vs. Cheetah?

2008-06-27 Thread Maric Michaud
Le Saturday 28 June 2008 06:30:50 Tim Roberts, vous avez écrit : >  Others really like the TAL scheme in Zope. > For my taste, TAL just requires too much non-essential syntax; it > interferes with the reading of the page. > > So, the folks who like TAL can go ahead and be productive with TAL, and

Re: this is simple...

2008-06-27 Thread Mel
ToshiBoy wrote: > I have two lists A and B that are both defined as range(1,27) I want > to find the entries that are valid for A = BxB [ ... ] > I get, as expected 1,4,9,16,25 printed out being the only members of B > where the condition is true, but when I print B I get: > > [1, 2, 3, 4, 5, 7, 9

Re: this is simple...

2008-06-27 Thread Maric Michaud
Le Saturday 28 June 2008 06:30:25 ToshiBoy, vous avez écrit : > I am a newbie... and the first to admit it... but this has me stuffed: > > I have two lists A and B that are both defined as range(1,27) I want > to find the entries that are valid for A = BxB > > so here is my code: > > A = range(1,27

Re: Mako vs. Cheetah?

2008-06-27 Thread Tim Roberts
"John Salerno" <[EMAIL PROTECTED]> wrote: > >Is it correct to say that Mako allows you to embed Python code within HTML, >whereas Cheetah requires a certain amount of "tweaking" of Python code so >that it isn't really code you could just run independently in the >interpreter? > >I'm getting that

this is simple...

2008-06-27 Thread ToshiBoy
I am a newbie... and the first to admit it... but this has me stuffed: I have two lists A and B that are both defined as range(1,27) I want to find the entries that are valid for A = BxB so here is my code: A = range(1,27) B = range(1,27) for b in B: if b*b in A: print b

Re: CAPI and thread safety

2008-06-27 Thread Lane Brooks
Thanks for the pointer. I'll check it out. That is what I was looking for. Lane Benjamin wrote: On Jun 27, 4:33 pm, Lane Brooks <[EMAIL PROTECTED]> wrote: I am writing an extension module that needs to release the global interpreter lock during some blocking I/O calls, but I need a mute

Re: Help with Borg design Pattern

2008-06-27 Thread Maric Michaud
Le Saturday 28 June 2008 03:47:43 Casey McGinty, vous avez écrit : > On Fri, Jun 27, 2008 at 3:21 PM, Casey McGinty <[EMAIL PROTECTED]> > > wrote: > > Hi, > > > > I'm trying to implement a simple Borg or Singleton pattern for a class > > that inherits from 'dict'. Can someone point out why this cod

Re: Using just the Mako part of Pylons?

2008-06-27 Thread John Salerno
John Salerno wrote: I just installed Pylons onto my hosting server so I could try out templating with Mako, but it seems a little more complicated than that. From the look of it all, the site seems to want a full Pylons application. Is it possible to just use regular HTML files with a bit of

Re: Do I need "self" and "other"?

2008-06-27 Thread Maric Michaud
Le Saturday 28 June 2008 00:17:33 Kurda Yon, vous avez écrit : > class Vector: >   def __add__(self, other): >     data = [] >     for j in range(len(self.data)): >       data.append(self.data[j] + other.data[j]) >     return Vector(data) > > In this example one uses "self" and "other". Does one re

Re: Pygame, how to show window without loop? no loop=popupand close...

2008-06-27 Thread defn noob
right. im an idiot anyway. i can just draw the lines before entering the loop, problem solved... -- http://mail.python.org/mailman/listinfo/python-list

Using just the Mako part of Pylons?

2008-06-27 Thread John Salerno
I just installed Pylons onto my hosting server so I could try out templating with Mako, but it seems a little more complicated than that. From the look of it all, the site seems to want a full Pylons application. Is it possible to just use regular HTML files with a bit of the Mako language embe

Re: Pygame, how to show window without loop? no loop=popupand close...

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 defn noob wrote: > Im using PyGame to draw images of graphs and trees. Howver right now i > am looping using: > > while 1: > for event in pygame.event.get(): > if event.type == pygame.QUIT: sys.exit() > > screen.fill(screencolor) > >

Re: struct.pack behavior

2008-06-27 Thread Steven Clark
> For efficiency reasons many CPUs require particular primitive data > types (integers/pointers of various sizes) to be placed in memory at > particular boundaries. For example, shorts ("H" above, usually two bytes > and probably always so in the struct module) are often required to be > on even ad

Re: using urllib2

2008-06-27 Thread Alexnb
Okay, so I copied your code(and just so you know I am on a mac right now and i am using pydev in eclipse), and I got these errors, any idea what is up? Traceback (most recent call last): File "/Users/Alex/Documents/workspace/beautifulSoup/src/firstExample.py", line 14, in print list(get_de

Re: Do I need "self" and "other"?

2008-06-27 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Kurda Yon <[EMAIL PROTECTED]> wrote: > OK, I see. In the given example "self" is just a name which can be > replace by whichever (valid) name. Is that always like that? I mean, > does [self] have a special meaning in some cases or it is always "just > a name like

Pygame, how to show window without loop? no loop=popupand close...

2008-06-27 Thread defn noob
Im using PyGame to draw images of graphs and trees. Howver right now i am looping using: while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() screen.fill(screencolor) pygame.draw.circle(screen, linecolor, (500, 20), 12, 0) draw((500, 20), 3)

Re: Do I need "self" and "other"?

2008-06-27 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I found one example which defines the addition of two vectors as a > method of a class. It looks like that: > > class Vector: > def __add__(self, other): > data = [] > for j in range(len(self.data)): >

Re: ImportError: DLL load failed

2008-06-27 Thread Andrew MacIntyre
Tony May wrote: I'm having trouble importing when I run in Python. The hello world program passes the test during the bjam build but gives an error about loading the dll when I import from a python script. first the test from running bjam. ...patience... ...found 1915 targets... ...using 1 tem

Re: surprising behaviour of os.environ.clear

2008-06-27 Thread Benjamin
On Jun 27, 4:05 pm, "Joe P. Cool" <[EMAIL PROTECTED]> wrote: > If I call os.environ.clear in a python program child processes still > see the deleted entries. But when I iterate over the keys like so > > names =  os.environ.keys > for k in names: >     del  os.environ[k] > > then the entries are al

Re: Embedded Python Import problem

2008-06-27 Thread Benjamin
On Jun 27, 5:47 pm, sleek <[EMAIL PROTECTED]> wrote: > I am having trouble with the following code: > > PyObject *module = PyImport_ImportModule(modulename); > if (module == NULL) { > >     PyObject* et, *ev, *etr; >     PyErr_Fetch(&et, &ev, &etr); >     PyObject* traceback = PyImport_ImportModule

Re: CAPI and thread safety

2008-06-27 Thread Benjamin
On Jun 27, 4:33 pm, Lane Brooks <[EMAIL PROTECTED]> wrote: > I am writing an extension module that needs to release the global > interpreter lock during some blocking I/O calls, but I need a mutex in > the C code to make some of the shared data in the extension module are > kept thread safe.  Can a

Re: Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
On Fri, Jun 27, 2008 at 3:21 PM, Casey McGinty <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to implement a simple Borg or Singleton pattern for a class that > inherits from 'dict'. Can someone point out why this code does not work? > > class MyDict( dict ): >__state = {} >def __init__(s

Help with Borg design Pattern

2008-06-27 Thread Casey McGinty
Hi, I'm trying to implement a simple Borg or Singleton pattern for a class that inherits from 'dict'. Can someone point out why this code does not work? class MyDict( dict ): __state = {} def __init__(self): self.__dict__ = self.__state a = MyDict() a['one'] = 1 a['two'] = 2 print a

httplib HTTP: Logging request message

2008-06-27 Thread tom
With module httplid, I can do conn.request("POST", "/target", params, headers) Now, I want to log the request message that is sent by the request method. I don't don't see a method for that task. Any suggestion? For a response, I can log the response message by using the call method. Though, I

lxml and links

2008-06-27 Thread Ampedesign
I'm trying to extract all the links on a page with lxml. Ideally, I would like it to return me a list of hrefs of each link on the page, in a list. How would I go about doing this? -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ or Python

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kurda Yon wrote: > I would like to know what are advantages of Python in comparison with C > ++? In which cases and why Python can be a better tool than C++? > > Thank you! I'm a relative novice, so I couldn't tell you about deeply hidden features or

Re: Do I need "self" and "other"?

2008-06-27 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kurda Yon wrote: > Hi, > > I found one example which defines the addition of two vectors as a > method of a class. It looks like that: > > class Vector: > def __add__(self, other): > data = [] > for j in range(len(self.data)): > data.

Re: Do I need "self" and "other"?

2008-06-27 Thread Luis Zarrabeitia
On Friday 27 June 2008 06:41:22 pm Kurda Yon wrote: > OK, I see. In the given example "self" is just a name which can be > replace by whichever (valid) name. Is that always like that? I mean, > does "slef" have a special meaning in some cases or it is always "just > a name like any other"? I am ask

Re: warning for unused packages/modules/objects

2008-06-27 Thread Robert Kern
Daniel Fetchinson wrote: How difficult would it be to implement a system in python that would warn if there are unnecessarily imported packages/modules/objects in the code? I mean that when developing some code one frequently imports stuff, deletes the import, changes stuff here and there, import

Re: Do I need "self" and "other"?

2008-06-27 Thread Robert Kern
Terry Reedy wrote: Kurda Yon wrote: OK, I see. In the given example "self" is just a name which can be replace by whichever (valid) name. Is that always like that? I mean, does "slef" have a special meaning in some cases or it is always "just a name like any other"? Yes. A method is a funct

More on Urllib, and Urllib2

2008-06-27 Thread Alex Bryan
Okay, so I am having issues figuring anything out about this and have read the "missing manual" about it so please don't send me that link again. To put it simply I want to be able to input a word and get the definition from dictionary.com. Now I found a work-around for searching for the wo

Re: using urllib2

2008-06-27 Thread Alexnb
I have read that multiple times. It is hard to understand but it did help a little. But I found a bit of a work-around for now which is not what I ultimately want. However, even when I can get to the page I want lets say, "Http://dictionary.reference.com/browse/cheese", I look on firebug, and exte

Re: using urllib2

2008-06-27 Thread Alexnb
I have read that multiple times. It is hard to understand but it did help a little. But I found a bit of a work-around for now which is not what I ultimately want. However, even when I can get to the page I want lets say, "Http://dictionary.reference.com/browse/cheese", I look on firebug, and exte

Re: Do I need "self" and "other"?

2008-06-27 Thread Terry Reedy
Kurda Yon wrote: OK, I see. In the given example "self" is just a name which can be replace by whichever (valid) name. Is that always like that? I mean, does "slef" have a special meaning in some cases or it is always "just a name like any other"? Yes. A method is a function bound to a cla

Embedded Python Import problem

2008-06-27 Thread sleek
I am having trouble with the following code: PyObject *module = PyImport_ImportModule(modulename); if (module == NULL) { PyObject* et, *ev, *etr; PyErr_Fetch(&et, &ev, &etr); PyObject* traceback = PyImport_ImportModule("traceback"); PyObject* tb = PyObject_CallMethodObjArgs(traceb

Re: Do I need "self" and "other"?

2008-06-27 Thread Kurda Yon
On Jun 27, 6:32 pm, Hans Nowak <[EMAIL PROTECTED]> wrote: > Kurda Yon wrote: > > Hi, > > > I found one example which defines the addition of two vectors as a > > method of a class. It looks like that: > > > class Vector: > > def __add__(self, other): > > data = [] > > for j in range(len(s

Re: Do I need "self" and "other"?

2008-06-27 Thread Hans Nowak
Kurda Yon wrote: Hi, I found one example which defines the addition of two vectors as a method of a class. It looks like that: class Vector: def __add__(self, other): data = [] for j in range(len(self.data)): data.append(self.data[j] + other.data[j]) return Vector(data) In

CAPI and thread safety

2008-06-27 Thread Lane Brooks
I am writing an extension module that needs to release the global interpreter lock during some blocking I/O calls, but I need a mutex in the C code to make some of the shared data in the extension module are kept thread safe. Can anyone recommend a portable way to do this? I could use a pthre

frame grabber hardware

2008-06-27 Thread rubbishemail
Hello, can anybody recommend a simple USB or PCI framegrabber with video input that runs under xp and has a python driver available? I just want to get the image into a file, no special requirements. Thank you Daniel -- http://mail.python.org/mailman/listinfo/python-list

C++ or Python

2008-06-27 Thread Kurda Yon
I would like to know what are advantages of Python in comparison with C ++? In which cases and why Python can be a better tool than C++? Thank you! -- http://mail.python.org/mailman/listinfo/python-list

Do I need "self" and "other"?

2008-06-27 Thread Kurda Yon
Hi, I found one example which defines the addition of two vectors as a method of a class. It looks like that: class Vector: def __add__(self, other): data = [] for j in range(len(self.data)): data.append(self.data[j] + other.data[j]) return Vector(data) In this example one us

Re: "method involving two objects" is that possible in Python?

2008-06-27 Thread [EMAIL PROTECTED]
On 27 juin, 23:41, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I just started to learn Python. I understood how one can create a > class and define a method related with that class. According to my > understanding every call of a methods is related with a specific > object. For example, we have

IPython doesn't always comes up NoColor

2008-06-27 Thread writeson
Hi all, I've been looking at IPython for awhile, but I'm always disappointed that it comes up in NoColor mode no matter what I try. It is configured in the ipythonrc file to be 'color Linux'. I've run it from a Putty terminal window, Konsole and xterm, still no luck. The Putty window shows color f

Re: "method involving two objects" is that possible in Python?

2008-06-27 Thread Jason Scheirer
On Jun 27, 2:41 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > Hi, > > I just started to learn Python. I understood how one can create a > class and define a method related with that class. According to my > understanding every call of a methods is related with a specific > object. For example, we have

"method involving two objects" is that possible in Python?

2008-06-27 Thread Kurda Yon
Hi, I just started to learn Python. I understood how one can create a class and define a method related with that class. According to my understanding every call of a methods is related with a specific object. For example, we have a method "length", than we call this method as the following "x.len

Re: How do web templates separate content and logic?

2008-06-27 Thread [EMAIL PROTECTED]
On 27 juin, 18:09, "John Salerno" <[EMAIL PROTECTED]> wrote: > I've been doing some research on web templates, and even though I read that > they help enforce the MVC pattern, I don't really understand how they are > keeping content and logic separated. For which definitions of "content" and "logi

surprising behaviour of os.environ.clear

2008-06-27 Thread Joe P. Cool
If I call os.environ.clear in a python program child processes still see the deleted entries. But when I iterate over the keys like so names = os.environ.keys for k in names: del os.environ[k] then the entries are also deleted for the child processes. Where is the difference? Is this a bug?

Re: How to get a multicast to wait for all nodes?

2008-06-27 Thread Ryuke
On Jun 27, 8:09 am, "Colin J. Williams" <[EMAIL PROTECTED]> wrote: > Ryuke wrote: > > I have a code that receives gps information from nodes and gives off > > its own coordinates via radios connected by Ethernet.  but the code > > continues to run after receiving only 1 set of coordinates, how do i

Enquiry about PyUSB

2008-06-27 Thread Abhishek Wadhava
Hi.. I'm trying to make a Software USB based on AVR309 application note available at www.atmel.com/dyn/resources/prod_documents/doc2556.pdf So what basically i'm doing is programming a ATTINY-44 to do functions of a USB-driver and when connected to USB port, should be automatically detected by the

Re: using urllib2

2008-06-27 Thread Jeff McNeil
I stumbled across this a while back: http://www.voidspace.org.uk/python/articles/urllib2.shtml. It covers quite a bit. The urllib2 module is pretty straightforward once you've used it a few times. Some of the class naming and whatnot takes a bit of getting used to (I found that to be the most con

Re: [Employment] New TurboGears Job in Eugene, OR

2008-06-27 Thread Dan Upton
On Fri, Jun 27, 2008 at 4:04 PM, Paul McNett <[EMAIL PROTECTED]> wrote: > Silas Snider wrote: >> >> Full-time academic year position >> Salary range: $2819 - $4404 per month ( $16.26 - $25.41 per hour) > >> The following knowledge, skills and experience are necessary for this >> position: >> >> Exp

Re: [Employment] New TurboGears Job in Eugene, OR

2008-06-27 Thread Paul McNett
Silas Snider wrote: Full-time academic year position Salary range: $2819 - $4404 per month ( $16.26 - $25.41 per hour) The following knowledge, skills and experience are necessary for this position: Expert Python and SQL programming skills, and proficiency with Javascript, CSS, XHTML and web

Re: Simple regular expression

2008-06-27 Thread John Machin
On Jun 28, 2:26 am, python_enthu <[EMAIL PROTECTED]> wrote: > On Jun 27, 11:05 am, "John Salerno" <[EMAIL PROTECTED]> wrote: > > > > > "python_enthu" <[EMAIL PROTECTED]> wrote in message > > >news:[EMAIL PROTECTED] > > > >I am trying this.. what is wrong in this.. > > > > IDLE 1.2.2 > > import

[Employment] New TurboGears Job in Eugene, OR

2008-06-27 Thread Silas Snider
I've been heading up a team writing a rather large TurboGears app and I've had to leave, so we're looking for replacements. The description is below. - Full position announcement at: In an eggshell: Python/Turbogears Web Applications Progr

Re: Django or TurboGears for a new project

2008-06-27 Thread Jason Scheirer
On Jun 27, 9:52 am, Kirk Strauser <[EMAIL PROTECTED]> wrote: > We're looking to migrate a Zope site to Django, but before getting beyond > the dreaming stage, I thought I'd see what others are doing these days. > > If you were going to start a fairly complex site today with lots of DB > integration

Re: ask for a RE pattern to match TABLE in html

2008-06-27 Thread Dan
On Jun 27, 1:32 pm, "David C. Ullrich" <[EMAIL PROTECTED]> wrote: > In article > <[EMAIL PROTECTED]>, > Jonathan Gardner <[EMAIL PROTECTED]> wrote: > > > On Jun 26, 3:22 pm, MRAB <[EMAIL PROTECTED]> wrote: > > > Try something like: > > > > re.compile(r'.*?', re.DOTALL) > > > So you would pick up s

Re: Cyclic imports

2008-06-27 Thread James
> In code that runs after the module has been imported (basically > anything defined in a function that isn't called by code that runs at > module time), you can expect the variables defined in the imported > module to be available. > > If you have circular imports involved, making sure the modules

Query regarding PythonQt

2008-06-27 Thread Shankar Narayana
Hi, I am newbie to PythonQt. I wanted to access the Qt objects created in C++ using Python and update things. I had a look at this URL " http://doc.trolltech.com/qq/qq23-pythonqt.html#decoratorsandcwrappers"; which talks about using PythonQt for the same. I followed the instructions given in the

Re: Sequence iterators with __index__

2008-06-27 Thread yaipa
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote: > On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote: > > > > > > I think it would be useful if iterators on sequences had the __index__ > > > method so that they could be used to slice sequences. I was writing a > > > class and wanted to re

ImportError: DLL load failed

2008-06-27 Thread Tony May
I'm having trouble importing when I run in Python. The hello world program passes the test during the bjam build but gives an error about loading the dll when I import from a python script. first the test from running bjam. ...patience... ...found 1915 targets... ...using 1 temp target... ...updat

Re: Hamming Distance

2008-06-27 Thread Jared Grubb
Matimus, I was surprised that "lazy" was the algorithm that won your time tests, and I saw a way to improve it even better (algorithm is O(# ones in number) rather than O(# bits in number)) def lazy2(a, b, bits=32): x = (a ^ b) & ((1 << bits) - 1) tot = 0 while x: tot += 1

Re: using urllib2

2008-06-27 Thread Alexnb
Okay, I tried to follow that, and it is kinda hard. But since you obviously know what you are doing, where did you learn this? Or where can I learn this? Maric Michaud wrote: > > Le Friday 27 June 2008 10:43:06 Alexnb, vous avez écrit : >> I have never used the urllib or the urllib2. I really h

Re: ask for a RE pattern to match TABLE in html

2008-06-27 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Jun 26, 3:22 pm, MRAB <[EMAIL PROTECTED]> wrote: > > Try something like: > > > > re.compile(r'.*?', re.DOTALL) > > So you would pick up strings like "foo td>"? I doubt that is what oyster wants. I asked a question

Re: sqlite3 alternative option

2008-06-27 Thread Petite Abeille
On Jun 26, 2008, at 10:55 PM, Gandalf wrote: I have almost million records so I need a better solution. SQLite shouldn't have any issue handling such a load. Perhaps this is an operator, hmmm, issue? -- PA. http://alt.textdrive.com/nanoki/ -- http://mail.python.org/mailman/listinfo/pytho

Re: Simple regular expression

2008-06-27 Thread Joel Corbin
If you read John's message carefully (which is the output of "help(re.search)") you can see the difference between "re.search" and "re.match". The former looks for a regex anywhere in the given string, the latter requires the string to begin with the given regex. Joel On Fri, Jun 27, 2008 at 12:2

Django or TurboGears for a new project

2008-06-27 Thread Kirk Strauser
We're looking to migrate a Zope site to Django, but before getting beyond the dreaming stage, I thought I'd see what others are doing these days. If you were going to start a fairly complex site today with lots of DB integration, would you begin with Django or TurboGears, or something else entirel

Re: embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
--- On Fri, 6/27/08, Tim Spens <[EMAIL PROTECTED]> wrote: > From: Tim Spens <[EMAIL PROTECTED]> > Subject: Re: embedding and extending python C API registering callback > handler objects > To: python-list@python.org, "Matimus" <[EMAIL PROTECTED]> > Date: Friday, June 27, 2008, 9:16 AM > thanks

Re: Windows OS , Bizarre File Pointer Fact

2008-06-27 Thread Matt Nordhoff
Taygun Kekec wrote: > Code : > #!/usr/bin/python > # -*- coding: utf-8 -*- > import os > > if os.name == 'nt': > OS_Selection = 0 > elif os.name == 'posix': > OS_Selection = 1 > else : > OS_Selection = 1 > > del_cmd_os = ( "del","rm") > filelist = ("ddd.txt","eee.txt","fff.txt") > >

Using Python Scripts with IIS - ASP or Python-based CGI scripts with IIS - which makes more sense?

2008-06-27 Thread davidj411
when does is make sense to use a ASP style Page (.psp) over a Python- based CGI script with IIS. ? http://support.microsoft.com/kb/276494 ASP requires registering the python engine. which has better performance? The ASP style uses a new part of the python language which is unfamiliar to me, e.g.

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread Damon Getsman
I didn't think that it was. I just spent about 10 minutes trying to google for the page that I found that on, but I wasn't able to turn it up. My google-fu sucks. I know that I was researching a particular part of the os module and that the snippets of script on the page had an example containin

Re: Use of the "is" statement

2008-06-27 Thread Maric Michaud
Le Friday 27 June 2008 18:26:45 Christian Heimes, vous avez écrit : > Ask yourself if you are interested if f.tell() returns exactly the same > 0 object ("is") or a number that is equal to 0 ("=="). That said, "f.tell() == 0" and "f.tell() != 0" should be written "f.tell()" and "not f.tell()" in

Re: Simple regular expression

2008-06-27 Thread python_enthu
On Jun 27, 11:05 am, "John Salerno" <[EMAIL PROTECTED]> wrote: > "python_enthu" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >I am trying this.. what is wrong in this.. > > > IDLE 1.2.2 > import re > a="my name is fname lname" > p=re.compile('name') > m=p.

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Joel Corbin wrote: > Thank you Gary, Cédric, Christian. When *would *one use "is"? As I said: The "is" statement should only be used when you want to check of something is exactly and identical to None like "a is None" or "b is not None". For everything else you should use == or !=. There are some

Re: How do web templates separate content and logic?

2008-06-27 Thread Sebastian "lunar" Wiesner
John Salerno <[EMAIL PROTECTED]>: > But when you have a templating system that mixes HTML and Python code, how > is this helping to keep things separate? You don't. Normally you embed only the code, that is absolutely necessary, e.g. for iterating over a list. Consider an online shop, that nee

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread John Salerno
"Damon Getsman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Okay, maybe I just didn't understand the websites that were given as > examples as to 'decoration'. I first came across the unusual '@' when > I was browsing through some extreme beginner's information on os.x > method

Re: newb question on strings

2008-06-27 Thread Kirk Strauser
At 2008-06-24T20:27:33Z, regex_jedi <[EMAIL PROTECTED]> writes: > Notice that the 4th value has a single quote in it. Well, I need to > make sure that the single quote is escaped before handing it off for > further processing to a class I later call for some other processing. Out of curiosity, wh

Re: embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
thanks, but didn't fix the problem. --- On Fri, 6/27/08, Matimus <[EMAIL PROTECTED]> wrote: > From: Matimus <[EMAIL PROTECTED]> > Subject: Re: embedding and extending python C API registering callback > handler objects > To: python-list@python.org > Date: Friday, June 27, 2008, 9:03 AM > On Jun

Re: How to "rebind" py2.5.1 to run from comprompt after uninstalling py3.0?

2008-06-27 Thread Matimus
On Jun 26, 8:13 pm, defn noob <[EMAIL PROTECTED]> wrote: > I installed python30 and so command prompt runs all pythonprograms > through that which i didnt want so i uninstalled it. > > now i cant start any pythonprograms through the commandprompt. > > how do I "rebind" python25 to luanch when clali

How do web templates separate content and logic?

2008-06-27 Thread John Salerno
I've been doing some research on web templates, and even though I read that they help enforce the MVC pattern, I don't really understand how they are keeping content and logic separated. Layout is easy, it's just not there as far as I can see, and CSS can be used for that. But when you have a t

Re: embedding and extending python C API registering callback handler objects

2008-06-27 Thread Matimus
On Jun 27, 8:22 am, Tim Spens <[EMAIL PROTECTED]> wrote: > Hello all, > > I've been trying to get an example found > herehttp://codeidol.com/python/python3/Embedding-Python/Registering-Callb... > to work.  Every thing works fine except when I try to trigger an event from c > that will call a pyth

Re: Use of the "is" statement

2008-06-27 Thread Jason Scheirer
On Jun 27, 8:38 am, Gary Herron <[EMAIL PROTECTED]> wrote: > Joel Corbin wrote: > > Hello, > > > I'm trying to clarify what exactly the behaviour of the is statement > > is (or should be). Naturally, this has been nearly impossible to > > google for, even using quotations... It is my impression tha

Re: Use of the "is" statement

2008-06-27 Thread Joel Corbin
Thank you Gary, Cédric, Christian. When *would *one use "is"? Cédric... the problem I was having was purely an issue of comparison "if file.tell() is 0L" was returning False. Strangely enough, "if file.tell() is 0" returns True in the right cases. I assume this is related to the None case? On

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Gary Herron wrote: > In short: *never* use "is". Never use "is" unless you want to check "if something is None or something is not None" Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Use of the "is" statement

2008-06-27 Thread Cédric Lucantis
Le Friday 27 June 2008 16:51:07 Joel Corbin, vous avez écrit : > Hello, > > I'm trying to clarify what exactly the behaviour of the is statement is (or > should be). Naturally, this has been nearly impossible to google for, even > using quotations... try this one: http://www.google.com/search?hl

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread Bruno Desthuilliers
Damon Getsman a écrit : Okay, maybe I just didn't understand the websites that were given as examples as to 'decoration'. I first came across the unusual '@' when I was browsing through some extreme beginner's information on os.x method descriptions. I asked some other people about it and they

Re: Use of the "is" statement

2008-06-27 Thread Christian Heimes
Joel Corbin wrote: > I'm trying to clarify what exactly the behaviour of the is statement is (or > should be). ... People often think that "is" is part of the comparison operator set. The "is" statement does not compare two objects. Never ever use "is" to compare strings or numbers. Christian

Re: what is meaning of "@" in pyhon program.

2008-06-27 Thread Damon Getsman
Okay, maybe I just didn't understand the websites that were given as examples as to 'decoration'. I first came across the unusual '@' when I was browsing through some extreme beginner's information on os.x method descriptions. I asked some other people about it and they had no idea what it meant.

Re: Use of the "is" statement

2008-06-27 Thread Gary Herron
Joel Corbin wrote: Hello, I'm trying to clarify what exactly the behaviour of the is statement is (or should be). Naturally, this has been nearly impossible to google for, even using quotations... It is my impression that the is statement should be equivalent to "==", at least on some level.

Re: Design principles and architecture of an information transfer standard based on XML and SOAP

2008-06-27 Thread Stefan Behnel
xkenneth wrote: > I'm looking for a bit of advice. There's an oilfield standard > called WITSML (Wellsite Information Transfer Standard Markup Language > - witsml.org), it's basically a collection of XML schemas and a spec For implementing XML languages, I (biasedly) advocate lxml's element class

embedding and extending python C API registering callback handler objects

2008-06-27 Thread Tim Spens
Hello all, I've been trying to get an example found here http://codeidol.com/python/python3/Embedding-Python/Registering-Callback-Handler-Objects/ to work. Every thing works fine except when I try to trigger an event from c that will call a python function. Here is my test code: //-

  1   2   >