Re: iterating through files

2009-02-20 Thread Marc 'BlackJack' Rintsch
On Thu, 19 Feb 2009 13:56:38 -0800, oamram wrote: new to python. i have a directory with about 50 text file and i need to iterate through them and get line 7 to 11 from each file and write those lines into another file(one file that will contain all lines). Untested: from __future__ import

Re: Threading and tkinter

2009-02-20 Thread Hendrik van Rooyen
gert ger.@gmail.com Hope you do not mind ignoring part of answers, so I can figure out more why things work the way they are. This two examples work, what i do not understand is that in function display i do not have to declare root, v or x ? x is easy - it was declared outside, in

Re: Will multithreading make python less popular?

2009-02-20 Thread Hendrik van Rooyen
Steve Holden ste...@..web.com wrote: heresyPerhaps it's time Python stopped being a dictatorship?/heresy This will need a wholesale switch to the worship of Freya - It is rumoured that She is capable of herding cats. - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

email varification using smtplib or any method

2009-02-20 Thread jitendra gupta
hello here is my code for sending the mail, using this code email is going 'CODE '' import smtplib from time import strftime from email.mime.multipart

get most common number in a list with tolerance

2009-02-20 Thread Astan Chee
Hi, I have a list that has a bunch of numbers in it and I want to get the most common number that appears in the list. This is trivial because i can do a max on each unique number. What I want to do is to have a tolerance to say that each number is not quite unique and if the difference from

Re: Will multithreading make python less popular?

2009-02-20 Thread rushenaly
On 20 Şubat, 01:20, Paul Rubin http://phr...@nospam.invalid wrote: I would say, slow execution is a drawback that we put up with in order to gain benefits of Python programming that are mostly unrelated to the causes of the slowness.  The slowness itself can be addressed by technical means,

Re: get most common number in a list with tolerance

2009-02-20 Thread Gerard Flanagan
Astan Chee wrote: Hi, I have a list that has a bunch of numbers in it and I want to get the most common number that appears in the list. This is trivial because i can do a max on each unique number. What I want to do is to have a tolerance to say that each number is not quite unique and if

Re: Will multithreading make python less popular?

2009-02-20 Thread sturlamolden
On Feb 20, 12:19 am, Mensanator mensana...@aol.com wrote: What am I actually seeing? If Python only uses one of the cores, why do both light up? Because of OS scheduling. You have more than one process running. The Python process does not stay on one core. Try to put CPython into a tight loop

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Nick Craig-Wood
Linuxguy123 linuxguy...@gmail.com wrote: How do I do this in Python ? # declare A,B function getA return A function getB return B function setA(value) A = value function setB(value) B = value main() getA

Re: email varification using smtplib or any method

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 02:58:24 -0200, jitendra gupta jitu.ic...@gmail.com escribió: when i am changing msg['To'] = wrongu...@wrongdomain.comddsdjsdsdsjdh some wrong email then i am getting back failure notice in my inbox, which i dont want.. is there any way so that i can identify wrong

Re: Strange array.array performance

2009-02-20 Thread Maxim Khitrov
On Fri, Feb 20, 2009 at 2:42 AM, Scott David Daniels scott.dani...@acm.org wrote: Maxim Khitrov wrote: ... Here's the function that I'll be using from now on. It gives me exactly the behavior I need, with an int initializer being treated as array size. Still not as efficient as it could be if

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
Matimus wrote: On Feb 19, 8:06 pm, W. eWatson notval...@sbcglobal.net wrote: I'm using IDLE for editing, but execute programs directly. If there are execution or compile errors, the console closes before I can see what it contains. How do I prevent that? -- W.

Re: Regular expression bug?

2009-02-20 Thread Lie Ryan
On Thu, 19 Feb 2009 13:03:59 -0800, Ron Garret wrote: In article gnkdal$bcq$0...@news.t-online.com, Peter Otten __pete...@web.de wrote: Ron Garret wrote: I'm trying to split a CamelCase string into its constituent components. How about

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Bruno Desthuilliers
Nick Craig-Wood a écrit : (snip) Note that in python we don't normally bother with getA/setA normally, just use self.A, eg class Stuff(object): def __init__(self): self.A = None self.B = None def main(self): print self.A print self.B # dosomething

import bug?

2009-02-20 Thread alain
Hi all, Running python 2.5, i experience a strange behaviour with the following code:import imputil def handle_pye(fullpath, fileinfo, name): # Print a debugging message print 'Importing %s from %s' % (name,fullpath) data = open(fullpath).read() return 0,

Re: Keeping the Console Open with IDLE

2009-02-20 Thread David Smith
W. eWatson wrote: Matimus wrote: On Feb 19, 8:06 pm, W. eWatson notval...@sbcglobal.net wrote: I'm using IDLE for editing, but execute programs directly. If there are execution or compile errors, the console closes before I can see what it contains. How do I prevent that? --

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Brian Blais
On Feb 19, 2009, at 23:06 , W. eWatson wrote: I'm using IDLE for editing, but execute programs directly. Is there a reason you are executing them directly? Why not just run the script from IDLE with Run/Run Module (F5) until you are sure there are no errors? You can follow the advice

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt window (w/o the single quote characters)

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Catherine Heathcote
W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt window (w/o the

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt window (w/o the

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 12:05:08 -0200, W. eWatson notval...@sbcglobal.net escribió: Whoa! What's going on here? I just looked at About IDLE, and it shows 1.2.2, but yet the second edition of Learning Python talks about going to 2.3 as the book is about to go to press, 2004. I thought IDLE

FTP libs for Python?

2009-02-20 Thread Thomas Allen
I'm interested in writing a script to ease deployment of minor changes on some websites here, and it would involve some SFTP transfers. Do you know of good alternatives to ftplib, which is relatively low- level? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
Gabriel Genellina wrote: En Fri, 20 Feb 2009 12:05:08 -0200, W. eWatson notval...@sbcglobal.net escribió: Whoa! What's going on here? I just looked at About IDLE, and it shows 1.2.2, but yet the second edition of Learning Python talks about going to 2.3 as the book is about to go to press,

Framework installation of 2.6 on OS X, with specified prefix

2009-02-20 Thread Evert Rol
Hi, I'm trying to install Python 2.6 from source on Mac OS X.5, in its own directory using a framework install. That goes fine, up to the point where it wants to install the applications that come with it (eg, the Wish shell): it tries to install things into /Applications, instead of

code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Trip Technician
anyone interested in looking at the following problem. we are trying to express numbers as minimal expressions using only the digits one two and three, with conventional arithmetic. so for instance 33 = 2^(3+2)+1 = 3^3+(3*2) are both minimal, using 4 digits but 33 = ((3+2)*2+1)*3 using 5 is

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
Catherine Heathcote wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command

Re: Newbie request assistance....Python - PAMIE - Java

2009-02-20 Thread coldpizza
This is not a Pamie issue. Pamie can only see the HTML part of the page. Any object embedded in the page using the object or embed tags is not accessible to the browser, and the browser has no idea what is inside those objects - it simply passes control to the corresponding plugin, such as Java,

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Catherine Heathcote
W. eWatson wrote: Catherine Heathcote wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change

Re: Framework installation of 2.6 on OS X, with specified prefix

2009-02-20 Thread Ben Kaplan
On Feb 20, 2009, at 9:30 AM, Evert Rol evert@gmail.com wrote: Hi, I'm trying to install Python 2.6 from source on Mac OS X.5, in its own directory using a framework install. That goes fine, up to the point where it wants to install the applications that come with it (eg, the Wish

Re: FTP libs for Python?

2009-02-20 Thread coldpizza
Why don't you just use Curl? It does a dozen of protocols including SFTP. And if the command line version is not enough for you then there are Python bindings for Curl. On Feb 20, 4:22 pm, Thomas Allen thomasmal...@gmail.com wrote: I'm interested in writing a script to ease deployment of minor

Re: Will multithreading make python less popular?

2009-02-20 Thread Mensanator
On Feb 20, 4:36�am, sturlamolden sturlamol...@yahoo.no wrote: On Feb 20, 12:19 am, Mensanator mensana...@aol.com wrote: What am I actually seeing? If Python only uses one of the cores, why do both light up? Because of OS scheduling. You have more than one process running. The Python

Re: FTP libs for Python?

2009-02-20 Thread Mike Kent
I use Fabric (http://www.nongnu.org/fab/) as my Python-based deployment tool, but it uses ssh/scp, not sftp. -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP libs for Python?

2009-02-20 Thread Jean-Paul Calderone
On Fri, 20 Feb 2009 06:22:29 -0800 (PST), Thomas Allen thomasmal...@gmail.com wrote: I'm interested in writing a script to ease deployment of minor changes on some websites here, and it would involve some SFTP transfers. Do you know of good alternatives to ftplib, which is relatively low-

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 12:29:35 -0200, W. eWatson notval...@sbcglobal.net escribió: Gabriel Genellina wrote: En Fri, 20 Feb 2009 12:05:08 -0200, W. eWatson notval...@sbcglobal.net escribió: Whoa! What's going on here? I just looked at About IDLE, and it shows 1.2.2, but yet the second

Running script in module initialization

2009-02-20 Thread Kom2
Hello, I'm trying to convert my project from python 2.5 to python 3.0 and I have the following problem. My project is PYD library written in C++. So I have this PyInit_ModuleName function containing PyModule_Create call and this function also call some script with declarations: PyObject* m;

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Paddy O'Loughlin
2009/2/20 Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid: Note that while you *can* do direct access to the implementation attribute (here, '_A' for property 'A'), you don't *need* to so (and usually shouldn't - unless you have a very compelling reason). Interesting. Why

Re: FTP libs for Python?

2009-02-20 Thread Thomas Allen
On Feb 20, 9:45 am, coldpizza vri...@gmail.com wrote: Why don't you just use Curl? It does a dozen of protocols including SFTP. And if the command line version is not enough for you then there are Python bindings for Curl. I'm actually hoping to eventually package these tools using py2exe for

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Vincent Davis
Having looked long at this how does the prime factorization play into this. I would consider an approach similar to factoring a number. Of course the issue with prime factoring is your ned to know the primes. I assume this would be a similar problem you may need to know the solutions to the

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 12:39:14 -0200, W. eWatson notval...@sbcglobal.net escribió: Catherine Heathcote wrote: you need to open a dos prompt before doing the steps above. Go to start-run and hit cmd enter without the quotes. Something is amiss here. There's the MS Command Prompt, which I'm

Re: Running script in module initialization

2009-02-20 Thread Steve Holden
Kom2 wrote: Hello, I'm trying to convert my project from python 2.5 to python 3.0 and I have the following problem. My project is PYD library written in C++. So I have this PyInit_ModuleName function containing PyModule_Create call and this function also call some script with declarations:

Re: FTP libs for Python?

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 13:24:37 -0200, Thomas Allen thomasmal...@gmail.com escribió: On Feb 20, 9:45 am, coldpizza vri...@gmail.com wrote: Why don't you just use Curl? It does a dozen of protocols including SFTP. And if the command line version is not enough for you then there are Python

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
Catherine Heathcote wrote: W. eWatson wrote: Catherine Heathcote wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2.

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
Gabriel Genellina wrote: En Fri, 20 Feb 2009 12:29:35 -0200, W. eWatson notval...@sbcglobal.net escribió: Gabriel Genellina wrote: En Fri, 20 Feb 2009 12:05:08 -0200, W. eWatson notval...@sbcglobal.net escribió: Whoa! What's going on here? I just looked at About IDLE, and it shows 1.2.2,

Re: Keeping the Console Open with IDLE

2009-02-20 Thread David Smith
W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt window (w/o the

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Catherine Heathcote
W. eWatson wrote: Catherine Heathcote wrote: W. eWatson wrote: Catherine Heathcote wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Luke Dunn
I am teaching myself coding. No university or school, so i guess its homework if you like. i am interested in algorithms generally, after doing some of Project Euler. Of course my own learning process is best served by just getting on with it but sometimes you will do that while other times you

Re: Matplotlib change xticks and retain xticks changing during zoom

2009-02-20 Thread Robert Kern
You will probably get better help on the matplotlib mailing list: https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though

Re: matplotlib issue: cannot auto-scale X axis of plop properly

2009-02-20 Thread Robert Kern
On 2009-02-19 19:22, Nash, Brent R wrote: Hey everyone, I'm fairly new to matplotlib, but have read through tons of the documentation today and have a decent understanding of it. All the auto-scaling, xlim, and x_bound stuff works fine for me with the examples, but as soon as I try to use it on

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
David Smith wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in the command prompt

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Luke Dunn
yes power towers are allowed exponentiation, multiplication, division, addition and subtraction. Brackets when necessary but length is sorted on number of digits not number of operators plus digits. I always try my homework myself first. in 38 years of life I've learned only to do what i want,

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Bruno Desthuilliers
Paddy O'Loughlin a écrit : 2009/2/20 Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid: Note that while you *can* do direct access to the implementation attribute (here, '_A' for property 'A'), you don't *need* to so (and usually shouldn't - unless you have a very compelling

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Nigel Rantor
Trip Technician wrote: anyone interested in looking at the following problem. if you can give me a good reason why this is not homework I'd love to hear it...I just don't see how this is a real problem. we are trying to express numbers as minimal expressions using only the digits one two

Re: Keeping the Console Open with IDLE

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 13:37:06 -0200, W. eWatson notval...@sbcglobal.net escribió: Catherine Heathcote wrote: W. eWatson wrote: Run the program from within the MS command line, not by double clicking it. Shirley, you jest? DOS? To do this? How ugly. I barely recall the DOS commands. I get

Re: code challenge: generate minimal expressions using only digits 1, 2, 3

2009-02-20 Thread Paul Rubin
Trip Technician luke.d...@gmail.com writes: I have a dim intuition that it could be done with a very clever bit of recursion, but the exact form so far eludes me. This sounds a little like a homework assignment, or maybe a challenge you are trying to solve for yourself, rather than be given a

Re: get most common number in a list with tolerance

2009-02-20 Thread Tim Rowe
2009/2/20 Astan Chee astan.c...@al.com.au: Hi, I have a list that has a bunch of numbers in it and I want to get the most common number that appears in the list. This is trivial because i can do a max on each unique number. What I want to do is to have a tolerance to say that each number is

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread andrew cooke
this is a neat problem. here is what i would do: use generators that extend an input. a stream approach. the initial input would be the numbers themselves. [('1', 1),('2', 2),('3', 3)] those are (expression, value) pairs then an initial attempt at the next function would be to extend that

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Trip Technician
On 20 Feb, 16:02, Paul Rubin http://phr...@nospam.invalid wrote: Trip Technician luke.d...@gmail.com writes: I have a dim intuition that it could be done with a very clever bit of recursion, but the exact form so far eludes me. This sounds a little like a homework assignment, or maybe a

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Trip Technician
On 20 Feb, 15:39, Nigel Rantor wig...@wiggly.org wrote: Trip Technician wrote: anyone interested in looking at the following problem. if you can give me a good reason why this is not homework I'd love to hear it...I just don't see how this is a real problem. we are trying to express

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Nigel Rantor
Luke Dunn wrote: yes power towers are allowed right, okay, without coding it here's my thought. factorise the numbers you have but only allowing primes that exist in your digit set. then take that factorisation and turn any repeated runs of digits multiplied by themselves into

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Nigel Rantor
Trip Technician wrote: yes n^n^n would be fine. agree it is connected to factorisation. building a tree of possible expressions is my next angle. I think building trees of the possible expressions as a couple of other people have suggested is simply a more structured way of doing what

cx_oracle -- how to insert

2009-02-20 Thread Allen
I am using Python with cx_oracle to load an excel spreadsheet into an Oracle table. There are lots of text on the spreadsheet that have in them which I want to keep in the table. But inserting those text will fail. Is there a work around for this? I can filter out the failed insert statements and

Killing subservient threads

2009-02-20 Thread jimzat
I am trying to create an app which will have a main window from which the user will launch other (children) windows. When I launch the child window I start a new thread which periodically polls another device and updates the child window accordingly. When I dismiss the child window the polling

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Paddy O'Loughlin
2009/2/20 Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid: Interesting. Why shouldn't you? I haven't used the property() function s/function/object/ Nice try, but what I wrote was what I intended to say: http://docs.python.org/library/functions.html#property For all I know I

Re: Keeping the Console Open with IDLE

2009-02-20 Thread MRAB
Catherine Heathcote wrote: W. eWatson wrote: Catherine Heathcote wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2.

How Can I run some Python Scripts in VS C++?

2009-02-20 Thread bing
Hi, I have some simple python scripts, anyone knows how to run the Python Scripts in C++? Any code example would be really helpful and appreciated. -- http://mail.python.org/mailman/listinfo/python-list

Re: Killing subservient threads

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 14:47:27 -0200, jimzat jim...@iname.com escribió: I am trying to create an app which will have a main window from which the user will launch other (children) windows. When I launch the child window I start a new thread which periodically polls another device and updates the

Re: Killing subservient threads

2009-02-20 Thread koranthala
On Feb 20, 9:47 pm, jimzat jim...@iname.com wrote: I am trying to create an app which will have a main window from which the user will launch other (children) windows. When I launch the child window I start a new thread which periodically polls another device and updates the child window

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 15:14:52 -0200, bing bing@gmail.com escribió: Hi, I have some simple python scripts, anyone knows how to run the Python Scripts in C++? Any code example would be really helpful and appreciated. Do you want to write a C++ application, and allow your users to write

Re: Keeping the Console Open with IDLE

2009-02-20 Thread W. eWatson
W. eWatson wrote: David Smith wrote: W. eWatson wrote: I'm not sure whether I should feel old or write a smart alec comment -- I suppose there are people in the world who don't know what to do with a command prompt Assuming a Windows system: 2. Type 'cd ' (as in Change Directory) in

Re: Killing subservient threads

2009-02-20 Thread Christian Heimes
Gabriel Genellina wrote: 1) make the child window set a flag in the thread (let's say, t.terminate = True). And make the polling thread check the flag periodically (you possibly already have a loop there - just break the loop when you detect that self.terminate became true)

pymssql text type

2009-02-20 Thread marc wyburn
Hi, I'm trying to pass a text blob to MS SQL Express 2008 but get the follwoing error. (class 'pymssql.OperationalError', OperationalError(SQL Server message 102, severity 15, state 1, line 1:\nIncorrect syntax near 'assigned'.\n,), traceback object at 0x044ABDF0) the string it is having an

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Bruno Desthuilliers
Paddy O'Loughlin a écrit : 2009/2/20 Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid: Interesting. Why shouldn't you? I haven't used the property() function s/function/object/ Nice try, but what I wrote was what I intended to say:

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread david
No: please explain in more detail what you want to do. -- Gabriel Genellina Thanks for the fast reply Gabriel, Basically I have some python scripts to do some document processing, all in command line tho. I want to have an C++ application so that my scripts can run in dialogs (API). I saw a

Re: To unicode or not to unicode

2009-02-20 Thread Thorsten Kampe
* Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800) I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced micro-wiki). No, it's not. I suggest you start your Unicode adventure by configuring your newsreader. Thorsten --

Re: To unicode or not to unicode

2009-02-20 Thread MRAB
Thorsten Kampe wrote: * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800) I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced micro-wiki). No, it's not. I suggest you start your Unicode adventure by configuring your newsreader. It looked

Re: can multi-core improve single funciton?

2009-02-20 Thread Aahz
In article pan.2009.02.10.21.58...@remove.this.cybersource.com.au, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: As I understand it, there's very little benefit to multi-cores in Python due to the GIL. As phrased, your statement is completely wrong. Here's a more correct

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread Gabriel Genellina
En Fri, 20 Feb 2009 15:47:06 -0200, david bing@gmail.com escribió: Basically I have some python scripts to do some document processing, all in command line tho. I want to have an C++ application so that my scripts can run in dialogs (API). I saw a post before using c# to run python scripts

Re: Killing subservient threads

2009-02-20 Thread jimzat
On Feb 20, 11:22 am, koranthala koranth...@gmail.com wrote: thread.setDaemon(True) Makes it a daemon thread which means that interpreter will not stay alive if only that thread is alive. My main window is used to launch multiple children and therefore when one is dismissed the interpreter

Re: Killing subservient threads

2009-02-20 Thread jimzat
On Feb 20, 11:21 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: 1) make the child window set a flag in the thread (let's say, t.terminate   = True). And make the polling thread check the flag periodically (you   possibly already have a loop there - just break the loop when you detect  

Re: How Can I run some Python Scripts in VS C++?

2009-02-20 Thread david
On Feb 20, 11:12 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Fri, 20 Feb 2009 15:47:06 -0200, david bing@gmail.com escribió: Basically I have some python scripts to do some document processing, all in command line tho. I want to have an C++ application so that my scripts can

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Tim Wintle
On Fri, 2009-02-20 at 16:38 +, Nigel Rantor wrote: Luke Dunn wrote: snip That was my initial thought when I read this too - but I'm not certain that is guaranteed to find a solution (i.e. a solution that's optimal). I'd welcome a proof that it will though, a few minutes thought hasn't

Re: is it possible to add a property to an instance?

2009-02-20 Thread Alan Isaac
Darren Dale wrote to GHUM: Sorry, that's an attribute, not a property. This is a question about terminology. In contrast to Darren's recommended usage, I have run into the following. If hasattr(x,'a') is True, for instance object `x`, then `a` is an attribute of `x`. Attributes are data

Find the location of a loaded module

2009-02-20 Thread Aaron Scott
I'm running into a problem that's rapidly reaching keyboard-smashing levels. I'm trying to import a module into Python, but it seems like Python is almost randomly loading the module from an entirely different directory, one that shouldn't be in the module search path. When I tell Python to load

Re: Find the location of a loaded module

2009-02-20 Thread Christian Heimes
Aaron Scott schrieb: I'm running into a problem that's rapidly reaching keyboard-smashing levels. I'm trying to import a module into Python, but it seems like Python is almost randomly loading the module from an entirely different directory, one that shouldn't be in the module search path.

Re: How do I declare global vars or class vars in Python ?

2009-02-20 Thread Paddy O'Loughlin
2009/2/20 Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid: Check by yourself: import inspect inspect.isfunction(property) False Using this, every single builtin function returns False. That's a pretty limited definition to be being pedantic over, especially when they are in the

function factory question: embed current values of object attributes

2009-02-20 Thread Alan Isaac
I have a class `X` where many parameters are set at instance initialization. The parameter values of an instance `x` generally remain unchanged, but is there way to communicate to a method that it depends only on the initial values of these parameters (and does not need to worry about any

Re: Find the location of a loaded module

2009-02-20 Thread Aaron Scott
Okay, I'm going out of my mind. I have three directories -- 'act1', 'act2', and 'act3'. Each of these has a module named 'story'. Through mod_python, I need to load 'story' in the directory 'act1'. I do it like this: req.content_type = text/html sys.path.append(os.path.dirname(

Re: Regular expression bug?

2009-02-20 Thread umarpy
More elegant way [x for x in re.split('([A-Z]+[a-z]+)', a) if x ] ['foo', 'Bar', 'Baz'] R. On Feb 20, 2:03 pm, Lie Ryan lie.1...@gmail.com wrote: On Thu, 19 Feb 2009 13:03:59 -0800, Ron Garret wrote: In article gnkdal$bcq$0...@news.t-online.com,  Peter Otten __pete...@web.de wrote:

Re: can multi-core improve single funciton?

2009-02-20 Thread Grant Edwards
On 2009-02-20, Aahz a...@pythoncraft.com wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: As I understand it, there's very little benefit to multi-cores in Python due to the GIL. As phrased, your statement is completely wrong. Here's a more correct phrasing: For

Re: To unicode or not to unicode

2009-02-20 Thread Ron Garret
In article mailman.373.1235153296.11746.python-l...@python.org, MRAB goo...@mrabarnett.plus.com wrote: Thorsten Kampe wrote: * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800) I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced

What encoding does u'...' syntax use?

2009-02-20 Thread Ron Garret
I would have thought that the answer would be: the default encoding (duh!) But empirically this appears not to be the case: unicode('\xb5') Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in position 0: ordinal not in

Re: To unicode or not to unicode

2009-02-20 Thread Martin v. Löwis
MRAB wrote: Thorsten Kampe wrote: * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800) I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced micro-wiki). No, it's not. I suggest you start your Unicode adventure by configuring your newsreader.

Re: To unicode or not to unicode

2009-02-20 Thread Ron Garret
In article 499f0cf0.8070...@v.loewis.de, Martin v. Löwis mar...@v.loewis.de wrote: MRAB wrote: Thorsten Kampe wrote: * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800) I'm writing a little wiki that I call µWiki. That's a lowercase Greek mu at the beginning (it's pronounced micro-wiki).

Re: Find the location of a loaded module

2009-02-20 Thread Aaron Scott
Here's another clue: if I'm trying to run the script from the directory 'act1', but it's loading the module from 'act2', if I rename the module directory in 'act2' and refresh, the module still reports that it's running from '/home/www/---/docs/act2/story/game.pyc'... even though that files no

Re: Will multithreading make python less popular?

2009-02-20 Thread rushenaly
I want to correct my last post where i said that there is not any intend to remove GIL from python. There is an intend actually i wish from a wizard :). On the pypy blog there is an explanation about gil and pypy Note that multithreading in PyPy is based on a global interpreter lock, as in

Re: To unicode or not to unicode

2009-02-20 Thread Martin v. Löwis
Ron Garret wrote: In article 499f0cf0.8070...@v.loewis.de, Martin v. Löwis mar...@v.loewis.de wrote: I'm the OP. I'm using MT-Newswatcher 3.5.1. I thought I had it configured properly, but I guess I didn't. Probably you did. However, it then means that the newsreader is crap. Under

Re: Framework installation of 2.6 on OS X, with specified prefix

2009-02-20 Thread Ned Deily
In article f80f3fdd-b12f-42d5-bb05-4a4b180fa...@gmail.com, Evert Rol evert@gmail.com wrote: I'm trying to install Python 2.6 from source on Mac OS X.5, in its own directory using a framework install. That goes fine, up to the point where it wants to install the applications that come

Re: What encoding does u'...' syntax use?

2009-02-20 Thread Stefan Behnel
Ron Garret wrote: I would have thought that the answer would be: the default encoding (duh!) But empirically this appears not to be the case: unicode('\xb5') Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in

Re: What encoding does u'...' syntax use?

2009-02-20 Thread Stefan Behnel
Stefan Behnel wrote: print u'\xb5' µ What you see in the last line is what the Python interpreter makes of your unicode string when passing it into stdout, which in your case seems to use a latin-1 encoding (check your environment settings for that). The seems to is misleading. The

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-20 Thread Dotan Cohen
Even 3DS or Maya is easier to learn that Blender. Notepad is easier to learn that VI. Not a good program does simple make. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

  1   2   3   >