regular expressions an text string

2008-04-17 Thread ragia
hi i have to match text string char by char to a regular expressions tht just allow digits 0-9 if other thing a ppear it shall be replaced with space.how can i do that any help? so far i have the string and can read it using a for loop...but how to match each char with the regular expressions and

Re: I just killed GIL!!!

2008-04-17 Thread Matias Surdi
It's april 1st again??? sturlamolden escribió: > Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit and and ma

Re: regular expressions an text string

2008-04-17 Thread Peter Otten
ragia wrote: > i have to match text string char by char to a regular expressions tht > just allow digits 0-9 if other thing a ppear it shall be replaced with > space.how can i do that any help? >>> import re >>> s = "abc123_45!6$" >>> re.sub(r"\D", " ", s) ' 123 45 6 ' Peter -- http://mail.p

Re: regular expressions an text string

2008-04-17 Thread s0suk3
On Apr 17, 2:09 am, ragia <[EMAIL PROTECTED]> wrote: > hi > i have to match text string char by char to a regular expressions tht > just allow digits 0-9 if other thing a ppear it shall be replaced with > space.how can i do that any help? > so far i have the string and can read it using a for loop

Re: I just killed GIL!!!

2008-04-17 Thread Jonathan Gardner
On Apr 16, 5:37 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > One single process of CPython is using all the cpu power > of my dual-core laptop. Are they stuck in a while loop, waiting for their resource to become available? Using 100% of the CPU is a bug, not a feature. If you can't rewrite your

Re: sampling without replacement

2008-04-17 Thread Paul Rubin
braver <[EMAIL PROTECTED]> writes: > Using an array is natural here as it represents "without replacement" > -- we take an element by removing it from the array. But in Python > it's very slow... What approaches are there to implement a shrinking > array with random deletions with the magnitude

Re: I just killed GIL!!!

2008-04-17 Thread Steve Holden
sturlamolden wrote: > Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit and and marvel at my creation for a whi

Re: I just killed GIL!!!

2008-04-17 Thread Carl Banks
On Apr 17, 3:37 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > Using 100% of the CPU is a bug, not a feature. No it isn't. That idea is borne of the narrowmindedness of people who write server-like network apps. What's true for web servers isn't true for every application. > If you can't re

Re: I just killed GIL!!!

2008-04-17 Thread Martin v. Löwis
> For the record, I am not complaining about that GIL. As I said, I > understand and approve of why it's there. I am, however, complaining > about attitude that if you want to be free of the GIL you're doing > something wrong. If you _want_ to be free of the GIL, you are not _doing_ anything, an

Newbie question about for...in range() structure

2008-04-17 Thread [EMAIL PROTECTED]
Hi there, I'm new to Python and I've been writing a rudimentary exercise in Deitel's Python: How to Program, and I found that this code exhibits a weird behavior. When I run the script, the for...range(1,11) structure always starts with zero--and I've tried plugging other values as well! >From the

Re: Profiling, recursive func slower than imperative, normal?

2008-04-17 Thread Robert Bossy
Gabriel Genellina wrote: > En Wed, 16 Apr 2008 17:53:16 -0300, <[EMAIL PROTECTED]> escribió: > > >> On Apr 16, 3:27 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: >> >> >>> Any function can be implemented without recursion, although it isn't >>> always easy or fun. >>> >>> >> Rea

Fwd: is file open in system ? - other than lsof

2008-04-17 Thread bvidinli
Here is (hope) complete info for my question: i use linux/unix i use python 2.3 my subject is a single file at a time. but i have to check thousands of files in a loop. so, since there is thousands of files to process, i dont want to use like os.system('lsof filename') because lsof is slow regardi

Re: Newbie question about for...in range() structure

2008-04-17 Thread Paul McGuire
On Apr 17, 3:30 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > def fact(n): >         total = 0 >         n = int(n) >         while n > 0: >                 total *= n >                 n -=1 >         return total > My guess is that you want to initialize total to 1, not 0. -- Paul -- ht

Re: py3k s***s

2008-04-17 Thread Sverker Nilsson
On Apr 17, 12:02 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Apr 16, 12:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > On Apr 16, 12:27 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Apr 16, 6:56 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > I don't get it. It ain't

Re: py3k s***s

2008-04-17 Thread Sverker Nilsson
On Apr 17, 12:02 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Apr 16, 12:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > On Apr 16, 12:27 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > On Apr 16, 6:56 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > I don't get it. It ain't

Re: def power, problem when raising power to decimals

2008-04-17 Thread skanemupp
actually that 0**0 statement was wrong. 0**0 = 1 and should be. -- http://mail.python.org/mailman/listinfo/python-list

Re: I just killed GIL!!!

2008-04-17 Thread Marco Mariani
Torsten Bronger wrote: >>> If I were you I would keep it a secret until a Hollywood producer >>> offers big bucks for the film rights. >> Who would play Guido, I wonder? > > Ralf Möller. No other. And the GIL killer? Clive Owen, Matt Damon, Mark Wahlberg? -- http://mail.python.org/mailman/lis

about a head line

2008-04-17 Thread Penny Y.
I saw some scripts have a line at its begin: # encoding:gb2312 what's this? Why need it? thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: def power, problem when raising power to decimals

2008-04-17 Thread colas . francis
On 17 avr, 00:49, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 16 Apr 2008 19:21:18 -0300, John Machin <[EMAIL PROTECTED]> > escribió: > > > [EMAIL PROTECTED] wrote: > >> also i found a link which states 0^0 isnt 1 even though every > >> calculator ive tried says it is. > >> it doesnt s

Re: about a head line

2008-04-17 Thread Dikkie Dik
Penny Y. wrote: > I saw some scripts have a line at its begin: > > # encoding:gb2312 > > what's this? Why need it? thanks. > My guess is that it is the automatic work of some sort of editor that does not understand how encodings work. See what happens if the file was utf-16le encoded, for exam

Re: about a head line

2008-04-17 Thread Fivesheep
On Apr 17, 5:54 pm, "Penny Y." <[EMAIL PROTECTED]> wrote: > I saw some scripts have a line at its begin: > > # encoding:gb2312 > > what's this? Why need it? thanks. declaring of the encoding used in the source file. it's like in html take gb2312 as an example. you will need it if you have some

Re: I just killed GIL!!!

2008-04-17 Thread Chris
On Apr 17, 11:49 am, Marco Mariani <[EMAIL PROTECTED]> wrote: > Torsten Bronger wrote: > >>> If I were you I would keep it a secret until a Hollywood producer > >>> offers big bucks for the film rights. > >> Who would play Guido, I wonder? > > > Ralf Möller.  No other. > > And the GIL killer? > > C

New youtube video

2008-04-17 Thread kkkk
New youtube video http://www.youtube.com/watch?v=tWxFZRgh664 http://www.youtube.com/watch?v=K20FaUQpCEk http://www.youtube.com/watch?v=sSutNlV4Tq0 http://www.youtube.com/watch?v=1P8wqWC7ISE http://www.youtube.com/watch?v=wS1hPZiuXnk http://www.youtube.com/watch?v=wgkDtlod8Wg http://www.you

Re: about a head line

2008-04-17 Thread Soltys
Penny Y. pisze: > I saw some scripts have a line at its begin: > > # encoding:gb2312 > > what's this? Why need it? thanks. > Have a look at PEP-0263 (http://www.python.org/dev/peps/pep-0263/) -- http://mail.python.org/mailman/listinfo/python-list

Re: py3k s***s

2008-04-17 Thread Paul Boddie
On 16 Apr, 15:16, Marco Mariani <[EMAIL PROTECTED]> wrote: > > Do you mean Ruby's track in providing backward compatibility is better > than Python's? > > Googling for that a bit, I would reckon otherwise. So would I, but then it isn't the Ruby developers that are *promising* to break backward com

Re: py3k s***s

2008-04-17 Thread Carl Banks
On Apr 17, 4:41 am, Sverker Nilsson <[EMAIL PROTECTED]> wrote: > On Apr 17, 12:02 am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Apr 16, 12:40 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > On Apr 16, 12:27 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Apr 16, 6:56 am, Aar

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 04:27, andrew cooke <[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for the help a couple of days ago. I completed what I was > doing and wrote a summary which I've posted > athttp://acooke.org/cute/PythonMeta0.html > (it's kind of long to post here). I hope it might be useful to > someon

Re: Python module for reading FilePro files?

2008-04-17 Thread M.-A. Lemburg
On 2008-04-16 15:53, Steve Bergman wrote: > Does anyone know of a Python package or module to read data files from > the venerable old Filepro crossplatform database/IDE? No, but there is Filepro support in PHP, so you could write a PHP script which reads the data and then exports it to some other

#####SOUTH INDIAN SEX GIRLS SEX######

2008-04-17 Thread sumoee
http://rajtrytry.dubaimlm.com free Register On $ 100 Free dubai companey Relised Paymend free join form free free 100 dollors free 4days only http://rajtrytry.dubaimlm.com http://rajtrytry.dubaimlm.com http://rajtrytry.dubaimlm.com http://rajtrytry.dubaimlm.com se SEX SEX

Re: Learning Tkinter

2008-04-17 Thread Eric Brunel
On Wed, 16 Apr 2008 14:46:13 +0200, Doran, Harold <[EMAIL PROTECTED]> wrote: [snip] > Second, I am trying to work through a couple of the examples and make > some small tweaks as I go to see how new things can work. In the first > case, I have copied the code in the book to see how the menu works a

Re: Metaprogramming Example

2008-04-17 Thread andrew cooke
On Apr 17, 7:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: [...] Thanks very much! These are useful pointers. I'll update my code accordingly. At one point you pointed out I didn't need parentheses and I agree - I was using them to avoid having a line continuation backslash (I think I r

Learn Python in easy steps... free!!!

2008-04-17 Thread GoodieMan
Learn Python in very easy steps!!! visit the site. Excellent!!! http://freeware4.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

PHATCH: PHoto bATCH processor with EXIF and IPTC support for all platforms

2008-04-17 Thread SPE - Stani's Python Editor
Phatch is a simple to use cross-platform GUI Photo Batch Processor Phatch handles all popular image formats and can duplicate (sub)folder hierarchies. It can batch resize, rotate, apply perspective, shadows, rounded corners, ... and more in minutes instead of hours or days if you do it manually. P

Re: Python and stale file handles

2008-04-17 Thread bockman
On 17 Apr, 04:22, tgiles <[EMAIL PROTECTED]> wrote: > Hi, All! > > I started back programming Python again after a hiatus of several > years and run into a sticky problem that I can't seem to fix, > regardless of how hard I try- it it starts with tailing a log file. > > Basically, I'm trying to tai

Boa: howto make child windows really child

2008-04-17 Thread bvidinli
i just started using Boa constructor, but, i dont like child windows floatin,g on my desktop. how can i make all child windows of boa all together, docked in one parent boa window... i found in preferences, general, childFrameStyle, i set it to wx.FRAME_FLOAT_ON_PARENT|wx.FRAME_TOOL_WINDOW but, i

Calling Java Class from python

2008-04-17 Thread Good Z
All, We have developed a website in python and we need to integrate few features of third party website. They have provided us Base64EncoderDecoder Java Class and would like us to use it to encode the data before sending it to their site and decode it when received anything from their site. I

Re: Metaprogramming Example

2008-04-17 Thread Paul McGuire
On Apr 17, 7:25 am, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > One other question.  I had "foo is False" and you said I need > equality, which is a good point.  However, in any other language "not > foo" would be preferable.  I wa

Re: Python and stale file handles

2008-04-17 Thread colas . francis
On 17 avr, 14:43, [EMAIL PROTECTED] wrote: > On 17 Apr, 04:22, tgiles <[EMAIL PROTECTED]> wrote: > > > > > Hi, All! > > > I started back programming Python again after a hiatus of several > > years and run into a sticky problem that I can't seem to fix, > > regardless of how hard I try- it it start

Re: I just killed GIL!!!

2008-04-17 Thread Martin P. Hellwig
sturlamolden wrote: You killed the GIL, you bastard! :-) > Hello Guys... > > I just had one moment of exceptional clarity, during which realized > how I could get the GIL out of my way... It's so simple, I cannot help > wondering why nobody has thought of it before. Duh! Now I am going to > sit

Re: import hooks

2008-04-17 Thread Patrick Stinson
Right on, that seemed to work, thanks. This is different than sys.path_hooks though, which requires a callable or string subclass? After some experimentation it looks like you can disallow an import by raising an import error from your meta_path hook. It seems a little weird that python will then

Re: Calling Java Class from python

2008-04-17 Thread Ben Kaplan
If you need to explicitly call a method and get the results, AFAIK, the only way to do it is to use Jython, a version of Python written in java. If you can do everything you need from the command line, then you can just use subprocess.Popen to run it. Here is the article on how to run java files

Re: def power, problem when raising power to decimals

2008-04-17 Thread Mark Dickinson
On Apr 16, 11:03 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > | decimal.InvalidOperation: 0 ** 0 > > I would think of this as a bug unless the standard Decimal follows demands > this. It does. From http://www2.hursley.ibm.com/decimal/daops.html#refpower : "If both operands are zero, or if the

Re: I just killed GIL!!!

2008-04-17 Thread Steve Holden
Martin v. Löwis wrote: >> For the record, I am not complaining about that GIL. As I said, I >> understand and approve of why it's there. I am, however, complaining >> about attitude that if you want to be free of the GIL you're doing >> something wrong. > > If you _want_ to be free of the GIL, y

Re: [Python-Dev] Global Python Sprint Weekends: May 10th-11th and June 21st-22nd.

2008-04-17 Thread Tarek Ziadé
On Wed, Apr 16, 2008 at 8:40 PM, Michael Foord <[EMAIL PROTECTED]> wrote: > Trent Nelson wrote: > > Following on from the success of previous sprint/bugfix weekends and > > sprinting efforts at PyCon 2008, I'd like to propose the next two > > Global Python Sprint Weekends take place

***CABONGA***

2008-04-17 Thread ferrarinikap
CABONGA*** Listen the amazing Cabong's song!!! http://lacabonga.splinder.com/ -- http://mail.python.org/mailman/listinfo/python-list

Importing My Own Script

2008-04-17 Thread Victor Subervi
Hi: How do I import my own script from a second script? That is, I have script x and I want to import script y. How? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Metaprogramming Example

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 14:25, andrew cooke <[EMAIL PROTECTED]> wrote: > On Apr 17, 7:12 am, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > [...] > > Thanks very much! > > These are useful pointers. I'll update my code accordingly. > > At one point you pointed out I didn't need parentheses and I agree - I >

Re: What can we do about all the spam that the list is getting?

2008-04-17 Thread Grant Edwards
On 2008-04-16, Mark Shroyer <[EMAIL PROTECTED]> wrote: > In article ><[EMAIL PROTECTED]>, > Mensanator <[EMAIL PROTECTED]> wrote: > >> On Apr 16, 12:01?pm, [EMAIL PROTECTED] wrote: >> > What can we do about all the spam that comp.lang.python is getting? >> > Things are getting pretty bad. >> >>

Re: Importing My Own Script

2008-04-17 Thread Ben Kaplan
If x and y are in the same directory, just do "import x". If not, add the directory containing x to sys.path. Then, "import x" should work. - Original Message From: Victor Subervi <[EMAIL PROTECTED]> To: [email protected] Sent: Thursday, April 17, 2008 9:45:10 AM Subject: Importing M

Re: Finally had to plonk google gorups.

2008-04-17 Thread Grant Edwards
On 2008-04-17, John Salerno <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: >> This morning almost half of c.l.p was spam. In order to try to >> not tar both the benign google group users and the malignant >> ones with the same brush, I've been trying to kill usenet spam >> with subject patterns

Re: Finally had to plonk google gorups.

2008-04-17 Thread Grant Edwards
On 2008-04-17, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 16 Apr 2008 09:19:37 -0500, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> I broke down and joined all the other people that just killfile >> everything posted via google.groups. > > Unfortu

why function got dictionary

2008-04-17 Thread AlFire
Hi, I am seeking an explanation for following: Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def g(): return ... >>> g.__dict__ {} Q: why function got dictionary? What it

Re: why function got dictionary

2008-04-17 Thread Diez B. Roggisch
AlFire wrote: > Hi, > > I am seeking an explanation for following: > > Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> def g(): return > ... > >>> g.__dict__ > {} >

Re: webcam (usb) access under Ubuntu

2008-04-17 Thread Berco Beute
On Apr 16, 2:26 pm, yoz <[EMAIL PROTECTED]> wrote: > Berco Beute wrote: > > I've been trying to access my webcam using Python, but I failed > > miserably. The camera works fine under Ubuntu (using camora and > > skype), but I am unable to get WebCamSpy or libfg to access my webcam. > > > First I tr

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On 17 Apr, 15:21, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > If not, what is the advantage above already present solutions? Well... I like the processing module. Except that Wintendo toy OS has no fork() availabe for the Win32 subsystem, which makes it a bit limited on that platform (slow a

Re: why function got dictionary

2008-04-17 Thread [EMAIL PROTECTED]
On 17 avr, 16:06, AlFire <[EMAIL PROTECTED]> wrote: > Hi, > > I am seeking an explanation for following: > > Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> def g(): retu

More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
Hi again: Here is my code, an edit of Gabriel´s: #!/usr/local/bin/python import cgitb; cgitb.enable() import MySQLdb def test(): host = 'host' db = 'db' user = 'user' passwd = 'pass' db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=db) cursor= db.cursor() cursor.execute('

Re: Importing My Own Script

2008-04-17 Thread Victor Subervi
On Thu, Apr 17, 2008 at 8:52 AM, Ben Kaplan <[EMAIL PROTECTED]> wrote: > If x and y are in the same directory, just do "import x". If not, add the > directory containing x to sys.path. Then, "import x" should work. > Well, now that´s what I thought! But no, it doesn´t work! Both scripts are in t

Re: why function got dictionary

2008-04-17 Thread AlFire
Diez B. Roggisch wrote: >> >> Q: why function got dictionary? What it is used for? > > because it is an object, and you can do e.g. > you mean an object in the following sense? >>> isinstance(g,object) True where could I read more about that? Andy -- http://mail.python.org/mailman/listinf

Re: More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
Never mind. Apparently, these tags throw it for that loop: print '\n' I´m surprised they would, but gratified I found the problem. Victor On Thu, Apr 17, 2008 at 9:42 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > Hi again: > Here is my code, an edit of Gabriel´s: > > #!/usr/local/bin/python

why objects of old style classes are instances of 'object'

2008-04-17 Thread AlFire
Hi, Q: from the subject, why objects of old style classes are instances of 'object'? >>> class a():pass >>> A=a() >>> isinstance(A,object) True I would expect False Thx, Andy -- http://mail.python.org/mailman/listinfo/python-list

Re: is file open in system ? - other than lsof

2008-04-17 Thread Thomas Guettler
bvidinli schrieb: > is there a way to find out if file open in system ? - > please write if you know a way other than lsof. because lsof if slow for me. > i need a faster way. > i deal with thousands of files... so, i need a faster / python way for this. > thanks. > > On Linux there are symlink

Can't do a multiline assignment!

2008-04-17 Thread s0suk3
I was shocked a while ago when a discovered that in Python you can't do a multiline assignment with comments between the lines. For example, let's say I want to assign a bunch of variables to an initial, single value. In C or a similar language you would do: CONSTANT1= /* This is some constan

Re: why function got dictionary

2008-04-17 Thread Diez B. Roggisch
AlFire wrote: > Diez B. Roggisch wrote: >>> >>> Q: why function got dictionary? What it is used for? >> >> because it is an object, and you can do e.g. >> > > you mean an object in the following sense? > > >>> isinstance(g,object) > True Yes. > > where could I read more about that? I don

Re: why objects of old style classes are instances of 'object'

2008-04-17 Thread Diez B. Roggisch
AlFire wrote: > Hi, > > Q: from the subject, why objects of old style classes are instances of > 'object'? > > >>> class a():pass > >>> A=a() > >>> isinstance(A,object) > > True Because everything is an object. But not everything is a newstyle-class: >>> class Foo: pass ... >>> isinstance

Re: Unicode chr(150) en dash

2008-04-17 Thread marexposed
Thank you Martin and John, for you excellent explanations. I think I understand the unicode basic principles, what confuses me is the usage different applications make out of it. For example, I got that EN DASH out of a web page which states at the beggining. That's why I did go for that encod

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On 17 Apr, 10:25, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > help progress at all. I think neither was the case in this thread - > the guy claimed that he actually did something about the GIL, and > now we are all waiting for him to also tell us what it is that he > did. Ok, I did not remove

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On 17 Apr, 09:11, Matias Surdi <[EMAIL PROTECTED]> wrote: > It's april 1st again??? Not according to my calendar. This was not meant as a joke. I think I may have solved the GIL issue. See my answer to Martin v. Löwis for a full explanation. -- http://mail.python.org/mailman/listinfo/python-lis

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On 17 Apr, 10:12, Steve Holden <[EMAIL PROTECTED]> wrote: > Quick, write it down before the drugs wear off. Hehe, I don't take drugs, apart from NSAIDs for arthritis. Read my answer to Martin v. Löwis. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't do a multiline assignment!

2008-04-17 Thread Gary Herron
[EMAIL PROTECTED] wrote: > I was shocked a while ago when a discovered that in Python you can't > do a multiline assignment > with comments between the lines. > > For example, let's say I want to assign a bunch of variables to an > initial, single value. In C or a similar language you would do: > >

Re: Unicode chr(150) en dash

2008-04-17 Thread s0suk3
On Apr 17, 10:10 am, [EMAIL PROTECTED] wrote: > Thank you Martin and John, for you excellent explanations. > > I think I understand the unicode basic principles, what confuses me is the > usage different applications make out of it. > > For example, I got that EN DASH out of a web page which state

Re: More Fun With MySQL and Images

2008-04-17 Thread J. Cliff Dyer
On Thu, 2008-04-17 at 09:52 -0500, Victor Subervi wrote: > Never mind. Apparently, these tags throw it for that loop: > print '\n' > I´m surprised they would, but gratified I found the problem. > Victor > > Why does that surprise you? A jpeg has a well-defined header that tells whatever appl

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
> Yuck! No way!! If you *want* to make your code that hard to read, I'm > sure you can find lots of ways to do so, even in Python, but don't > expect Python to change to help you toward such a dubious goal. > Well, my actual code doesn't look like that. Trust me, I like clean code. > Seriously,

Re: I just killed GIL!!!

2008-04-17 Thread MRAB
On Apr 17, 5:22 am, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Tim Daneliuk writes: > > Daniel Fetchinson wrote: > > >> [...] > > >>> I just had one moment of exceptional clarity, during which > >>> realized how I could get the GIL out of my way... It's so > >>> simple, I cannot he

Re: py3k s***s

2008-04-17 Thread Aaron Watters
On Apr 16, 3:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Wow, I'd venture that the division changes with ints are the only > thing I'm really concerned about... Oh I forgot about this one. Yes, I think it's a mistake to adopt a different convention for division than C/C++/java/C#/

Re: PHATCH: PHoto bATCH processor with EXIF and IPTC support for all platforms

2008-04-17 Thread Fred Pacquier
"SPE - Stani's Python Editor" <[EMAIL PROTECTED]> said : > What is new? Until Phatch could only save EXIF and IPTC tags on Linux. > Now this feature is available for all platforms hanks to the work of > Robin Mills who managed to compile pyexiv2 and all its dependencies > and get it to work on Mac

Re: Profiling, recursive func slower than imperative, normal?

2008-04-17 Thread MRAB
On Apr 17, 9:39 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > En Wed, 16 Apr 2008 17:53:16 -0300, <[EMAIL PROTECTED]> escribió: > > >> On Apr 16, 3:27 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > >>> Any function can be implemented without recursion, although

Re: Can't do a multiline assignment!

2008-04-17 Thread Andrew Lee
[EMAIL PROTECTED] wrote: >> Yuck! No way!! If you *want* to make your code that hard to read, I'm >> sure you can find lots of ways to do so, even in Python, but don't >> expect Python to change to help you toward such a dubious goal. >> > > Well, my actual code doesn't look like that. Trust me,

Re: Can't do a multiline assignment!

2008-04-17 Thread Marco Mariani
[EMAIL PROTECTED] wrote: > Yes, it makes it more readable. And yes, it does make it (a lot) more > maintainable. Mainly because I don't have those four variables, I have > about thirty. And I think I won't need to one or two of them, but > maybe all of them at once. have fun with locals(), then (

Re: Can't do a multiline assignment!

2008-04-17 Thread colas . francis
On 17 avr, 17:40, [EMAIL PROTECTED] wrote: > > Yuck! No way!! If you *want* to make your code that hard to read, I'm > > sure you can find lots of ways to do so, even in Python, but don't > > expect Python to change to help you toward such a dubious goal. > > Well, my actual code doesn't look lik

Re: I just killed GIL!!!

2008-04-17 Thread Hrvoje Niksic
sturlamolden <[EMAIL PROTECTED]> writes: > If I use my main interpreter to delegate a task to one of its > embedded 'children', its GIL will be released while it is waiting > for the answer. Associating each embedded interpreter with a > threading.Thread is all that remains. The GIL is released wh

Re: Unicode chr(150) en dash

2008-04-17 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I think I understand the unicode basic principles, what confuses me is the > usage > different applications > make out of it. > > For example, I got that EN DASH out of a web page which states > at the beggining. That's why I > di

Re: Can't do a multiline assignment!

2008-04-17 Thread Grant Edwards
On 2008-04-17, Gary Herron <[EMAIL PROTECTED]> wrote: >> For example, let's say I want to assign a bunch of variables to an >> initial, single value. In C or a similar language you would do: >> >> CONSTANT1= >> /* This is some constant */ >> CONSTANT2= >> CONSTANT3= >> >> /*This is yet

Re: I just killed GIL!!!

2008-04-17 Thread Tim Daneliuk
MRAB wrote: > On Apr 17, 5:22 am, Torsten Bronger <[EMAIL PROTECTED]> > wrote: >> Hallöchen! >> >> Tim Daneliuk writes: >>> Daniel Fetchinson wrote: [...] > I just had one moment of exceptional clarity, during which > realized how I could get the GIL out of my way... It's so > simp

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 9:19 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 17 Apr, 10:25, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > help progress at all. I think neither was the case in this thread - > > the guy claimed that he actually did something about the GIL, and > > now we are all waiting for

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 7:40 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I'd love to be wrong about that, but the GIL *has* been the subject of > extensive efforts to kill it over the last five years, and it has > survived despite the best efforts of the developers. Yo. http://code.google.com/p/python-safet

Re: More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
Yeah, I figured that out between posts ;) On Thu, Apr 17, 2008 at 10:39 AM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-17 at 09:52 -0500, Victor Subervi wrote: > > Never mind. Apparently, these tags throw it for that loop: > > print '\n' > > I´m surprised they would, but gratifi

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: > On 17 avr, 17:40, [EMAIL PROTECTED] wrote: > > Out of sheer curiosity, why do you need thirty (hand-specified and > dutifully commented) names to the same constant object if you know > there will always be only one object? I'm building a web server.

Prob. w/ Script Posting Last Value

2008-04-17 Thread Victor Subervi
Hi; Gabriel provided a lovely script for showing images which I am modifying for my needs. I have the following line: print '\n' % (d, y) where the correct values are entered for the variables, and those values increment (already tested). Here is the slightly modified script it calls: #!/usr/loc

Re: py3k s***s

2008-04-17 Thread Michael Torrie
Aaron Watters wrote: > What I'm saying is that, for example, there are a lot > of cool tools out there for using Python to manipulate > postscript and latex and such. Most of those tools > require no maintenance, and the authors are not paying > any attention to them, and they aren't interested in

Re: Can't do a multiline assignment!

2008-04-17 Thread D'Arcy J.M. Cain
On Thu, 17 Apr 2008 09:19:32 -0700 (PDT) [EMAIL PROTECTED] wrote: > I'm building a web server. The many variables are names of header > fields. One part of the code looks like this (or at least I'd like it > to): > > class RequestHeadersManager: > > # General header fields > Cache_Control

Re: is file open in system ? - other than lsof

2008-04-17 Thread Nick Craig-Wood
Thomas Guettler <[EMAIL PROTECTED]> wrote: > bvidinli schrieb: > > is there a way to find out if file open in system ? - > > please write if you know a way other than lsof. because lsof if slow for > > me. > > i need a faster way. > > i deal with thousands of files... so, i need a faster / pytho

Re: Can't do a multiline assignment!

2008-04-17 Thread colas . francis
On 17 avr, 18:19, [EMAIL PROTECTED] wrote: > On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: > > > On 17 avr, 17:40, [EMAIL PROTECTED] wrote: > > > Out of sheer curiosity, why do you need thirty (hand-specified and > > dutifully commented) names to the same constant object if you know > > there will

Re: Can't do a multiline assignment!

2008-04-17 Thread Gary Herron
[EMAIL PROTECTED] wrote: > On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: > >> On 17 avr, 17:40, [EMAIL PROTECTED] wrote: >> >> Out of sheer curiosity, why do you need thirty (hand-specified and >> dutifully commented) names to the same constant object if you know >> there will always be only one

Re: Can't do a multiline assignment!

2008-04-17 Thread Arnaud Delobelle
On Apr 17, 5:19 pm, [EMAIL PROTECTED] wrote: > On Apr 17, 10:54 am, [EMAIL PROTECTED] wrote: > > > On 17 avr, 17:40, [EMAIL PROTECTED] wrote: > > > Out of sheer curiosity, why do you need thirty (hand-specified and > > dutifully commented) names to the same constant object if you know > > there wil

Re: I just killed GIL!!!

2008-04-17 Thread sturlamolden
On Apr 17, 5:46 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Have you tackled the communication problem? The way I see it, one > interpreter cannot "see" objects created in the other because they > have separate pools of ... everything. They can communicate by > passing serialized objects thro

How to know if a module is thread-safe

2008-04-17 Thread Jérémy Wagner
Hi, I recently tried to use the subprocess module within a threading.Thread class, but it appears the module is not thread-safe. What is the policy of python regarding thread-safety of a module ? -- http://mail.python.org/mailman/listinfo/python-list

Re: What can we do about all the spam that the list is getting?

2008-04-17 Thread Mark Shroyer
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-04-16, Mark Shroyer <[EMAIL PROTECTED]> wrote: > > In article > ><[EMAIL PROTECTED]>, > > Mensanator <[EMAIL PROTECTED]> wrote: > > > >> On Apr 16, 12:01?pm, [EMAIL PROTECTED] wrote: > >> > What can we do about a

Re: Can't do a multiline assignment!

2008-04-17 Thread s0suk3
On Apr 17, 11:44 am, Gary Herron <[EMAIL PROTECTED]> wrote: > But. *What's the point* of doing it this way.I see 14 variables > being assigned a value, but I don't see the value, they are getting. > Reading this bit if code provides no useful information unless I'm > willing to scan down the

Re: How to know if a module is thread-safe

2008-04-17 Thread Michael Torrie
Jérémy Wagner wrote: > Hi, I recently tried to use the subprocess module > within a threading.Thread class, but it appears the module > is not thread-safe. http://bugs.python.org/issue1731717 Pretty bad bug, really, since subprocess is supposed to be the replacement for all the other mechanisms l

  1   2   3   >