Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Yingjie Lan
I agree that long lines of code are not very common in many projects, though it might be the case with some heavily involved in math. For some reason, when the feature of free line breaking came about in computer languages, it is welcomed and generally well accepted. Python uses indentation for

Re: Detecting Ctrl-Alt-Del in Windows

2011-09-03 Thread Nobody
On Fri, 02 Sep 2011 17:55:41 +1000, Chris Angelico wrote: >> That's why you have to hit CAD to get to the login form in some versions >> of Windows. The whole point of that secure sequence is that the OS and >> only the OS responds. > > Although I heard somewhere that that's more gimmick than gua

Re: sqlite3 with context manager

2011-09-03 Thread Carl Banks
On Friday, September 2, 2011 11:43:53 AM UTC-7, Tim Arnold wrote: > Hi, > I'm using the 'with' context manager for a sqlite3 connection: > > with sqlite3.connect(my.database,timeout=10) as conn: > conn.execute('update config_build set datetime=?,result=? > where id=?', >

Re: Why doesn't threading.join() return a value?

2011-09-03 Thread Alain Ketterlin
Adam Skutt writes: > On Sep 2, 2:23 pm, Alain Ketterlin > wrote: >> Sorry, you're wrong, at least for POSIX threads: >> >> void pthread_exit(void *value_ptr); >> int pthread_join(pthread_t thread, void **value_ptr); >> >> pthread_exit can pass anything, and that value will be retrieved with >> p

json: python 2.5: error in browser

2011-09-03 Thread Vineet Deodhar
> Any idea on converting list to json in python 2.5? http://pypi.python.org/pypi/simplejson/ Cheers, Chris = Now I built json from simplejson. While trying to render the same in browser, nothing is displayed. Opera Dragonfly shows this error:--   Uncaught exception: SyntaxError: JSON.pa

Re: Why doesn't threading.join() return a value?

2011-09-03 Thread Alain Ketterlin
Alain Ketterlin writes: >> Passing a void* is not equivalent to passing anything, not even in C. >> Moreover, specific values are still reserved, like PTHREAD_CANCELLED. > > Thread cancellation is program logic (pthread_cancel), it doesn't mean > you thread crashed, it means your program decided

Re: json: python 2.5: error in browser

2011-09-03 Thread Chris Rebert
On Sat, Sep 3, 2011 at 1:58 AM, Vineet Deodhar wrote: > Opera Dragonfly shows this error:-- > > Uncaught exception: SyntaxError: JSON.parse: Unable to parse value: A,B,C > Error thrown at line 3, column 0 in http://127.0.0.1:8000/mywheels/test/cat: >     var ctg = JSON.parse(["A", "B", "C"]); > ~~

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Yingjie Lan
Ambiguity: yes, when the last line of a suite is a continued line, it would require double dedentations to end the line and the suite. I noticed a similar case in current Python language as well: == #BEGIN CODE 1 if condition: for i in range(5): triangulate(i) els

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Yingjie Lan
Oops, the generating text part of my reply is referring to your last code example. For literal texts, it is is not governed by this proposal, nor are expressions within brackets and backslash continued lines. In a word, this proposal is fully backward compatible. >

Re: Why doesn't threading.join() return a value?

2011-09-03 Thread Carl Banks
On Friday, September 2, 2011 11:01:17 AM UTC-7, Adam Skutt wrote: > On Sep 2, 10:53 am, Roy Smith wrote: > > I have a function I want to run in a thread and return a value.  It > > seems like the most obvious way to do this is to have my target > > function return the value, the Thread object stas

Re: Why doesn't threading.join() return a value?

2011-09-03 Thread Carl Banks
On Friday, September 2, 2011 11:53:43 AM UTC-7, Adam Skutt wrote: > On Sep 2, 2:23 pm, Alain Ketterlin > wrote: > > Sorry, you're wrong, at least for POSIX threads: > > > > void pthread_exit(void *value_ptr); > > int pthread_join(pthread_t thread, void **value_ptr); > > > > pthread_exit can pass a

Need advice on Web / Database framework...

2011-09-03 Thread Benjamin Schollnick
Folks, I need some advice on a python web & database framework to use...? I have handcrafted a sqllite3 python script, that is a basic web application, interfacing with a sqlite3 database... But I am concerned at the thought of handcrafting a administration interface, and so forth. Are there

Reading pen drive data

2011-09-03 Thread mukesh tiwari
Hello all I am trying to write a python script which can mount a pen drive and read the data from pen drive. I am using pyudev [ http://packages.python.org/pyudev/api/index.html ] and wrote a small python code import pyudev, sys if __name__ =="__main__": context = pyudev.Context()

Functions vs OOP

2011-09-03 Thread William Gill
During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were somehow opposing techniques. It seems to me that they are complimentary. It makes sense to create objects and have so

Re: Functions vs OOP

2011-09-03 Thread MRAB
On 03/09/2011 17:15, William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation that suggests that programming using functions, and programming using objects were somehow opposing techniques. It seems to me that they are complimentary. I th

Re: Reading pen drive data

2011-09-03 Thread mukesh tiwari
On Sep 3, 7:40 pm, mukesh tiwari wrote: > Hello all > I am trying to write a python script which can mount a pen drive and > read the data from pen drive. I am using pyudev > [http://packages.python.org/pyudev/api/index.html] and wrote a small > python code > > import pyudev, sys > if __name__ ==

Re: Functions vs OOP

2011-09-03 Thread Steven D'Aprano
William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. > > It seems to me that they are complimentary. It makes sense to

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Stephen Hansen
On 9/3/11 3:33 AM, Yingjie Lan wrote: > but at least we can have such 'freedom' :) Freedom is not and never has been, IMHO, a virtue or goal or even desire in Python. Where it occurs, it is at best a happy coincidence, and even if that happy coincidence happens often, it is not a design feature, I

Re: Why doesn't threading.join() return a value?

2011-09-03 Thread Roy Smith
In article , Chris Torek wrote: > For that matter, you can use the following to get what the OP asked > for. (Change all the instance variables to __-prefixed versions > if you want them to be Mostly Private.) > > import threading > > class ValThread(threading.Thread): > "like threading.T

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Roy Smith
In article , Matt Joiner wrote: > I guess the issue here is that you can't tell if an expression is > complete without checking the indent of the following line. This is > likely not desirable. I wrote a weird bug the other day. I had a function that returned a 4-tuple and wanted to unpack it

Re: Reading pen drive data

2011-09-03 Thread Jerry Hill
On Sat, Sep 3, 2011 at 12:21 PM, mukesh tiwari wrote: > I am getting > Traceback (most recent call last): > File "Mount.py", line 7, in >observer = QUDevMonitorObserver(monitor) > NameError: name 'QUDevMonitorObserver' is not defined > > Could any one please tell me how to avoid this error

Re: Reading pen drive data

2011-09-03 Thread MRAB
On 03/09/2011 17:21, mukesh tiwari wrote: On Sep 3, 7:40 pm, mukesh tiwari wrote: Hello all I am trying to write a python script which can mount a pen drive and read the data from pen drive. I am using pyudev [http://packages.python.org/pyudev/api/index.html] and wrote a small python code imp

framework suggestions for Ben

2011-09-03 Thread Vineet Deodhar
>Folks, >I need some advice on a python web & database framework to use...? >I have handcrafted a sqllite3 python script, that is a basic web application, >interfacing with a >sqlite3 database... It depends on whether you want to develop desktop apps or browser-based apps. I will suggest 2 framew

[ANN] Pyflakes 0.5.0

2011-09-03 Thread Tristan Seligmann
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 It is my unexpected pleasure to announce the release of Pyflakes 0.5.0, the first release in several years, and available now from PyPI[1]. Highlights of this release include the use of the built-in AST instead of the compiler module, and support fo

IDLE from python 3.2 constantly crashes

2011-09-03 Thread Joshua Miller
Ok i've been using IDLE on my home computer and everytime i try and open a file that i saved to my hdd instead of my flashdrive(because it's a school project) by accident, it opens for a second and i try to do something else like open another file and it crashes. Is there anyway to remedy this erro

SSL module needs issuer information

2011-09-03 Thread John Nagle
The SSL module still doesn't return much information from the certificate. SSLSocket.getpeercert only returns a few basic items about the certificate subject. You can't retrieve issuer information, and you can't get the extensions needed to check if a cert is an EV cert. With the latest fla

Re: Functions vs OOP

2011-09-03 Thread Ian Kelly
On Sat, Sep 3, 2011 at 10:15 AM, William Gill wrote: > During some recent research, and re-familiarization with Python, I came > across documentation that suggests that programming using functions, and > programming using objects were somehow opposing techniques. > > It seems to me that they are c

Re: Need advice on Web / Database framework...

2011-09-03 Thread Paul Kölle
Hi, Am 03.09.2011 16:11, schrieb Benjamin Schollnick: Folks, I need some advice on a python web& database framework to use...? Hardest question ever ;) I have handcrafted a sqllite3 python script, that is a basic web application, interfacing with a sqlite3 database... But I am concerned a

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Terry Reedy
On 9/3/2011 3:51 AM, Yingjie Lan wrote: I agree that long lines of code are not very common in many projects, though it might be the case with some heavily involved in math. For some reason, when the feature of free line breaking came about in computer languages, it is welcomed and generally well

Re: Functions vs OOP

2011-09-03 Thread Terry Reedy
On 9/3/2011 12:25 PM, Steven D'Aprano wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? that suggests that programming using functions, and programming using objects were somehow opposing techniqu

Re: IDLE from python 3.2 constantly crashes

2011-09-03 Thread Terry Reedy
On 9/3/2011 1:54 PM, Joshua Miller wrote: Ok i've been using IDLE on my home computer and everytime i try and open a file that i saved to my hdd instead of my flashdrive(because it's a school project) by accident, it opens for a second and i try to do something else like open another file and it

Re: SSL module needs issuer information

2011-09-03 Thread Terry Reedy
On 9/3/2011 2:10 PM, John Nagle wrote: The SSL module still doesn't return much information from the certificate. SSLSocket.getpeercert only returns a few basic items about the certificate subject. You can't retrieve issuer information, and you can't get the extensions needed to check if a cert i

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 12:29 PM, MRAB wrote: I think you mean "complementary". :-) How polite of you to point out my spelling deficiency. I guess shouldn't be watching football while typing (I'm sure the beer didn't help either). I think that it's all about "state". In functional programming, there's

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 2:50 PM, Ian Kelly wrote: I think you may be confusing "functional programming" and "programming using functions". These are not the same thing. I think you may be right, Ian. It didn't make much sense -- http://mail.python.org/mailman/listinfo/python-list

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Since in Python, everything is an object, that would mean that every function has to be a method, whic

Re: Functions vs OOP

2011-09-03 Thread Ben Finney
William Gill writes: > On 9/3/2011 3:15 PM, Terry Reedy wrote: > >> William Gill wrote: > >> > >>> During some recent research, and re-familiarization with Python, I > >>> came across documentation > > > > Ours, or someone else's? > > Python. Can you show exactly where in the Python documentatio

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 5:39 PM, Ben Finney wrote: William Gill writes: On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Can you show exactly where in the Pytho

Tkinter label height to fit content

2011-09-03 Thread Bart Kastermans
I have a label into which I am going to put content of different sizes. I would like to know how high I need to make the label so that I can size the window so it can stay the same for the different content sizes. I have a strategy, but it seems more complicated then it should be. I want to set a

Re: Installing WebDAV server

2011-09-03 Thread Thomas 'PointedEars' Lahn
Fokke Nauta wrote: > "Thomas 'PointedEars' Lahn" […]: >> Fokke Nauta wrote: >>> "Thomas 'PointedEars' Lahn" […] wrote: The Python shell executes Python code. The above obviously is not Python code, but *system* shell commands. So let the *system* command shell execute them (a

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread Yingjie Lan
> Every language with blocks needs some mechanism to indicate the beginning and >ending of blocks and of statements within blocks. If visible fences >('begin/end' or '{}') and statement terminators (';') are used, then '\n' can >be treated as merely a space, as it is in C, for instance.  > and

Re: SSL module needs issuer information

2011-09-03 Thread Gelonida N
Hi John, On 09/03/2011 08:10 PM, John Nagle wrote: > The SSL module still doesn't return much information from the > certificate. SSLSocket.getpeercert only returns a few basic items > about the certificate subject. You can't retrieve issuer information, > and you can't get the extensions need

Re: Need advice on Web / Database framework...

2011-09-03 Thread Gelonida N
Hi Paul, On 09/03/2011 08:59 PM, Paul Kölle wrote: > Am 03.09.2011 16:11, schrieb Benjamin Schollnick: >> Folks, >> >> I need some advice on a python web& database framework to use...? > Hardest question ever ;) . . . >> But I am concerned at the thought of handcrafting a administration >> interf

Re: Tkinter label height to fit content

2011-09-03 Thread rantingrick
On Sep 3, 5:15 pm, Bart Kastermans wrote: > Any suggestions? Yeah, have you considered using the "linespace()" method of tk.Font objects to calculate the height? Although i must say it "feels" as if your doing something you should not need to do, however i cannot be sure without knowing more abo

Re: Functions vs OOP

2011-09-03 Thread Terry Reedy
On 9/3/2011 5:34 PM, William Gill wrote: On 9/3/2011 3:15 PM, Terry Reedy wrote: William Gill wrote: During some recent research, and re-familiarization with Python, I came across documentation Ours, or someone else's? Python. Since in Python, everything is an object, that would mean th

Re: [Python-ideas] allow line break at operators

2011-09-03 Thread MRAB
On 04/09/2011 00:22, Yingjie Lan wrote: Every language with blocks needs some mechanism to indicate the beginning and ending of blocks and of statements within blocks. If visible fences ('begin/end' or '{}') and statement terminators (';') are used, then '\n' can be treated as merely a space, a

Re: Functions vs OOP

2011-09-03 Thread William Gill
On 9/3/2011 9:51 PM, Terry Reedy wrote: It is possible that our doc was less than crystal clear. We are constantly improving it where we can see fixable faults. If you run across whatever it was and it still seems a bit muddy, post something again. Will do. Thanks. -- http://mail.python.org/m

Re: Algorithms Library - Asking for Pointers

2011-09-03 Thread Travis Parks
On Sep 3, 12:35 am, Chris Torek wrote: > In article <18fe4afd-569b-4580-a629-50f6c7482...@c29g2000yqd.googlegroups.com> > Travis Parks   wrote: > > >[Someone] commented that the itertools algorithms will perform > >faster than the hand-written ones. Are these algorithms optimized > >internally? >

my suggestions for framework

2011-09-03 Thread Vineet Deodhar
> recomment a framework which has all the layers already integrated. Take > a look at http://www.web2py.com, I think it's quite powerful and has > good documentation. > If you want to get your hands dirty you can compose your own "framework" > cherrypy+sqlalchemy+cheetah might be a good combination