UR SCHOOL AND COLLEGE'S, PLEASE REGISTER UR SCHOOL AND COLLEGE NAME'S IN THIS SITE. "" IF U HAVE TIME THEN DO IT. PLEASE I REQUEST. """

2008-06-06 Thread jack
IF you want to meet your old school mate's & college mate's of your life there is a chance, just enter school or college details in the below site http://www.batchmates.com/institution/regform.asp?refid=1529710&reflink=31481 please forward to ur friend's tell to them forward this message to there

Re: How to kill a thread?

2008-06-06 Thread Rhamphoryncus
On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > It's always been my understanding that you can't forcibly kill a thread > in Python (at least not in a portable way). The best you can do is > politely ask it to die, IIRC. Inherently, the best you can do in most languages is ask the

100 Tools For Blogging

2008-06-06 Thread GoodieMan
Whether you're a seasoned blogger wanting to increase your blog traffic or a novice looking for advice on where to begin, these resources [ http://100tools4blogs.blogspot.com/ ] can offer great help getting you on the right track. Use them wisely and you can increase your chances of creating a succ

Re: Needing python experts to help with a problem

2008-06-06 Thread John Nagle
CM wrote: On Jun 7, 12:51 am, gms <[EMAIL PROTECTED]> wrote: Hello, I have the following list: [{'count': u'2', 'manu': }, {'count': u'4', 'manu': }, {'count': u'2', 'manu': }, {'count': u'2', 'manu': }] ... This sounds like a homework assignment. If you're having trouble with this, sending

Parsing a path to components

2008-06-06 Thread eliben
Hello, os.path.split returns the head and tail of a path, but what if I want to have all the components ? I could not find a portable way to do this in the standard library, so I've concocted the following function. It uses os.path.split to be portable, at the expense of efficiency. -

Re: Macro like functionality for shorthand variable names

2008-06-06 Thread Kay Schluehr
On 6 Jun., 23:13, Tilman Kispersky <[EMAIL PROTECTED]> wrote: > I have python code in a class method translated from C++ that looks > sort of like this: > > >>> self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) > > To make this more readable in C++ I had made macros to achieve this: > #def

Re: Needing python experts to help with a problem

2008-06-06 Thread CM
On Jun 7, 12:51 am, gms <[EMAIL PROTECTED]> wrote: > Hello, > I have the following list: > > [{'count': u'2', 'manu': }, {'count': u'4', > 'manu': }, {'count': u'2', 'manu': Manu3>}, {'count': u'2', 'manu': }] > > My current list currently contains four dictionaries. They are: > > {'count': u'2',

Re: Do this as a list comprehension?

2008-06-06 Thread Mensanator
On Jun 6, 10:33 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > On Jun 6, 1:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > > > > > > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > >news:[EMAIL PROTECTED] > > |

Re: How to send a POST request?

2008-06-06 Thread subeen
On Jun 7, 6:17 am, "Jeff McNeil" <[EMAIL PROTECTED]> wrote: > The original urllib module will do it too, if you pass a data keyword > argument to urllib.urlopen: > > u = urllib.urlopen('http://www.domain.com/cgi-bin/cgi.py', > data=urllib.urlencode({'name': 'pythonguy'})) > > On Fri, Jun 6, 2008 at

Re: Dynamically naming objects.

2008-06-06 Thread stefaan.himpe
Hello, You can use this as indicated by Hans: u = [user() for i in xrange(5)] where "user" is a class or a function returning an object. u then is a list of "user" objects. or does it somehow work? how would I address them if they all have the name 'u'? You'd access members of the list

Re: Dynamically naming objects.

2008-06-06 Thread Alan Isaac
On Jun 7, 1:20 pm, Hans Nowak [user() for i in range(n)] Kalibr wrote: or does it somehow work? how would I address them if they all have the name 'u'? users = list(User() for i in range(n)) for user in users: user.do_something() hth, Alan Isaac -- http://mail.python.org/mailma

Re: Dynamically naming objects.

2008-06-06 Thread Ben Finney
Kalibr <[EMAIL PROTECTED]> writes: > what I want to do is have, say 5 users in a game, so I'd have to > spawn 5 objects. I can't do that because I have'nt hardcoded any > object names for them. Python's built-in mapping type 'dict' is a good fit for this. Given: * a 'User' class that is initial

Needing python experts to help with a problem

2008-06-06 Thread gms
Hello, I have the following list: [{'count': u'2', 'manu': }, {'count': u'4', 'manu': }, {'count': u'2', 'manu': }, {'count': u'2', 'manu': }] My current list currently contains four dictionaries. They are: {'count': u'2', 'manu': } {'count': u'4', 'manu': } {'count': u'2', 'manu': } {'count':

Professional Grant Proposal Writing Workshop (August 2008: Ann Arbor, Michigan - University of Phoenix Campus)

2008-06-06 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held at the University of Phoenix - Ann Arbor Campus on August 20 - 22, 2008.  Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand m

Re: Dynamically naming objects.

2008-06-06 Thread Kalibr
On Jun 7, 1:20 pm, Hans Nowak <[EMAIL PROTECTED]> wrote: > Kalibr wrote: > > I've been developing a small script to fiddle with classes, and came > > accross the following problem. Assuming I get some user input asking > > for a number, how would I spawn 'n' objects from a class? > > > i.e. I have

Re: ctypes help

2008-06-06 Thread Mark Tolonen
"gianluca" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] hy, I've a huge problem with ctypes. I've compiled my C library and I'd like use it in python with ctype. One function need to pass a pointer to typed ( like this: typedef int value_type). In python I can access to that funt

Re: Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-06 Thread Nir
Can you check another hypothesis? I currently do not have a Python installation to verify this but if my memory does not fail me there is a DLL library somewhere under c: \python25 and _socket might be there as well. Copy any DLLs you find there to the same folder as your embedded interpreter DLL

Re: Dynamically naming objects.

2008-06-06 Thread Paul
Something like this? class User: def __init__(self, name): self.name = name def __str__(self): return self.name n = 10 users = [] for i in range(n): users.append(User('user%d' % i)) print users[9] print users[4] Cheers, Paul On Sat, Jun

Re: Do this as a list comprehension?

2008-06-06 Thread Terry Reedy
"Mensanator" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jun 6, 1:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | On Jun 5, 10:42?pm, John Salerno <[EMAIL PROTECTED]> wrote: > | > Is it possible

Re: Dynamically naming objects.

2008-06-06 Thread Hans Nowak
Kalibr wrote: I've been developing a small script to fiddle with classes, and came accross the following problem. Assuming I get some user input asking for a number, how would I spawn 'n' objects from a class? i.e. I have a class class 'user' and I don't know how many of them I want to spawn. A

Dynamically naming objects.

2008-06-06 Thread Kalibr
I've been developing a small script to fiddle with classes, and came accross the following problem. Assuming I get some user input asking for a number, how would I spawn 'n' objects from a class? i.e. I have a class class 'user' and I don't know how many of them I want to spawn. Any ideas? -- htt

need really help

2008-06-06 Thread Golu
respected please help me i am really need of money please pay me through donation from my site. http://www.computersolution.co.cc i will be very thankful to you . please donate atleast 5$ or 2$ through my site http://www.computersolution.co.cc hope i will be able to clear my debts because of you al

Re: Do this as a list comprehension?

2008-06-06 Thread Mensanator
On Jun 6, 1:40 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > On Thu, 05 Jun 2008 23:42:07 -0400, John Salerno wrote: > > Is it possible to write a list comprehension for this so as to produce a > > list of two-item tuples? > > > base_scores = range(8, 19) > > score_costs = [0, 1, 1, 1, 1, 1, 1, 2

Re: Do this as a list comprehension?

2008-06-06 Thread Mensanator
On Jun 6, 3:19 pm, "John Salerno" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > On Jun 6, 1:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > And since the OP foolishly > hardcode

Re: How to send a POST request?

2008-06-06 Thread Jeff McNeil
The original urllib module will do it too, if you pass a data keyword argument to urllib.urlopen: u = urllib.urlopen('http://www.domain.com/cgi-bin/cgi.py', data=urllib.urlencode({'name': 'pythonguy'})) On Fri, Jun 6, 2008 at 6:04 PM, kj <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]> kj <[E

Re: Python is slow

2008-06-06 Thread Jan Claeys
Op Fri, 23 May 2008 14:00:33 -0700, schreef [EMAIL PROTECTED]: > Now this I can tell is false. The problem is not that it's difficult to > "make a native compiler for" dynamic languages, the problem is that it's > difficult to write native compiler for dynamic languages that generates > code that

Re: File-writing not working in Windows?

2008-06-06 Thread John Machin
On Jun 7, 1:18 am, [EMAIL PROTECTED] wrote: > All, > [code snipped] > > This code works PERFECTLY in Linux. Where I have a match in the file > I'm processing, it gets cut out from the start of the match until the > end of the match, and written to the temporary file in tempdir. > > It does not w

Re: readline() & seek() ???

2008-06-06 Thread Kam-Hung Soh
Chris wrote: On Jun 6, 5:13 am, Kam-Hung Soh <[EMAIL PROTECTED]> wrote: Tim Roberts wrote: DataSmash <[EMAIL PROTECTED]> wrote: I have a text file that contains thousands of lines and each line is 256 characters long. This is my task: For each line in the file, move to the 25th character, if t

Re: how to build a street with more than 1 house ?

2008-06-06 Thread Tommy Grav
On Jun 6, 2008, at 6:45 PM, Stef Mientki wrote: hello, In the code below, I can build a large street like this: large_street = house * 25 but not a small street. like this: small_street = 5 * house This calls the int.__mul__() code i believe. Why is this different ? And more interesting, h

Re: Newbie question, list comprehension

2008-06-06 Thread Johannes Bauer
Hans Nowak schrieb: In this case, you can just use a slice, as localtime is a tuple: fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % localtime[:6] Hope this helps! ^_^ Ahh, how cool! That's *exactly* what I meant with "awesome Python magic" :-) Amazing language, I have to admit. Regards, J

how to build a street with more than 1 house ?

2008-06-06 Thread Stef Mientki
hello, In the code below, I can build a large street like this: large_street = house * 25 but not a small street. like this: small_street = 5 * house Why is this different ? And more interesting, how do I get the right results ? thanks, Stef Mientki class type_house ( object ) : def __init_

Re: Change in interactive interpreter?

2008-06-06 Thread The Pythonista
On Fri, 06 Jun 2008 11:36:13 -0700, Gary Herron wrote: > Try again. I think you'll find it's still there -- although you have to > execute a something that returns a value before it's set for the first > time. That was, indeed the problem. Boy do I feel silly now. :-) Thanks -- code.py: A

Re: Newbie question, list comprehension

2008-06-06 Thread Hans Nowak
Johannes Bauer wrote: Hello group, I'm currently doing something like this: import time localtime = time.localtime(1234567890) fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % (localtime[0], localtime[1], localtime[2], localtime[3], localtime[4], localtime[5]) print fmttime For the third line the

Re: How to send a POST request?

2008-06-06 Thread kj
In <[EMAIL PROTECTED]> kj <[EMAIL PROTECTED]> writes: >Hi. Sorry for this very clueless question, but how does one write >in Python an HTTP client that can send a POST request? The modules >I've found (e.g. urllib, urllib2), as far as I can tell, seem to >be limited to GET requests. (I could be

Newbie question, list comprehension

2008-06-06 Thread Johannes Bauer
Hello group, I'm currently doing something like this: import time localtime = time.localtime(1234567890) fmttime = "%04d-%02d-%02d %02d:%02d:%02d" % (localtime[0], localtime[1], localtime[2], localtime[3], localtime[4], localtime[5]) print fmttime For the third line there is, I suppose, some

How to send a POST request?

2008-06-06 Thread kj
Hi. Sorry for this very clueless question, but how does one write in Python an HTTP client that can send a POST request? The modules I've found (e.g. urllib, urllib2), as far as I can tell, seem to be limited to GET requests. (I could be wrong though; please correct me if this is so.) TIA!

Re: Learning which modules were loaded

2008-06-06 Thread Gary Herron
James Stroud wrote: I am rolling up a distribution of a program I wrote. It uses matplotlib with tkagg so the bundle is HUGE (47 MB, 14 MB after bz compression). Is there any way to run the program, put it through all of its paces, and then inspect which modules were loaded. I would like to ga

Learning which modules were loaded

2008-06-06 Thread James Stroud
I am rolling up a distribution of a program I wrote. It uses matplotlib with tkagg so the bundle is HUGE (47 MB, 14 MB after bz compression). Is there any way to run the program, put it through all of its paces, and then inspect which modules were loaded. I would like to gather these in a list

Re: Q about object identity

2008-06-06 Thread Tommy Grav
On Jun 6, 2008, at 4:27 PM, Ethan Furman wrote: [EMAIL PROTECTED] wrote: Hello, I am testing object identity. If I do it from the interpreter, I get strange results. *print [] is []* *False* print id([]), id([]) 3083942700 3083942700 Why is that? Isn't this an error? in the first stateme

Macro like functionality for shorthand variable names

2008-06-06 Thread Tilman Kispersky
I have python code in a class method translated from C++ that looks sort of like this: >>> self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) To make this more readable in C++ I had made macros to achieve this: #define du (dydt[1]) #define u (y[1]) #define V (y[0]) du = a * (b * V - u);

Re: Q about object identity

2008-06-06 Thread Ethan Furman
[EMAIL PROTECTED] wrote: Hello, I am testing object identity. If I do it from the interpreter, I get strange results. *print [] is []* *False* print id([]), id([]) 3083942700 3083942700 Why is that? Isn't this an error? If I test it in a script, all is OK. #!/usr/bin/python a =

Re: Guide to organizing modules?

2008-06-06 Thread Casey McGinty
> > Yes, in the above post I meant to say package where I said module. > Right now all my functions are in the __init__.py script, and I would > consider separating them out into sub-packages, if it had any rhyme or > reason, but right now that escapes me. That's mostly what I'm trying > to ask for

[ANN] Dramatis 0.1.1 released

2008-06-06 Thread Steven Parkes
The first alpha release of dramatis hit the streets today. dramatis is a library available in Python and Ruby used to write concurrent programs based on the actor model of concurrency. The dramatis web site is http://dramatis.mischance.net The release is available as a python distutils package a

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Casey McGinty
On Thu, Jun 5, 2008 at 11:39 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > If you want to access the attribute of a particular class, to read or > write, use that class. > SomeClass.attr > Note that no instance is required or relevant. > > If you want to read the attrubute of the class of an in

Re: File-writing not working in Windows?

2008-06-06 Thread jay graves
On Jun 6, 3:19 pm, [EMAIL PROTECTED] wrote: > This did not make a difference in my script. However, I did what you > suggested, and tried the simple script it Windows, and it works as it > should. > (It's really annoying because it works on the Mac and Linux! (I just > tested my script on the Mac

Re: Do this as a list comprehension?

2008-06-06 Thread John Salerno
"Mensanator" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Jun 6, 1:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message And since the OP foolishly hardcoded his range bounds Hmm, I just love the arrogance of some people. I actually

Re: File-writing not working in Windows?

2008-06-06 Thread tdahsu
On Jun 6, 2:58 pm, jay graves <[EMAIL PROTECTED]> wrote: > On Jun 6, 1:22 pm, [EMAIL PROTECTED] wrote: > > > I am thinking that the "g.open(tempFileName, 'a')" command is the > > issue.  Is there anything different about opening a file in Windows? > > Does Windows understand "append", or would I ha

Trying to install mysql lib for python

2008-06-06 Thread [EMAIL PROTECTED]
Hi How do I install mysql db libray for python? I went to source forg and downloaded the following zip folder MySQL_python-1.2.2-py2.4-win32 I open the folder and looked inside did not see any directions. Help -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question : library versus normal python files

2008-06-06 Thread [EMAIL PROTECTED]
On 6 juin, 19:36, रवींदर ठाकुर (ravinder thakur) <[EMAIL PROTECTED]> wrote: > hello friends, > > i have a python library(rdflib) that i am using in some project using > Google App Engine. I have developed everything using this on my local > machine and things work fine. But in my final deployment,

Re: Assigning to __class__ : bad form?

2008-06-06 Thread [EMAIL PROTECTED]
On 6 juin, 19:51, The Pythonista <[EMAIL PROTECTED]> wrote: > I've been wondering for a while about whether assigning to __class__ is > bad form or not. Specifically, I mean doing so when some other method of > implementing the functionality you're after is available (i.e. using an > adapter, or s

Re: File-writing not working in Windows?

2008-06-06 Thread jay graves
On Jun 6, 1:22 pm, [EMAIL PROTECTED] wrote: > I am thinking that the "g.open(tempFileName, 'a')" command is the > issue. Is there anything different about opening a file in Windows? > Does Windows understand "append", or would I have to do control checks > for seeing if the file is created and the

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:28 am, Bruno Desthuilliers wrote: > Russ P. a écrit : > > > > > On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." > >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > >>> would need to use a "man

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:25 am, Bruno Desthuilliers wrote: > >>> I also realize, by the way, that Python allows a client of a class to > >>> define a new class member from completely outside the class > >>> definition. Obviously, that cannot be declared private. > >> Why so ? > > > Why should the client of a

Re: How to kill a thread?

2008-06-06 Thread The Pythonista
It's always been my understanding that you can't forcibly kill a thread in Python (at least not in a portable way). The best you can do is politely ask it to die, IIRC. -- code.py: A blog about life, the universe, and Python http://pythonista.wordpress.com ** Posted from http://www.teranews.c

Re: Do this as a list comprehension?

2008-06-06 Thread The Pythonista
On Thu, 05 Jun 2008 23:42:07 -0400, John Salerno wrote: > Is it possible to write a list comprehension for this so as to produce a > list of two-item tuples? > > base_scores = range(8, 19) > score_costs = [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3] print zip(base_scores, > score_costs) > score_costs = [(

Re: Change in interactive interpreter?

2008-06-06 Thread Gary Herron
The Pythonista wrote: I remember the interactive interpreter used to define the name _ to return the value of the last expression that was evaluated. However, I tried it just today and got a NameError. Is this a change in the interpreter or is there a configuration option I need to set to ena

Re: Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-06 Thread Chris8Boyd
On Jun 6, 11:25 am, [EMAIL PROTECTED] wrote: > On Jun 6, 1:13 am, Nir <[EMAIL PROTECTED]> wrote: > > > > > You seem to be having a problem with the import path of the embedded > > interpreter. I suppose the embedded interpreter includes some modules > > in a particular folder and _socket is not one

Change in interactive interpreter?

2008-06-06 Thread The Pythonista
I remember the interactive interpreter used to define the name _ to return the value of the last expression that was evaluated. However, I tried it just today and got a NameError. Is this a change in the interpreter or is there a configuration option I need to set to enable it? Thanks! -- c

Re: Cannot use Winpdb (or PyDev) to trace embedded Python script in MSVC++ application - ImportError: No module named _socket

2008-06-06 Thread Chris8Boyd
On Jun 6, 1:13 am, Nir <[EMAIL PROTECTED]> wrote: > You seem to be having a problem with the import path of the embedded > interpreter. I suppose the embedded interpreter includes some modules > in a particular folder and _socket is not one of them. For the sake of > debugging try adding the c:\pyt

Re: File-writing not working in Windows?

2008-06-06 Thread tdahsu
On Jun 6, 11:35 am, jay graves <[EMAIL PROTECTED]> wrote: > On Jun 6, 10:18 am, [EMAIL PROTECTED] wrote: > > > > This code works PERFECTLY in Linux.  Where I have a match in the file > > I'm processing, it gets cut out from the start of the match until the > > end of the match, and written to the

My company provide most popular of the shoes model, bag, clothes, Bikini swimwear, sunglasses and watch of etc..

2008-06-06 Thread hongfeng13
hello ! ! !welcome to visit our website http://www.nikeadishoes.com Our main products : shoes Hoodies T-Shirt Jeans Jacket bags Electronic and so on we can supply many popular shoes model,bag,clothes ,bikini,sunglass and watch and so on. We can give you products with good quality and reasonable

My company provide most popular of the shoes model, bag, clothes, Bikini swimwear, sunglasses and watch of etc..

2008-06-06 Thread hongfeng13
hello ! ! !welcome to visit our website http://www.nikeadishoes.com Our main products : shoes Hoodies T-Shirt Jeans Jacket bags Electronic and so on we can supply many popular shoes model,bag,clothes ,bikini,sunglass and watch and so on. We can give you products with good quality and reasonable

Assigning to __class__ : bad form?

2008-06-06 Thread The Pythonista
I've been wondering for a while about whether assigning to __class__ is bad form or not. Specifically, I mean doing so when some other method of implementing the functionality you're after is available (i.e. using an adapter, or something like the strategy pattern). To give an example and a no

Re: Do this as a list comprehension?

2008-06-06 Thread Mensanator
On Jun 6, 1:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Mensanator" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | On Jun 5, 10:42?pm, John Salerno <[EMAIL PROTECTED]> wrote: > | > Is it possible to write a list comprehension for this so as to produce > a > | > list of t

Where to find Visual Studio Syntax Highlighting (for python)?

2008-06-06 Thread Robert Dailey
Hi, Does anyone know of a way to get syntax coloring working in Visual Studio 2008 for Python? I did some googling but I couldn't find anything. Help is appreciated, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Do this as a list comprehension?

2008-06-06 Thread John Salerno
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Mensanator" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > Which is exactly the purpose of zip, or its specialization enumerate! Thanks guys! Looks like the simplest is always the best yet again! :)

noob question : library versus normal python files

2008-06-06 Thread ravinder thakur
hello friends, i have a python library(rdflib) that i am using in some project using Google App Engine. I have developed everything using this on my local machine and things work fine. But in my final deployment, i have to use it in source code form rather than in library form. If i remove the li

ctypes help

2008-06-06 Thread gianluca
hy, I've a huge problem with ctypes. I've compiled my C library and I'd like use it in python with ctype. One function need to pass a pointer to typed ( like this: typedef int value_type). In python I can access to that funtion but arise an exception because python don't know my value_type typedef

Re: lots of futex_wait calls

2008-06-06 Thread André Malo
skunkwerk wrote: > I've got a python program written for the django web framework that > starts about 100 threads. When I start the server, it sometimes eats > up 100% of the CPU for a good minute or so... though none of the > threads are CPU-intensive > > doing a strace on the program, i found

Re: How to remove read-only from a file

2008-06-06 Thread Robert Dailey
On Fri, Jun 6, 2008 at 11:05 AM, Tim Golden <[EMAIL PROTECTED]> wrote: > Robert Dailey wrote: > >> Hi, >> >> Using Python 3.0, how can I remove a read-only property from a file in >> Windows XP? Thanks. >> > > import os > import stat > > os.chmod ("c:/temp/temp.txt", stat.S_IWRITE) > > (Haven't ac

The best sexy video and photo!!!

2008-06-06 Thread sexy18
http://rozrywka.yeba.pl/show.php?id=2737 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill a thread?

2008-06-06 Thread Diez B. Roggisch
Laszlo Nagy schrieb: def run(self): while True: if exit_event.isSet(): # Thread exiting return try: data = q_in.get(timeout =

lots of futex_wait calls

2008-06-06 Thread skunkwerk
I've got a python program written for the django web framework that starts about 100 threads. When I start the server, it sometimes eats up 100% of the CPU for a good minute or so... though none of the threads are CPU-intensive doing a strace on the program, i found lots of calls like this: sele

SWIG -- Passing python proxy class instance to python callback

2008-06-06 Thread Keith Sabine
Hi Did you ever find a solution to this? I am having the exact same problem... - Keith I'm trying to pass a proxy class instance (SWIG generated) of CClass, to a python callback function from C++. The proxy class instance of CClass is created from a pointer to the C++ class CClass. Using the

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: > Larry Bates wrote: > > Gabriel Rossetti wrote: > >> Hello everyone, > >> > >> I had read somewhere that it is preferred to use > >> self.__class__.attribute over ClassName.attribute to access class > >> (aka static) a

Re: Image Processing (batch)

2008-06-06 Thread Ivan Illarionov
On Thu, 05 Jun 2008 07:10:56 +, Tim Roberts wrote: > Thomas Guettler <[EMAIL PROTECTED]> wrote: >> >>I tried PIL for image batch processing. But somehow I don't like it >> - Font-Selection: You need to give the name of the font file. - >> Drawing on an image needs a different object that pas

Re: How to remove read-only from a file

2008-06-06 Thread Tim Golden
Robert Dailey wrote: Hi, Using Python 3.0, how can I remove a read-only property from a file in Windows XP? Thanks. import os import stat os.chmod ("c:/temp/temp.txt", stat.S_IWRITE) (Haven't actually checked that on Python 3.0 but I don't believe it's changed...) TJG -- http://mail.python.

How to remove read-only from a file

2008-06-06 Thread Robert Dailey
Hi, Using Python 3.0, how can I remove a read-only property from a file in Windows XP? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: File-writing not working in Windows?

2008-06-06 Thread jay graves
On Jun 6, 10:18 am, [EMAIL PROTECTED] wrote: > This code works PERFECTLY in Linux. Where I have a match in the file > I'm processing, it gets cut out from the start of the match until the > end of the match, and written to the temporary file in tempdir. > It does not work in Windows. It does not

Re: cgi, parse_header and semi-colon

2008-06-06 Thread Richard Brodie
"Sylvain" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") : > cgi.FieldStorage.filename returns only "my" everything after the semi- > colon is missing > > Is it a bug or i'm missing something ? I doubt it's bug in par

Re: Newb question: underscore

2008-06-06 Thread Bruno Desthuilliers
John Fabiani a écrit : Skye wrote: What is this doing? print >> fd, _(__doc__) I'm guessing line-splitting __doc__ into a list, but what's that leading underscore do? Thanks! I think it is standard practice to use the underscore for unicode converts. Actually, it's for i18n, not for

Re: Newb question: underscore

2008-06-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : My question is: Why would anyone decide to obfuscate something as easy to read as Python??? They didn't decide to obfuscate; they decided to follow a strongly-expected convention for the name of that function by existing users of the 'gettext' functionality, in contex

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 5, 2:27 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), "Russ P." <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: would need to use a "mangled" name to access private data or methods. But you will be using the

Re: parser recommendation

2008-06-06 Thread Kay Schluehr
On 6 Jun., 01:58, Alan Isaac <[EMAIL PROTECTED]> wrote: > One other possibility: > SimpleParse (for speed). > http://simpleparse.sourceforge.net/> > It is very nice. > Alan Isaac How does SimpleParse manage left-factorings, left-recursion and other ambiguities? For example according to [1] there

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 5, 4:53 am, Bruno Desthuilliers wrote: Russ P. a écrit : Given your very recent discovery of what 'dynamic' *really* means in Python (like, for exemple, dynamically adding / replacing attributes - including methods - on a per-class or per-instance basis), possibly, y

File-writing not working in Windows?

2008-06-06 Thread tdahsu
All, I have the following code: for fileTarget in dircache.listdir("directory"): (dirName, fileName) = os.path.split(fileTarget) f = open(fileTarget).readlines() copying = False for i in range(len(f)): f

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Bruno Desthuilliers
Russ P. a écrit : On Jun 4, 4:29 am, NickC <[EMAIL PROTECTED]> wrote: On Jun 4, 4:09 am, "Russ P." <[EMAIL PROTECTED]> wrote: What is it about leading underscores that bothers me? To me, they are like a small pebble in your shoe while you are on a hike. Yes, you can live with it, and it does n

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Bruno Desthuilliers
Gabriel Rossetti a écrit : Larry Bates wrote: Gabriel Rossetti wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work, until I subclassed a class

Re: ClassName.attribute vs self.__class__.attribute

2008-06-06 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: On 5 juin, 17:40, Gabriel Rossetti <[EMAIL PROTECTED]> wrote: Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. It

Re: Partial download with ftplib and retrbinary

2008-06-06 Thread Giampaolo Rodola'
On 24 Mag, 12:53, [EMAIL PROTECTED] wrote: > I am breaking/interrupting my connection with theftpserver at > present when doing a partial download of a file. I have a callback > with retrbinary that raises an exception and ends the download. The > problem is that the server is not notified and hang

Re: Proof that \ is a better line joiner than parenthetical sets

2008-06-06 Thread Jordan Greenberg
Joshua Kugler wrote: "Beautiful is better than ugly." And I think putting parenthesis around a multi-line statement is much prettier. So there! :) j And PEP 8 agrees with you. Another vote for parens. -Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: creating yaml without tags using pyyaml

2008-06-06 Thread Stephen Moore
On Fri, Jun 6, 2008 at 8:20 PM, Kirill Simonov <[EMAIL PROTECTED]> wrote: > Stephen Moore wrote: >> >> I have come to the conclusion that this is the fault of the tags (for >> example, !!python/tuple) as getting rid of them gets rid of the >> errors. >> >> So I'm wondering if there is an option to

Re: How to kill a thread?

2008-06-06 Thread Laszlo Nagy
def run(self): while True: if exit_event.isSet(): # Thread exiting return try: data = q_in.get(timeout = .5)

cgi, parse_header and semi-colon

2008-06-06 Thread Sylvain
Hi, I'm playing with Google App Engine and during my tests it seems that there is a bug in cgi. parse_header function. If we upload a file with a semi-colon (i.e : "C:/my;file.jpg") : cgi.FieldStorage.filename returns only "my" everything after the semi- colon is missing Is it a bug or i'm missi

Re: configure fails

2008-06-06 Thread A.T.Hofkamp
On 2008-06-05, Mathieu Prevot <[EMAIL PROTECTED]> wrote: > I have the following error on a OSX.5 OS with CC=icc and using the > python-svn files: > > checking size of wchar_t... configure: error: cannot compute sizeof (wchar_t) > > I would like to help so we can compile python with icc/OSX. This l

Re: Python CGI Upload from Server Status

2008-06-06 Thread Derek Tracy
On Fri, Jun 6, 2008 at 9:16 AM, John Dohn <[EMAIL PROTECTED]> wrote: > On Sat, Jun 7, 2008 at 12:50 AM, Derek Tracy <[EMAIL PROTECTED]> wrote: > >> I am trying to create a simple python cgi app that allows the user to kick >> off an ftp from the server the cgi is on to another server; I have that

Re: Python CGI Upload from Server Status

2008-06-06 Thread John Dohn
On Sat, Jun 7, 2008 at 12:50 AM, Derek Tracy <[EMAIL PROTECTED]> wrote: > I am trying to create a simple python cgi app that allows the user to kick > off an ftp from the server the cgi is on to another server; I have that > piece working using ftplib but since the files in question are usually ve

Re: BZip2 decompression and parsing XML

2008-06-06 Thread Stefan Behnel
phasma wrote: > xml.parsers.expat.ExpatError: not well-formed (invalid token): line > 538676, column 17 Looks like your XML file is broken in line 538676. > try: > handler = open(args[0], "r") This should read handler = open(args[0], "rb") Maybe t

BZip2 decompression and parsing XML

2008-06-06 Thread phasma
Hi. I'm trying to disassemble bzipped file. If I use minidom.parseString, I'm getting this error: Traceback (most recent call last): File "./replications.py", line 342, in ? File "/usr/lib64/python2.4/xml/dom/minidom.py", line 1925, in parseString return expatbuilder.parseString(string)

Re: creating yaml without tags using pyyaml

2008-06-06 Thread Kirill Simonov
Stephen Moore wrote: I have come to the conclusion that this is the fault of the tags (for example, !!python/tuple) as getting rid of them gets rid of the errors. So I'm wondering if there is an option to YAML.decode that will create a yaml document without the tags? Try yaml.safe_dump(). >>>

  1   2   >