Yingjie Lan writes:
> Have you considered line continuation by indentation? It seems to
> meet the design principle. I think it is the most natural way to
> allow free line breaking in Python.
Briefly, yes, and I think it would need a lot of tuning and probably
complex rules. Unlike statement
On Fri, Sep 2, 2011 at 10:36 PM, Vineet Deodhar wrote:
>> e.g., I have this list:
>> L = ['spam', 'ham', 'eggs', 12, (13.63)]
>> What is the correct way to convert L to javascript array format?
> Python likewise has a JSON module in the std lib:
> http://docs.python.org/library/json.html
> ==
> e.g., I have this list:
> L = ['spam', 'ham', 'eggs', 12, (13.63)]
> What is the correct way to convert L to javascript array format?
> 1) jsonify the list and pass it to javascript
> (whether json format & javascript array are similar?)
JSON is in fact a subset of JavaScript, and modern browser
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?
They are written in C, so avoid a lot of CPython inte
On Fri, Sep 2, 2011 at 12:43 PM, 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=?',
> (
Guido van Rossum writes:
> On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull
> wrote:
> > Sure, but IIRC one design principle of Python is that the keyword that
> > denotes the syntax should be the first thing on the line,
[...]
> That's true for *statements* (except assignments and call
Have you considered line continuation by indentation? It seems to meet the
design principle. I think it is the most natural way to allow free line
breaking in Python.
(Sorry, the yahoo web email interface is so weird that I don't know how to
format comments between the quoted message below.)
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=?',
(datetime.datetime.now(), success,
self.b['id']))
my question
On Fri, Sep 2, 2011 at 6:39 PM, Travis Parks wrote:
> You commented that the itertools algorithms will perform faster than
> the hand-written ones. Are these algorithms optimized internally?
For one thing, they are written in C.
Cheers,
Chris
--
http://mail.python.org/mailman/listinfo/python-l
t...@thsu.org writes:
> On Sep 2, 9:54 am, Bart Kastermans wrote:
>> if d(a,b) == 1 and a < b:
>
> It will probably be faster if you reverse the evaluation order of that
> expression.
>
> if a
> That way the d() function is called less than half the time. Of course
> this assumes that a that's tr
On Sep 2, 6:49 pm, Travis Parks wrote:
> On Sep 2, 4:09 pm, Ian Kelly wrote:
>
>
>
>
>
> > On Fri, Sep 2, 2011 at 10:59 AM, Travis Parks
> > wrote:
> > > Hello:
>
> > > I am working on an algorithms library. It provides LINQ like
> > > functionality to Python iterators. Eventually, I plan on ha
In article
Roy Smith wrote:
>Thread.join() currently returns None, so there's
>no chance for [return value] confusion.
Well, still some actually. If you use my example code (posted
elsethread), you need to know:
- that there was a target function (my default return
value if there is no
Chris Angelico wrote:
Although I heard somewhere that that's more gimmick than guarantee,
and that it IS possible for an app to hook CAD - just that it's a lot
harder than building a simple window that looks like the login...
And of course it's possible that someone has snuck in
during the nig
In article
<5da6bf87-9412-46c4-ad32-f8337d56b...@o15g2000vbe.googlegroups.com>,
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 retu
On Aug 30, 9:53 am, Michel Albert wrote:
> Unfortunately this setup makes `logging.basicConfig` pretty useless.
> However, I believe that this is something that more people could
> benefit from. I also believe, that it just "makes sense" to send
> warnings (and above) to `stderr`, the rest to `s
On Sep 2, 4:09 pm, Ian Kelly wrote:
> On Fri, Sep 2, 2011 at 10:59 AM, Travis Parks wrote:
> > Hello:
>
> > I am working on an algorithms library. It provides LINQ like
> > functionality to Python iterators. Eventually, I plan on having
> > feaures that work against sequences and mappings.
>
> >
On Sep 2, 2:30 pm, Ian Kelly wrote:
> On Fri, Sep 2, 2011 at 11:51 AM, John Roth wrote:
> >> I don't see how you could get rid of the wrappers. Methods would
> >> still need to be bound, somehow, so that code like this will work:
>
> >> methods = {}
> >> for obj in objs:
> >> if obj.is_flagg
On Sep 2, 4:14 pm, Chris Torek wrote:
> In article
> Adam Skutt wrote:
>
> >No, it can only pass a void*, which isn't much better than passing an
> >int.
>
> It is far better than passing an int, although it leaves you with
> an annoying storage-management issue, and sidesteps any reasonable
>
On Sat, Sep 3, 2011 at 2:26 AM, Den wrote:
> I've been doing some more thinking on what I want. This may be a
> better explanation. Is there a way of detecting if my program has
> lost "focus" (I'm not sure the correct term)? For example, if someone
> is typing in my program, but some other pro
Seebs wrote:
> On 2011-09-02, Steven D'Aprano
> wrote:
[...]
>> Because then the code launching the thread would have to block, waiting
>> until the thread is completed, so it will have a result to return.
>
> Isn't "waiting until the thread is completed" sort of the point of join()?
Doh!
I me
On Fri, Sep 2, 2011 at 11:51 AM, John Roth wrote:
>> I don't see how you could get rid of the wrappers. Methods would
>> still need to be bound, somehow, so that code like this will work:
>>
>> methods = {}
>> for obj in objs:
>> if obj.is_flagged:
>> methods[obj.user_id] = obj.do_wor
En Fri, 02 Sep 2011 13:53:37 -0300, Travis Parks
escribió:
On Sep 2, 12:36 pm, "Gabriel Genellina"
wrote:
En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks
escribi :
> On Aug 31, 7:37 pm, Gregory Ewing wrote:
>> Ian Kelly wrote:
>> > if sys.version_info < (3,):
>> > getDictValues =
On 9/2/2011 12:53 PM, Travis Parks wrote:
On Sep 2, 12:36 pm, "Gabriel Genellina"
Those if/else are at global scope. An 'if' statement does not introduce a
new scope; so getDictValues, despite being "indented", is defined at
global scope, and may be used anywhere in the module.
Does that me
>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
>> pthread_join.
In articl
On Fri, Sep 2, 2011 at 10:59 AM, Travis Parks wrote:
> Hello:
>
> I am working on an algorithms library. It provides LINQ like
> functionality to Python iterators. Eventually, I plan on having
> feaures that work against sequences and mappings.
>
> I have the code up at http://code.google.com/p/py
En Thu, 01 Sep 2011 07:51:43 -0300, Yaşar Arabacı
escribió:
I am new to profile module, so I am sorry if this is an absolute beginner
question. In order to my code to run, I need to add a directory to
sys.path.
When I invole python -m profile myfile.py, my code won't work, saying
that
th
Dennis Lee Bieber wrote:
On Thu, 1 Sep 2011 00:56:50 -0400, Sahil Tandon
# process input, line-by-line, and print responses after parsing input
while 1:
rval = parse(raw_input())
if rval == None:
There is only ONE "None" object so the preferred method is
if rval is None:
On Fri, Sep 2, 2011 at 12:28 AM, Stephen J. Turnbull wrote:
> Gabriel AHTUNE writes:
> > So can be done with this syntax:
> >
> > > x = firstpart * secondpart + #line breaks here
> > > anotherpart + #continue
> > > stillanother #continue on.
> >
> > after a "+" operator the line is clearl
wrote in message
news:mailman.703.1314969082.27778.python-l...@python.org...
> Hi Fokke,
>
> Disclaimer: I have no experience with the Python WebDAV package you're
> using.
>
> But a thought:
>
>> In the config file it says:
>> "# main directory
>> directory = \Webdav"
>
> Perhaps you should qual
"becky_lewis" wrote in message
news:86b084e0-09a8-4997-9e0c-4526d7851...@s2g2000vby.googlegroups.com...
On Sep 2, 1:19 pm, "Fokke Nauta" wrote:
> "Dennis Lee Bieber" wrote in
> messagenews:mailman.687.1314941410.27778.python-l...@python.org...
>
> > On Thu, 1 Sep 2011 12:30:43 +0200, "Fokke N
"Dennis Lee Bieber" wrote in message
news:mailman.711.1314983727.27778.python-l...@python.org...
> On Fri, 2 Sep 2011 14:19:32 +0200, "Fokke Nauta"
> declaimed the following in
> gmane.comp.python.general:
>
>
>>
>> In the config file it says:
>> "# main directory
>> directory = \Webdav"
>>
> I
En Wed, 31 Aug 2011 22:46:54 -0300, escribió:
I need to access the dictionary of the script that I am running through
my vc++ application by embedding python.
I am linking to python dynamically. I want to obtain the dictionary of
the script and access the variables declared in the script.
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
> pthread_join.
No, it can only pa
A new version of the Python module which wraps GnuPG has been
released.
What Changed?
=
This is a minor enhancement and bug-fix release. See the project
website ( http://code.google.com/p/python-gnupg/ ) for more
information. Summary:
Better support for status messages from GnuPG.
The
Adam Skutt writes:
> 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 stash that someplace, and
>> return it as the return
On Sep 1, 8:26 am, Ian Kelly wrote:
> On Thu, Sep 1, 2011 at 6:45 AM, John Roth wrote:
> > I personally consider this to be a wart. Some time ago I did an
> > implementation analysis. The gist is that, if self and cls were made
> > special variables that returned the current instance and class
>
On Sep 2, 12:36 pm, "Gabriel Genellina"
wrote:
> En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks
> escribi :
>
> > On Aug 31, 7:37 pm, Gregory Ewing wrote:
> >> Ian Kelly wrote:
> >> > if sys.version_info < (3,):
> >> > getDictValues = dict.itervalues
> >> > else:
> >> > getDictValues
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 stash that someplace, and
> return it as the return value for join().
> > Yes,
I'm new at Python, Cherrypy and Tenjin and I can't get tenjin to
recognize external css file. Does anyone have an example showing how
it's done? Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Sep 2, 2011 at 8:34 AM, Vineet Deodhar wrote:
> Hi !
> Within a web framework, I want want to pass a python sequence (list or
> tuple) to client-side javascript function as an array (javascript
> compatible)
> e.g., I have this list:
> L = ['spam', 'ham', 'eggs', 12, (13.63)]
> What is the
Hello:
I am working on an algorithms library. It provides LINQ like
functionality to Python iterators. Eventually, I plan on having
feaures that work against sequences and mappings.
I have the code up at http://code.google.com/p/py-compass.
This is my first project in Python, so I'd like some fe
On 2011-09-02, Steven D'Aprano wrote:
> 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 stash that someplace, and
>> return it as the return va
En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks
escribió:
On Aug 31, 7:37 pm, Gregory Ewing wrote:
Ian Kelly wrote:
> if sys.version_info < (3,):
> getDictValues = dict.itervalues
> else:
> getDictValues = dict.values
> (which is basically what the OP was doing in the first place)
On Sep 1, 8:52 am, Den wrote:
> Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> is handled deep inside the OS, and I'm not trying to interrupt that.
> But is there some way to detect that a C-A-D has been pressed?
>
> Also, is there a corresponding key-sequence in Mac and
On Sep 2, 5:27 am, sjm wrote:
> On Sep 1, 12:52 pm, Den wrote:
>
> > Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> > is handled deep inside the OS, and I'm not trying to interrupt that.
> > But is there some way to detect that a C-A-D has been pressed?
>
> If you manage
On Sep 2, 5:27 am, sjm wrote:
> On Sep 1, 12:52 pm, Den wrote:
>
> > Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> > is handled deep inside the OS, and I'm not trying to interrupt that.
> > But is there some way to detect that a C-A-D has been pressed?
>
> If you manage
On Fri, Sep 2, 2011 at 11:34 AM, Vineet Deodhar wrote:
> Hi !
> Within a web framework, I want want to pass a python sequence (list or
> tuple) to client-side javascript function as an array (javascript
> compatible)
> e.g., I have this list:
> L = ['spam', 'ham', 'eggs', 12, (13.63)]
> What is th
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 stash that someplace, and
> return it as the return value for join().
>
> Yes, I know there's oth
Hi !
Within a web framework, I want want to pass a python sequence (list or tuple)
to client-side javascript function as an array (javascript compatible)
e.g., I have this list:
L = ['spam', 'ham', 'eggs', 12, (13.63)]
What is the correct way to convert L to javascript array format?
1) jsonify t
On Sep 2, 9:54 am, Bart Kastermans wrote:
> if d(a,b) == 1 and a < b:
It will probably be faster if you reverse the evaluation order of that
expression.
if ahttp://mail.python.org/mailman/listinfo/python-list
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 stash that someplace, and
return it as the return value for join().
Yes, I know there's other ways for a thread to return
MRAB writes:
> On 02/09/2011 01:35, Bart Kastermans wrote:
>> graph = [[a,b] for a in data for b in data if d(a,b) ==1 and a< b]
>> graph2 = []
>> for i in range (0, len(data)):
>> for j in range(0,len(data)):
>> if d(data[i],data[j]) == 1 and i< j:
>> graph2.append
Hi Alan,
Thanks for sharing that link - very interesting!
http://www.pytex.org/
Malcolm (former LaTeX/TeX user from early 90's)
--
http://mail.python.org/mailman/listinfo/python-list
On 9/1/11 3:54 PM, Aaron Scott wrote:
I'm trying to deploy a Python app on OSX that was built with PySide. py2app
packages it without issue, copying and linking a lot of PySide and Qt files in
the process. But then, when I try to run the built app, I get this error:
Traceback (most recent call
http://www.pytex.org/
hth,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Hi Fokke,
Disclaimer: I have no experience with the Python WebDAV package you're
using.
But a thought:
> In the config file it says:
> "# main directory
> directory = \Webdav"
Perhaps you should qualify your directory path with a drive letter?
I would try this 2 ways:
directory = E:\Webdav
A
On Sep 2, 1:19 pm, "Fokke Nauta" wrote:
> "Dennis Lee Bieber" wrote in
> messagenews:mailman.687.1314941410.27778.python-l...@python.org...
>
>
>
>
>
>
>
>
>
> > On Thu, 1 Sep 2011 12:30:43 +0200, "Fokke Nauta"
> > declaimed the following in
> > gmane.comp.python.general:
>
> >> "Dennis Lee Bie
Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
is handled deep inside the OS, and I'm not trying to interrupt that.
But is there some way to detect that a C-A-D has been pressed?
Others have pointed out that this shouldn't really be possible for
reasons of security. (And
Two underscores??!!! OH!!! I thank thee!
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 1, 12:52 pm, Den wrote:
> Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> is handled deep inside the OS, and I'm not trying to interrupt that.
> But is there some way to detect that a C-A-D has been pressed?
If you manage to write a program that can detect CTRL-ALT
Thank you very much
And no, no, I have not been reading a book with bad font =D haha!!
The problem was that I did not inherit from Object... Since I am from a JAVA
background, I assumed that Python would inherit implicitly.
--
http://mail.python.org/mailman/listinfo/python-list
"Dennis Lee Bieber" wrote in message
news:mailman.687.1314941410.27778.python-l...@python.org...
> On Thu, 1 Sep 2011 12:30:43 +0200, "Fokke Nauta"
> declaimed the following in
> gmane.comp.python.general:
>
>> "Dennis Lee Bieber" wrote in message
>> news:mailman.643.1314851358.27778.python-l..
"Dennis Lee Bieber" wrote in message
news:mailman.622.1314812583.27778.python-l...@python.org...
> On Wed, 31 Aug 2011 11:27:36 +0200, "Fokke Nauta"
> declaimed the following in
> gmane.comp.python.general:
>
>>
>> Ofcourse I realized it was Unix/Linux. I already could tell that as the
>> packag
On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compatibility for Python versions prior to 2.7.
>
> Comparing the django copy
On 01/09/11 17:52, Den wrote:
> Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> is handled deep inside the OS, and I'm not trying to interrupt that.
> But is there some way to detect that a C-A-D has been pressed?
>
> Also, is there a corresponding key-sequence in Mac and
On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compatibility for Python versions prior to 2.7.
>
> Comparing the django copy
On Aug 30, 1:39 pm, Roy Smith wrote:
> Oh, my, it turns out that django includes:
>
> # This is a copy of the Pythonlogging.config.dictconfig module,
> # reproduced with permission. It is provided here for backwards
> # compa
On Fri, Sep 2, 2011 at 5:06 PM, Stephen Hansen 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 guarantee,
a
Gabriel AHTUNE writes:
> So can be done with this syntax:
>
> > x = firstpart * secondpart + #line breaks here
> > anotherpart + #continue
> > stillanother #continue on.
>
> after a "+" operator the line is clearly not finished yet.
Sure, but IIRC one design principle of Python is that
On Sep 1, 6:32 am, "Martin P. Hellwig"
wrote:
> On 01/09/2011 04:16, babbu Pehlwan wrote:
>
> > I have written a http server using BaseHTTPServer module. Now I want
> > to instantiate it through another python script. The issue here is
> > after instantiate the control doesn't come back till the s
Dear Colleague,
We would like to call your attention to the International Symposium
CompIMAGE 2012 – Computational Modeling of Objects Presented in
Images: Fundamentals, Methods and Applications (www.dis.uniroma1.it/
compimage2012), that will be held in Rome, Italy, in September 5-7,
2012.
MAIN T
On 9/1/11 8:52 AM, Den wrote:
> Obviously, this is a windows-based question. I know that Ctrl-Alt-Del
> is handled deep inside the OS, and I'm not trying to interrupt that.
> But is there some way to detect that a C-A-D has been pressed?
IIUC, by definition, Ctrl-Alt-Delete can't be responded to
72 matches
Mail list logo