On Thu, 29 Jul 2010 23:49:40 +, Steven D'Aprano wrote:
> It looks to me like Python uses a 16-bit implementation internally,
It typically uses the platform's wchar_t, which is 16-bit on Windows and
(typically) 32-bit on Unix.
IIRC, it's possible to build Python with 32-bit Unicode on Windows
On Jul 29, 12:39 pm, "Benjamin J. Racine"
wrote:
> I am trying to combine the ability to move line-by-line through the code as
> is done with pdb's "next" function with ipython's ability to list all
> variables at once... without the use of a full-fledged IDE.
>
> I am not seeing how this might
I've already posted this in the Python W32 list, but didn't get what
I'm looking for.
I want to know how to disable Remote Desktop after logging to into a
remote machine,
to prevent subsequent logins by other users logging me out.
I currently have a Windows XP system configured for coworkers to
"Joe Goldthwaite" wrote in message
news:5a04846ed83745a8a99a944793792...@newmbp...
Hi Steven,
I read through the article you referenced. I understand Unicode better
now.
I wasn't completely ignorant of the subject. My confusion is more about
how
Python is handling Unicode than Unicode its
Someone should port Perl's Benchmark.pm module to python that's such a useful
module to measure a functions execution time and CPU usage.
Sent from my iPhone 4.
On Jul 29, 2010, at 3:43 PM, "Benjamin J. Racine" wrote:
> I just use ipython's functions (that are themselves just calls to the tim
On Thu, 29 Jul 2010 11:14:24 -0700, Ethan Furman wrote:
> Don't think of unicode as a byte stream. It's a bunch of numbers that
> map to a bunch of symbols.
Not only are Unicode strings a bunch of numbers ("code points", in
Unicode terminology), but the numbers are not necessarily all the same
In article <4c3ff6f7$0$11101$c3e8...@news.astraweb.com>,
Steven D'Aprano wrote:
>
>Remember that doctests aren't intended for a comprehensive test suite.
WDYM not intended? Disagree with Tim Peters much? ;-)
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
".
On Thu, 29 Jul 2010 19:29:24 +0200, Jean-Michel Pichavant wrote:
> Steven D'Aprano wrote:
>> [snip]
>>
>> super() is just as explicit as len(), or str.upper(). It says,
>> explicitly, that it will call the method belonging to one or more
>> superclass of the given class.
>>
> Come on Steven, yo
ANUSHKA HOT PICTURES FOR BOLLYWOOD FANS
-
http://sites.google.com/site/anushkaphotosalert
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 29 Jul 2010 21:43:05 +0300, Nick Raptis wrote:
> On 07/29/2010 09:12 PM, wheres pythonmonks wrote:
>> How do I build an "int1" type that has a default value of 1?
> You mean something like:
> >>> x = int()
> >>> x
> 0
> >>> def myint(value=1):
> ... return int(value)
> ...
> >>> my
On Thu, Jul 29, 2010 at 9:13 AM, Antoine Pitrou wrote:
> On Wed, 28 Jul 2010 22:23:48 -0700
> geremy condra wrote:
>> >
>> > The new Python SSL module in 2.6 and later has a huge built-in
>> > security hole - it doesn't verify the domain against the
>> > certificate. As someone else put it, th
I just use ipython's functions (that are themselves just calls to the time
module functions) for timing my functions...
Enter:
%timeit?
or
%time
At the Ipython command prompt to get started.
Ben R.
On Jul 29, 2010, at 7:43 AM, D'Arcy J.M. Cain wrote:
> On Thu, 29 Jul 2010 08:45:23 -0400
> Jo
I am trying to combine the ability to move line-by-line through the code as is
done with pdb's "next" function with ipython's ability to list all variables at
once... without the use of a full-fledged IDE.
I am not seeing how this might be done. Many thanks for your help...
Ben Racine
--
http
John Nagle wrote:
On 7/28/2010 3:58 PM, Joe Goldthwaite wrote:
This still seems odd to me. I would have thought that the unicode
function
would return a properly encoded byte stream that could then simply be
written to disk. Instead it seems like you have to re-encode the byte
stream
to some
> Inheriting from "int" is not too helpful, because you can't assign
> to the value of the base class. "self=1" won't do what you want.
It's useful if you remember that you can set the default value by
overwriting __new__.
>>> class int1(int):
... def __new__(cls, value=1):
... retur
On 7/29/2010 11:12 AM, wheres pythonmonks wrote:
Why is the default value of an int zero?
x = int
print x
x()
0
How do I build an "int1" type that has a default value of 1?
>>> class int1(object) :
...def __init__(self) :
... self.val = 1
...def __call__(self) :
...
On 7/28/2010 3:58 PM, Joe Goldthwaite wrote:
This still seems odd to me. I would have thought that the unicode function
would return a properly encoded byte stream that could then simply be
written to disk. Instead it seems like you have to re-encode the byte stream
to some kind of escaped Ascii
On 7/28/10 4:57 PM, Robert Faryabi wrote:
Hi there;
I'm using Tabular Package for manipulating tab-delimited data.
There is a small problem that I cannot get my head around it.
When I construct my tabarray from file, the black fields are replaced by "nan".
Does any one knows how to just keep th
On 7/29/2010 11:08 AM, Shailendra wrote:
Hi All,
I have a following situation.
==PSUDO CODE START==
class holds_big_array:
big_array #has a big array
def get_some_element(self, cond) # return some data from the array
from the big array
=
On 07/29/2010 09:12 PM, wheres pythonmonks wrote:
How do I build an "int1" type that has a default value of 1?
You mean something like:
>>> x = int()
>>> x
0
>>> def myint(value=1):
... return int(value)
...
>>> myint()
1
>>>
That's ugly on so many levels..
Anyway, basic types (and almost
Joe Goldthwaite wrote:
Hi Ulrich,
Ascii.csv isn't really a latin-1 encoded file. It's an ascii file with a
few characters above the 128 range . . .
It took me a while to get this point too (if you already have "gotten
it", I apologize, but the above comment leads me to believe you haven't).
Thanks. I presume this will work for my nested example as well. Thanks again.
On Thu, Jul 29, 2010 at 2:18 PM, Paul Rubin wrote:
> wheres pythonmonks writes:
>> How do I build an "int1" type that has a default value of 1?
>> [Hopefully no speed penalty.]
>> I am thinking about applications wit
wheres pythonmonks writes:
> How do I build an "int1" type that has a default value of 1?
> [Hopefully no speed penalty.]
> I am thinking about applications with collections.defaultdict.
You can supply an arbitary function to collections.defaultdict.
It doesn't have to be a class. E.g.
d =
On Thu, Jul 29, 2010 at 10:59 AM, Joe Goldthwaite wrote:
> Hi Ulrich,
>
> Ascii.csv isn't really a latin-1 encoded file. It's an ascii file with a
> few characters above the 128 range that are causing Postgresql Unicode
> errors. Those characters work fine in the Windows world but they're not th
The first thing that is generically tried when wishing to measure how
long certain parts take is to record your own time snapshots in the code
yourself. take the current time before an operation, take it after,
subract, report it to yourself.
Also, try working with an array that is actually b
Joe Goldthwaite wrote:
Hi Steven,
I read through the article you referenced. I understand Unicode better now.
I wasn't completely ignorant of the subject. My confusion is more about how
Python is handling Unicode than Unicode itself. I guess I'm fighting my own
misconceptions. I do that a lot
Why is the default value of an int zero?
>>> x = int
>>> print x
>>> x()
0
>>>
How do I build an "int1" type that has a default value of 1?
[Hopefully no speed penalty.]
I am thinking about applications with collections.defaultdict.
What if I want to make a defaultdict of defaultdicts of lists?
Hi All,
I have a following situation.
==PSUDO CODE START==
class holds_big_array:
big_array #has a big array
def get_some_element(self, cond) # return some data from the array
from the big array
==PSUDO CODE END
I wanted
Hi Ulrich,
Ascii.csv isn't really a latin-1 encoded file. It's an ascii file with a
few characters above the 128 range that are causing Postgresql Unicode
errors. Those characters work fine in the Windows world but they're not the
correct byte representation for Unicode. What I'm attempting to d
HELP! :)
I am trying to output the following program's output to either a file or
variable, how can this be done?
# Writing the output to a standard argv argument
#1/usr/bin/python
import sys
for arg in sys.argv:
print arg
#END
Thanks,
Paul
--
http://mail.python.org/mailman/li
Hi Steven,
I read through the article you referenced. I understand Unicode better now.
I wasn't completely ignorant of the subject. My confusion is more about how
Python is handling Unicode than Unicode itself. I guess I'm fighting my own
misconceptions. I do that a lot. It's hard for me to un
Steven D'Aprano wrote:
[snip]
super() is just as explicit as len(), or str.upper(). It says,
explicitly, that it will call the method belonging to one or more
superclass of the given class.
Come on Steven, you're better than this :) .
Everybody can accurately guess what len and upper are d
hi,
recently I switched to ubuntu jaunty and installed python 2.6.I
installed lib-tk so that I can work on my gui apps using Tix and
Tkinter.But ,it seems that the python version in jaunty ships a buggy
tix version which gives a 'TclError:unknown color' error message (this
happens when I try to use
On Wed, 28 Jul 2010 22:23:48 -0700
geremy condra wrote:
> >
> > The new Python SSL module in 2.6 and later has a huge built-in
> > security hole - it doesn't verify the domain against the
> > certificate. As someone else put it, this means "you get to
> > talk securely with your attacker." As l
On 7/28/2010 10:23 PM, geremy condra wrote:
On Wed, Jul 28, 2010 at 10:08 PM, John Nagle wrote:
On 7/28/2010 6:26 PM, geremy condra wrote:
On Wed, Jul 28, 2010 at 4:41 PM, Jeffrey
Gaynorwrote:
The new Python SSL module in 2.6 and later has a huge built-in
security hole - it doesn't
On Jul 28, 7:45 pm, Steven D'Aprano wrote:
> On Wed, 28 Jul 2010 08:47:52 -0700, Carl Banks wrote:
> > On Jul 28, 7:32 am, Steven D'Aprano > cybersource.com.au> wrote:
> >> On Wed, 28 Jul 2010 09:35:52 -0400, wheres pythonmonks wrote:
> >> > Thanks ... I thought int was a type-cast (like in C++)
> I know very little about security, but one thing I think I know. Never
> use security software version 1.0 or greater. It was written by an
> author insufficiently paranoid.
OpenSSL 1.0.0a was released about a month ago. ;)
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Jul 29, 2010 at 10:07 AM, Jeffrey Gaynor wrote:
> ...
> A final question -- how widely is M2Crypto used? Since I will have to now
> pitch to our group that this is preferable the first questions they will ask
> are about stability, who is using it and how secure is it really, especially
On Thu, 29 Jul 2010 08:45:23 -0400
Joe Riopel wrote:
> On Thu, Jul 29, 2010 at 8:34 AM, Mahmood Naderan wrote:
> > the output should be 7600 (s) for example. What is the best and easiest way
> > to do that?
>
> Take a look at time.clock()
I don't know if that's what he wants. The clock() metho
Thank you! This is what I was looking for.
A final question -- how widely is M2Crypto used? Since I will have to now pitch
to our group that this is preferable the first questions they will ask are
about stability, who is using it and how secure is it really, especially since
it is at version
Thanks, the first method worked. However clock() doesn't.
tic = time.time()
time.sleep( 2 )
toc = time.time()
print toc - tic
Result: 2.00269889832
>Take a look at time.clock()
tic = time.clock()
time.sleep( 2 )
toc = time.clock()
print toc - tic
result: 0.0
>More importantly, the above tech
On Thu, 29 Jul 2010 12:08:54 +0200, Jean-Michel Pichavant wrote:
> Steven D'Aprano wrote:
>> That incorrect. You can certainly use super() with classic classes in
>> the hierarchy, and super() didn't even exist when they were created.
>> The problem isn't super(), and people who give glib advise
William Johnston, 29.07.2010 14:12:
I have a Python app that parses XML files and then writes to text files.
XML or HTML?
However, the output text file is "sometimes" encoded in some Asian language.
Here is my code:
encoding = "iso-8859-1"
clean_sent = nltk.clean_html(sent.text)
clean_s
On Thu, 29 Jul 2010 14:42:58 +0200, Matteo Landi wrote:
> This should be enough
>
import time
tic = time.time()
function()
toc = time.time()
print toc - tic
You're typing that in the interactive interpreter, which means the timer
is counting the seconds while you're typing s
On Thu, Jul 29, 2010 at 8:34 AM, Mahmood Naderan wrote:
> the output should be 7600 (s) for example. What is the best and easiest way
> to do that?
Take a look at time.clock()
http://docs.python.org/library/time.html#time.clock
"this is the function to use for benchmarking Python or timing algo
This should be enough
>>>import time
>>>tic = time.time()
>>>function()
>>>toc = time.time()
>>>print toc - tic
On Thu, Jul 29, 2010 at 2:34 PM, Mahmood Naderan wrote:
> Hi,
> I want to measure a function run time. I read
> http://docs.python.org/library/time.html but I am confused and don't kno
Hi,
I want to measure a function run time. I read
http://docs.python.org/library/time.html but I am confused and don't know which
one is suitable. I don't know is daylight timing important or not or is Y2K
issue important for my case or not I also don't know how epoch time is
related to
Hello,
I have a Python app that parses XML files and then writes to text files.
However, the output text file is "sometimes" encoded in some Asian language.
Here is my code:
encoding = "iso-8859-1"
clean_sent = nltk.clean_html(sent.text)
clean_sent = clean_sent.encode(encoding,
Joe Goldthwaite wrote:
> import unicodedata
>
> input = file('ascii.csv', 'rb')
> output = file('unicode.csv','wb')
>
> for line in input.xreadlines():
> unicodestring = unicode(line, 'latin1')
> output.write(unicodestring.encode('utf-8')) # This second encode
>
On 29-Jul-2010, at 2:50 PM, Hrvoje Niksic wrote:
> sturlamolden writes:
>
>> On 29 Jul, 03:47, Navkirat Singh wrote:
>>
>>> I was wondering what would be better to do some medium to heavy book
>>> keeping in memory - Ordered Dictionary or a plain simple Dictionary object??
>>
>> It depends
Jean-Michel Pichavant wrote:
Robert Kern wrote:
On 7/23/10 7:08 PM, Lawrence D'Oliveiro wrote:
In message,
Robert Kern
wrote:
There are also utilities for mounting ISOs directly without burning
them
to a physical disk.
You need special utilities to do this??
On at least some versions of
sturlamolden writes:
> On 29 Jul, 03:47, Navkirat Singh wrote:
>
>> I was wondering what would be better to do some medium to heavy book keeping
>> in memory - Ordered Dictionary or a plain simple Dictionary object??
>
> It depends on the problem. A dictionary is a hash table. An ordered
> dict
Steven D'Aprano wrote:
On Sun, 25 Jul 2010 13:58:00 +1200, Gregory Ewing wrote:
Lacrima wrote:
But what if SuperClass1 is from third party library?
If it hasn't been designed for super(), then you can't use super() with
it.
super() only works when *every* class in the hierarc
Robert Kern wrote:
On 7/23/10 7:08 PM, Lawrence D'Oliveiro wrote:
In message,
Robert Kern
wrote:
There are also utilities for mounting ISOs directly without burning
them
to a physical disk.
You need special utilities to do this??
On at least some versions of Windows, Yes.
You need the
Ben Finney wrote:
Lawrence D'Oliveiro writes:
In message <7j8w5tylmw@rapun.sel.cam.ac.uk>, Matthew Vernon wrote:
Is there a more idiomatic way of loading in a configuration file
that's python code ...
Is it really a good idea to have a configuration language that’s Turing
On Thu, 29 Jul 2010 09:21:37 +0200, Ulrich Eckhardt wrote:
> Steven D'Aprano wrote:
>> Perhaps I have been misinformed, but my understanding of C type-casts
>> is that (where possible), a cast like `int(var)` merely tells the
>> compiler to temporarily disregard the type of var and treat it as if
On Jul 28, 6:47 pm, Navkirat Singh wrote:
> I was wondering what would be better to do some medium
> to heavy book keeping in memory - Ordered Dictionary
> or a plain simple Dictionary object??
The current implementation of OrderedDict is based on regular
dictionaries, so it performance cannot be
>
>
> It depends on the problem. A dictionary is a hash table. An ordered
> dictionary is a binary search tree (BST). Those are different data
> structures.
>
> The main things to note is that:
>
> - Access is best-case O(1) for the hash table and O(log n) for the
> BST.
>
> - Worst case behavior i
Neil Cerutti wrote:
> Perhaps emailing the tests to yourself would be a good solution.
> Every tme the tests ran, you'd get a new email containing the
> results.
Nice idea, only that it's even less portable and requires manual setup...
;^)
Uli
--
Sator Laser GmbH
Geschäftsführer: Thorsten Föc
Steven D'Aprano wrote:
> Perhaps I have been misinformed, but my understanding of C type-casts is
> that (where possible), a cast like `int(var)` merely tells the compiler
> to temporarily disregard the type of var and treat it as if it were an
> int. In other words, it's a compiler instruction rat
60 matches
Mail list logo