On 3/08/2011 6:58 PM, mrinal...@edss.co.in wrote:
Hi,
I am trying to embed python into my MFC application. I have done this
before by statically linking to the python lib. But I want to change
this now.
The idea is to take the information from the registry for the installed
version of python on
On Fri, 05 Aug 2011 14:07:54 -0400, Geoff Wright wrote:
> I guess what it boils down to is that I would like to get a better handle
> on what is going on so that I will know how best to work through future
> encoding issues. Thanks in advance for any advice.
>
> Here are the specifics of my prob
Hi all,
I am trying to simply my Web application handlers, by using Python
decorators.
Essentially I want to use decorators to abstract code that checks for
authenticated sessions and the other that checks to see if the cache
provider (Memcache in this instance) has a suitable response.
Consider
> On Fri, Aug 5, 2011 at 2:19 AM, Chris Rebert wrote:
>> On Thu, Aug 4, 2011 at 8:25 PM, John Riselvato
>> wrote:
>> > I am working on a license verification script. I am rather new to the
>> > concept and to JSON files in general.
>> > This is what my pseudocode looks like:
>> >>
>> >> licenses
Roy Smith wrote:
> Wow.
>
> I was going to suggest using the unix command-line sort utility via
> popen() or subprocess. My arguments were that it's written in C, has 30
> years of optimizing in it, etc, etc, etc. It almost certainly has to be
> faster than anything you could do in Python.
>
>
Geoff Wright wrote:
> Hi,
>
> I use Mac OSX for development but deploy on a Linux server. (Platform
> details provided below).
>
> When the locale is set to FR_CA, I am not able to display a u circumflex
> consistently across the two machines even though the default encoding is
> set to "ascii"
Well, a sniffer is one of many, and one worth mentioning. Though I'd
recommend wireshark over tcpdump, pretty much any day.
http://stromberg.dnsalias.org/~dstromberg/Problem-solving-on-unix-linux-systems.html
On Fri, Aug 5, 2011 at 6:29 PM, BJ Swope wrote:
> The best tool to debug this is tcpd
Yup. Timsort is described as "supernatural", and I'm inclined to believe
it.
On Fri, Aug 5, 2011 at 7:54 PM, Roy Smith wrote:
> Wow.
>
> Python took just about half the time. Certainly knocked my socks off.
> Hard to believe, actually.
> --
> http://mail.python.org/mailman/listinfo/python-li
Wow.
I was going to suggest using the unix command-line sort utility via
popen() or subprocess. My arguments were that it's written in C, has 30
years of optimizing in it, etc, etc, etc. It almost certainly has to be
faster than anything you could do in Python.
Then I tried the experiment.
Eric Snow wrote:
> On Fri, Aug 5, 2011 at 11:29 AM, Steven D'Aprano
> wrote:
[...]
>> Do you believe that this process of generating a code object and throwing
>> it away is a part of the Python language specification, which any
>> compiler must do in order to call itself "Python", or a mere
>> i
Mel wrote:
> Steven D'Aprano wrote:
>
>> There may be some other obscure built-in type that includes code objects,
>> but I can't imagine what it would be. I feel confident in saying that
>> functions, and functions alone, contain code. Even methods are just
>> wrappers around functions. Even bui
On Aug 1, 5:33 pm, aliman wrote:
> I understand that sorts are stable, so I could just repeat the whole
> sort process once for each key in turn, but that would involve going
> to and from disk once for each step in the sort, and I'm wondering if
> there is a better way.
I would consider using m
The best tool to debug this is tcpdump.
Running a packet capture whilst sending the mail will most likely shed the
most light on the subject.
--
--
http://mail.python.org/mailman/listinfo/python-list
Jack Bates wrote:
> I have two objects, and I want to replace all references to the first
> object - everywhere - with references to the second object. What can I
> try?
Another way of solving your *actual* problem.
"Replace all references to object1 with object2 instead" is a means to an
end, n
On 8/5/2011 5:51 PM, Philip Semanchuk wrote:
On Aug 5, 2011, at 6:20 PM, Tim Daneliuk wrote:
On 8/5/2011 3:42 PM, Philip Semanchuk wrote:
On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote:
On 8/5/2011 2:05 PM, Irmen de Jong said this:
On 05-08-11 19:53, Tim Daneliuk wrote:
I have a task whe
2011/8/5 Geoff Wright :
> Hi,
>
> I use Mac OSX for development but deploy on a Linux server. (Platform
> details provided below).
>
> When the locale is set to FR_CA, I am not able to display a u circumflex
> consistently across the two machines even though the default encoding is set
> to "as
On Aug 5, 2011, at 6:20 PM, Tim Daneliuk wrote:
> On 8/5/2011 3:42 PM, Philip Semanchuk wrote:
>>
>> On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote:
>>
>>> On 8/5/2011 2:05 PM, Irmen de Jong said this:
On 05-08-11 19:53, Tim Daneliuk wrote:
> I have a task where I want to create pretty
On 8/5/2011 3:42 PM, Philip Semanchuk wrote:
On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote:
On 8/5/2011 2:05 PM, Irmen de Jong said this:
On 05-08-11 19:53, Tim Daneliuk wrote:
I have a task where I want to create pretty simple one page visual
interfaces (Graphical or Text, but it needs to
> OK - it no longer crashes, but it doesn't appear to do anything. Is there
> something further I need to do to configure it? The Pyflakes tab does
> appear in the message window and I've created a new testpyflakes.py with
> code similar to your example.
OK, so there must be something wrong. Do
On Fri, Aug 5, 2011 at 11:29 AM, Steven D'Aprano
wrote:
> Eric Snow wrote:
>
>> On Fri, Aug 5, 2011 at 8:36 AM, Steven D'Aprano
>> wrote:
>>> Eric Snow wrote:
>>>
In Python, three types of objects have special syntax and mechanics
for their instantiation, during which a code object is g
On 2011-08-05, gervaz wrote:
> Hi all, is there a way to retrive the function name like with
> self.__class__.__name__?
Not really. There may not be any such thing as "the function name". A
function may have zero names, it may have a dozen names. It may have
names but only in namespaces that a
New to python and would like to test network/sockets with it.
I am having a problem where I have setup the following:
import socket, sys, struct
HOST = '1.1.1.1'
PORT = 153
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
data = struct.unpack('!I',s.recv(4))[0]
s.c
On Fri, Aug 5, 2011 at 11:07 AM, Geoff Wright wrote:
> Hi,
>
> I use Mac OSX for development but deploy on a Linux server. (Platform
> details provided below).
>
> When the locale is set to FR_CA, I am not able to display a u circumflex
> consistently across the two machines even though the def
On Fri, Aug 5, 2011 at 11:52 AM, gervaz wrote:
> Hi all, is there a way to retrive the function name like with
> self.__class__.__name__?
>
> Using self.__dict__.__name__ I've got
>
def test():
> ... print(self.__dict__.__name__)
> ...
Er, where did `self` magically come from?
test
Nevermind. I figured it out (d'oh!).
I had to append to `os.environ['PATH']`, not `sys.path`!
~/santa
On Fri, Aug 5, 2011 at 2:13 PM, Santoso Wijaya wrote:
> Hi,
>
> Can anyone enlighten me to the search path mechanism in ctypes'
> LoadLibrary? I have a DLL that resides elsewhere that is not
Hi,
Can anyone enlighten me to the search path mechanism in ctypes' LoadLibrary?
I have a DLL that resides elsewhere that is not in any default search path.
I tried adding the path to `sys.path` before attempting to load said DLL but
I still get "WindowsError: [Error 126] The specified module coul
On 8/5/2011 4:22 AM, Thomas Jollans wrote:
On 05/08/11 09:20, Eric Snow wrote:
Object available during code object execution:
(M) no
(C) no
(F) no
(F) yes.
cf. recursion.
Recursion only happens through runtime name resolution, not through
direct access to the function or code object from wi
In John Gordon writes:
> In Jack Bates
> writes:
> > I have two objects, and I want to replace all references to the first
> > object - everywhere - with references to the second object. What can I
> > try?
> The simplest answer to your question is to assign object2 to object1
I think I ha
In Jack Bates
writes:
> I have two objects, and I want to replace all references to the first
> object - everywhere - with references to the second object. What can I
> try?
The simplest answer to your question is to assign object2 to object1
at the very beginning of your code, but that is a v
On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote:
> On 8/5/2011 2:05 PM, Irmen de Jong said this:
>> On 05-08-11 19:53, Tim Daneliuk wrote:
>>> I have a task where I want to create pretty simple one page visual
>>> interfaces (Graphical or Text, but it needs to run across Windows,
>>> Cygwin, Linux
On 8/5/2011 12:37 PM Jack Bates said...
I have two objects, and I want to replace all references to the first
object - everywhere - with references to the second object. What can I
try?
Start with a proxy to your first and have it swap in to the second?
EMile
--
http://mail.python.org/mailma
On Fri, Aug 5, 2011 at 3:37 PM, Jack Bates wrote:
> I have two objects, and I want to replace all references to the first
> object - everywhere - with references to the second object. What can I
> try?
If using PyPy instead of CPython is an option, the "thunk" object
space's "become" function can
On 8/5/2011 11:52 AM gervaz said...
Hi all, is there a way to retrive the function name like with
self.__class__.__name__?
yes, but not reliably:
Python 2.6.4rc2 (r264rc2:75497, Oct 20 2009, 02:55:11)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
On 8/5/2011 2:05 PM, Irmen de Jong said this:
> On 05-08-11 19:53, Tim Daneliuk wrote:
>> I have a task where I want to create pretty simple one page visual
>> interfaces (Graphical or Text, but it needs to run across Windows,
>> Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more
>> t
On 8/5/2011 10:53 AM Tim Daneliuk said...
I have a task where I want to create pretty simple one page visual
interfaces (Graphical or Text, but it needs to run across Windows,
Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more
than option checklists and text fields.
I'm not happen
On 8/5/2011 11:58 AM Filip Gruszczyński said...
fyi - the downloaded geany-pyflakes-1.0.tar.gz is in fact not gzipped and
should either be gizzped or simply named geany-pyflakes-1.0.tar.
However, after activating the plugin, asking geany for a new file breaks
geany and it rudely closes so I'm un
I have two objects, and I want to replace all references to the first
object - everywhere - with references to the second object. What can I
try?
--
http://mail.python.org/mailman/listinfo/python-list
On 05-08-11 19:53, Tim Daneliuk wrote:
I have a task where I want to create pretty simple one page visual
interfaces (Graphical or Text, but it needs to run across Windows,
Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more
than option checklists and text fields. Conceptually somet
> fyi - the downloaded geany-pyflakes-1.0.tar.gz is in fact not gzipped and
> should either be gizzped or simply named geany-pyflakes-1.0.tar.
>
> However, after activating the plugin, asking geany for a new file breaks
> geany and it rudely closes so I'm unable to actually do anything with it.
I
Hi all, is there a way to retrive the function name like with
self.__class__.__name__?
Using self.__dict__.__name__ I've got
>>> def test():
... print(self.__dict__.__name__)
...
>>> test
But I really just want the function name, so 'test'
Any help?
Thanks,
Mattia
--
http://mail.python.
Steven D'Aprano wrote:
> There may be some other obscure built-in type that includes code objects,
> but I can't imagine what it would be. I feel confident in saying that
> functions, and functions alone, contain code. Even methods are just
> wrappers around functions. Even built-in functions like
Hi,
I use Mac OSX for development but deploy on a Linux server. (Platform details
provided below).
When the locale is set to FR_CA, I am not able to display a u circumflex
consistently across the two machines even though the default encoding is set to
"ascii" on both machines. Specifically,
I have a task where I want to create pretty simple one page visual
interfaces (Graphical or Text, but it needs to run across Windows,
Cygwin, Linux,*BSD, OSX ...). These interfaces are nothing more
than option checklists and text fields. Conceptually something like:
Please Select
On Fri, Aug 5, 2011 at 6:31 PM, Sells, Fred
wrote:
> After the completion of most training courses, the students are not yet
> ready to make a meaningful contribution to the community.
That's quite possibly true, but they may very well be in a position to
recognize a documentation error/omission
After the completion of most training courses, the students are not yet
ready to make a meaningful contribution to the community.
Yet your goal of getting them involved in the community is worthwhile.
I would think learning to use the community as a resource to solve a
problem that is not bas
Eric Snow wrote:
> On Fri, Aug 5, 2011 at 8:36 AM, Steven D'Aprano
> wrote:
>> Eric Snow wrote:
>>
>>> In Python, three types of objects have special syntax and mechanics
>>> for their instantiation, during which a code object is generated:
>>> modules, classes, and functions.
>>
>> I believe you
On 8/5/2011 9:14 AM Filip Gruszczyński said...
Hello everyone,
I have just published a small plugin for Geany IDE that adds Pyflakes
error detection to the editor. If there are people using Geany for
Python development I would be very grateful for opinions and
suggestions.
The plugin can be fou
On Fri, Aug 5, 2011 at 8:36 AM, Steven D'Aprano
wrote:
> Eric Snow wrote:
>
>> In Python, three types of objects have special syntax and mechanics
>> for their instantiation, during which a code object is generated:
>> modules, classes, and functions.
>
> I believe you are labouring under a misapp
Hello everyone,
I have just published a small plugin for Geany IDE that adds Pyflakes
error detection to the editor. If there are people using Geany for
Python development I would be very grateful for opinions and
suggestions.
The plugin can be found here: http://code.google.com/p/geany-pyflakes/
On Thu, 04 Aug 2011 21:52:45 +0200, Christoph Hansen
wrote:
> MRAB schrieb:
>
>> The value is MSB * 100 + (LSB>> 4) * 10 + (LSB& 0xF)
>
> i would say
>
> (MSB >> 4)*100 + (MSB & 0xF)*10 + (LSB >> 4)
>
> but who knows
I concur. I think the documentation is trying to say that the
low-order nibb
Chris Angelico wrote:
> On Fri, Aug 5, 2011 at 1:40 AM, Dan Stromberg wrote:
> print int(hex(0x72).replace('0x', ''))
>> 72
>
> Or simpler: int(hex(0x72)[2:])
>
> Although if you have it as a string, you need to ord() the string.
Or use str.encode():
>>> int("\x72".encode("hex"))
72
>>> i
On Fri, Aug 5, 2011 at 1:40 AM, Dan Stromberg wrote:
print int(hex(0x72).replace('0x', ''))
> 72
Or simpler: int(hex(0x72)[2:])
Although if you have it as a string, you need to ord() the string.
It's probably better to just do the bitwise operations though.
ChrisA
--
http://mail.python.o
python-list@python.org:
hi ,everyone,
i want to scrap something from
http://search.dangdang.com/search_pub.php?key=python
my code is :
import urllib
import lxml.html
down='http://search.dangdang.com/search_pub.php?key=python'
file=urllib.urlopen(down).read()
root=lxml.html.fromstring(file)
tnodes
First, s.recv(4) is not guaranteed to always return 4 bytes. It could
return 0, 1, 2, 3, or 4, wtih 4 being the most likely. To deal with this, I
tend to use http://stromberg.dnsalias.org/~dstromberg/bufsock.html - but I
suspect that Twisted has a way of dealing with it too.
Then, to put your da
Billy Mays wrote:
> The reason I used stdout was because I was going to be using it in a
> tool chain where the stdout might need to be formatted for another
> program to read in.
print writes to sys.stdout unless you tell it different.
>>> import sys
>>> import StringIO
>>> capture = StringIO.S
Chris Angelico wrote:
> On Fri, Aug 5, 2011 at 9:22 AM, Thomas Jollans wrote:
>> On 05/08/11 09:20, Eric Snow wrote:
>>> Object available during code object execution:
>>> (M) no
>>> (C) no
>>> (F) no
>> (F) yes.
>>
>> cf. recursion.
>
> Is it? As I understand it, a Python function is not able t
On 08/04/2011 10:03 PM, Chris Angelico wrote:
On Fri, Aug 5, 2011 at 1:34 AM, Steven D'Aprano
wrote:
Especially for a tool aimed at programmers (who else would be interested in
PyWhich?)
The use that first springs to my mind is debugging import paths etc.
If you have multiple pythons install
Eric Snow wrote:
> In Python, three types of objects have special syntax and mechanics
> for their instantiation, during which a code object is generated:
> modules, classes, and functions.
I believe you are labouring under a misapprehension. Modules and classes
don't generate code objects.
Th
In <4e3bf554$0$29976$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano
writes:
> Doh! I *always* conflate env and which. Thank you for the correction.
Way to say "conflate"! :-)
--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for B
On 05/08/2011 14:51, Steven D'Aprano wrote:
Tim Chase wrote:
On 08/04/2011 07:34 PM, Steven D'Aprano wrote:
Billy Mays wrote:
#!/usr/bin/python
I believe the recommended, platform independent hash-bang line is
#!/usr/bin/which python
I think you mean
#!/usr/bin/env python
Doh! I
Tim Chase wrote:
> On 08/04/2011 07:34 PM, Steven D'Aprano wrote:
>> Billy Mays wrote:
>>> #!/usr/bin/python
>>
>> I believe the recommended, platform independent hash-bang line is
>>
>> #!/usr/bin/which python
>
> I think you mean
>
>#!/usr/bin/env python
Doh! I *always* conflate env and
I was not sure if this message was sent before my membership was accepted.
Please disregard if it's a duplicate.
Thanks
Begin forwarded message:
> From: Johnny Venter
> Date: August 5, 2011 8:15:53 AM EDT
> To: python-list@python.org
> Subject: Sockets: Receiving C Struct
>
> New to python an
Duncan Booth wrote:
> The descriptor protocol only works when a value is being accessed or set
> on an instance and there is no instance attribute of that name so the
> value is fetched from the underlying class.
Unlike normal class attributes a descriptor is not shaded by an instance
attribute:
Ryan wrote:
> In the context of descriptors, the __set__ method is not called for
> class attribute access. __set__ is only
> called to set the attribute on an instance instance of the owner class
> to a new value, value. WHY? Is there some other mechanism for
> accomplishing this outcome. This s
This recipe:
http://code.activestate.com/recipes/576780-timeout-for-nearly-any-callable/
Claims that a Python thread can be stopped by executing the private
method "Thread._Thread__stop". I don't think this is true, since
_Thread__stop doesn't really stop or kill the thread. In conformance
to the
Ryan wrote:
> In the context of descriptors, the __set__ method is not called for
> class attribute access. __set__ is only
> called to set the attribute on an instance instance of the owner class
> to a new value, value. WHY? Is there some other mechanism for
> accomplishing this outcome. This su
On Fri, Aug 5, 2011 at 9:22 AM, Thomas Jollans wrote:
> On 05/08/11 09:20, Eric Snow wrote:
>> Object available during code object execution:
>> (M) no
>> (C) no
>> (F) no
> (F) yes.
>
> cf. recursion.
Is it? As I understand it, a Python function is not able to reference
"itself" but must referen
In the context of descriptors, the __set__ method is not called for
class attribute access. __set__ is only
called to set the attribute on an instance instance of the owner class
to a new value, value. WHY? Is there some other mechanism for
accomplishing this outcome. This subtle difference from __
Dear All,
I have developed a C++ server application which handles requests coming in
from my web server. The server application is capable of handling multiple
users at a time. Each user has a session object. Each user also has some
variables associated with it. These variables are maintained in t
On 05/08/11 09:20, Eric Snow wrote:
> Object available during code object execution:
> (M) no
> (C) no
> (F) no
(F) yes.
cf. recursion.
--
http://mail.python.org/mailman/listinfo/python-list
In Python, three types of objects have special syntax and mechanics
for their instantiation, during which a code object is generated:
modules, classes, and functions. Each has its own role to play and
the differences between them mostly reflect that. Here are some
observations (based on default b
71 matches
Mail list logo