Hi!
Another way :
# -*- coding: utf-8 -*-
import unicodedata
def test_ascii(struni):
strasc=unicodedata.normalize('NFD', struni).encode('ascii','replace')
if len(struni)==len(strasc):
return True
else:
return False
print test_ascii(u"abcde")
prin
On Aug 21, 1:33 am, Steven D'Aprano wrote:
> On Fri, 20 Aug 2010 11:01:42 -0700, Russ P. wrote:
> > Most programmers probably never use vectors and matrices, so they don't
> > care about the inconsistency with standard mathematical notation.
>
> Perhaps you should ask the numpy programmers what th
On 16 Αύγ, 14:31, Peter Otten <__pete...@web.de> wrote:
> Νίκος wrote:
> > # initializecookie
> >cookie=Cookie.SimpleCookie()
> >cookie.load( os.environ.get('HTTP_COOKIE', '') )
> > mycookie =cookie.get('visitor')
>
> > if ( mycookie and mycookie.value != 'nikos' ) or re.search( r'(cyta|
> > yandex
On Sun, Aug 22, 2010 at 12:23 AM, Russ P. wrote:
> On Aug 21, 1:33 am, Steven D'Aprano cybersource.com.au> wrote:
>> On Fri, 20 Aug 2010 11:01:42 -0700, Russ P. wrote:
>> > Most programmers probably never use vectors and matrices, so they don't
>> > care about the inconsistency with standard math
Here is a function which takes any list and creates a freq table,
which can be printed unsorted, sorted by cases or items. It's supposed
to mirror the proc freq in SAS.
Dirk
def freq(seq,order='unsorted',prin=True):
#order can be unsorted, cases, items
freq={}
for s in seq:
i
On Sun, Aug 22, 2010 at 1:31 PM, Dirk Nachbar wrote:
> Here is a function which takes any list and creates a freq table,
> which can be printed unsorted, sorted by cases or items. It's supposed
> to mirror the proc freq in SAS.
>
> Dirk
>
> def freq(seq,order='unsorted',prin=True):
>#order ca
On Sun, Aug 22, 2010 at 1:16 AM, Shashwat Anand
wrote:
> On Sun, Aug 22, 2010 at 1:31 PM, Dirk Nachbar wrote:
>> Here is a function which takes any list and creates a freq table,
>> which can be printed unsorted, sorted by cases or items. It's supposed
>> to mirror the proc freq in SAS.
>>
>> Dir
I have wrote a python script and want to run it before user login. To do that,
I
have added it to the ubuntu startup file (init.d). However it seems that the
script doesn't work.
I want to know does python modules work before user login?
// Naderan *Mahmood;
--
http://mail.python.o
On Sun, Aug 22, 2010 at 1:52 AM, Mahmood Naderan wrote:
> I have wrote a python script and want to run it before user login. To do
> that, I have added it to the ubuntu startup file (init.d). However it seems
> that the script doesn't work.
Specify exactly how it's not working.
Cheers,
Chris
--
Hi there,
I am trying to understand how xdrlib works as I want to read files in this
format. The problem is I don't much about xdr (although I read
http://docs.python.org/library/xdrlib.html and RFC 1832).
Another problem is I don't know how the file I want to read was encoded.
So when I do some
>Specify exactly how it's not working.
I have wrote a script to send my ip address to an email address. It does work
when I am login (python sendip.py). I then followed the procedure in
https://help.ubuntu.com/community/RcLocalHowto. However after restart, no email
is sent.
// Naderan *Mahmoo
I think there is a small point here.
>>> sys.version
2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
>>> print unichr.__doc__
unichr(i) -> Unicode character
Return a Unicode string of one character with ordinal i; 0 <= i <=
0x10.
>>> # but
>>> unichr(0x10fff)
Traceback (mos
Hi,
All the group members right at here, we people recently lunched a
website CodeSnipr based on Computer language like (PHP, RUBBY, HTML,
CSS, MYSQL, JQURY, IPHONE DEVELOPMENT, JAVASCRIPT, C++,.NET,XML,C#
etc.). CodeSnipr will provide you access to user generated tutorials.
Here you can post
On Sunday 22 August 2010, it occurred to jmfauth to exclaim:
> I think there is a small point here.
>
> >>> sys.version
>
> 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
>
> >>> print unichr.__doc__
>
> unichr(i) -> Unicode character
>
> Return a Unicode string of one char
jmfauth wrote:
I think there is a small point here.
sys.version
2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)]
print unichr.__doc__
unichr(i) -> Unicode character
Return a Unicode string of one character with ordinal i; 0 <= i <=
0x10.
# b
On Sunday 22 August 2010, it occurred to Alan Wilter Sousa da Silva to
exclaim:
> Hi there,
>
> I am trying to understand how xdrlib works as I want to read files in this
> format. The problem is I don't much about xdr (although I read
> http://docs.python.org/library/xdrlib.html and RFC 1832).
>
On Sunday 22 August 2010, it occurred to Mahmood Naderan to exclaim:
> >Specify exactly how it's not working.
>
> I have wrote a script to send my ip address to an email address. It does
> work when I am login (python sendip.py). I then followed the procedure in
> https://help.ubuntu.com/community
Module download at SourceForge http://yserial.sourceforge.net
Documentation has been revised and v0.60 released.
Serialization + persistance :: in a few lines of code, compress and
annotate Python objects into SQLite; then later retrieve them
chronologically by keywords without any SQL. Most usefu
On Aug 22, 5:07 pm, "Michel Claveau -
MVP" wrote:
> Hi!
>
> Another way :
>
> # -*- coding: utf-8 -*-
>
> import unicodedata
>
> def test_ascii(struni):
> strasc=unicodedata.normalize('NFD', struni).encode('ascii','replace')
> if len(struni)==len(strasc):
> return True
>
i'm new to ctypes. can someone help me use sdl_pango with python?
here's the documentation: http://sdlpango.sourceforge.net/
here's my code:
-
import pygame
from ctypes import *
import win32api
MATRIX_TRANSPARENT_BACK_WHITE_LETTER = c_char_p("
Dirk Nachbar wrote:
> Here is a function which takes any list and creates a freq table,
> which can be printed unsorted, sorted by cases or items. It's supposed
> to mirror the proc freq in SAS.
>
> Dirk
>
> def freq(seq,order='unsorted',prin=True):
> #order can be unsorted, cases, items
>
I am trying to execute this script before login:
#!/bin/sh
date > /home/mahmood/dateatboot.txt
echo "In local file"
/usr/bin/python2.6 /home/mahmood/sendip.py
echo "python script finished"
after restart, dateatboot.txt was created shows that the script was executed.
In the python file, I have th
On Sunday 22 August 2010, it occurred to Mahmood Naderan to exclaim:
> I am trying to execute this script before login:
>
> #!/bin/sh
> date > /home/mahmood/dateatboot.txt
> echo "In local file"
> /usr/bin/python2.6 /home/mahmood/sendip.py
> echo "python script finished"
> after restart, dateatb
It seems that changing the directory before python command is mandatory:
#!/bin/sh
cd /home/mahmood/
python sendip.py
I am now able to receive the IP address right after boot and before login page.
Thank you
// Naderan *Mahmood;
From: Thomas Jollans
To: py
On 2010-08-21, Steven D'Aprano wrote:
> There is room in the world for programming languages aimed at
> non- programmers (although HC is an extreme case), but not all
> languages should prefer the intuition of non-programmers over
> other values.
Extremer: Inform 7.
--
Neil Cerutti
--
http://m
Short comments:
1) I'm aware Python can be built in "ucs2" or "ucs4" mode. It remains
that the unichr doc string does not seem correct.
2) 0x0 versus 0
Do not take this too seriously. Sure the value of 0x0 and 0 are equal,
but the "unit" sounds strange.
Eg. If a is a length, I would not express a
Hello all,
I'm looking for a method, lib, ... to create a windows hook to catch
WM_CREATE message in python 2.6?
For keyboard and mouse I use pyHook.
any idea ?
--
Jacques
--
http://mail.python.org/mailman/listinfo/python-list
Re !
> Try your code with u"abcd\xa1" ... it says it's ASCII.
Ah? in my computer, it say "False"
@-salutations
--
MCi
--
http://mail.python.org/mailman/listinfo/python-list
John Bokma writes:
> David Kastrup writes:
>
>> John Passaniti writes:
>>
>>> Amen! All this academic talk is useless. Who cares about things like
>>> the big-O notation for program complexity. Can't people just *look*
>>> at code and see how complex it is?! And take things like the years o
Over the years, I've tried different styles of organizing unit tests.
I used to create a test directory and put all my tests there. I would
maintain a one-to-one correspondence between production source and test
source, i.e. the test code for foo.py would be in test/foo.py.
More recently, I've
Well, login plain did the job:
session = smtplib.SMTP(smtpserver)
session.ehlo()
session.esmtp_features["auth"] = "LOGIN PLAIN"if AUTHREQUIRED:
session.login(smtpuser, smtppass)
// Naderan *Mahmood;
From: Mahmood Naderan
To: python mailing list
Sent: F
level: beginners
I was trying to write simple code that compares 2 tuples and returns
any element in the second tuple that is not in the first tuple.
def tuples(t1, t2):
result = []
for b in t2:
for a in t1:
if b == a:
break
else:
re
Steven D'Aprano writes:
> * It throws away information from tracebacks if the recursive function
> fails; and
[...]
> If you're like me, you're probably thinking that the traceback from an
> exception in a recursive function isn't terribly useful.
Agreed. On the other hand, a full-fledged tai
On 08/22/10 12:50, Baba wrote:
level: beginners
I was trying to write simple code that compares 2 tuples and returns
any element in the second tuple that is not in the first tuple.
def tuples(t1, t2):
result = []
for b in t2:
for a in t1:
if b == a:
David Kastrup writes:
> John Bokma writes:
>
>> David Kastrup writes:
>>
>>> John Passaniti writes:
>>>
Amen! All this academic talk is useless. Who cares about things like
the big-O notation for program complexity. Can't people just *look*
at code and see how complex it is?!
VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud
computing, has been released. Please visit
https://sourceforge.net/projects/vtd-xml/files/
to download the latest version.
* Strict Conformance
# VTD-XML now fully conforms to XML namespace 1.0 spec
* Performance Improv
Steven D'Aprano writes:
> On Sat, 21 Aug 2010 19:09:52 -0500, John Bokma wrote:
>
>> this means that Python should eliminate / optimize tail
>> recursion.
>
> There have been various suggestions to add tail recursion optimization to
> the language. Two problems:
[snip]
> But this is not the on
In my shopzeus.db.pivot.convert.py file, in the run() method of my
Data2Facts class, I can write this into the docstring:
class Data2Facts(threading.Thread):
# code here...
def prepare(self,*args):
# code here...
# more code here
def run(self):
"""
Star
On Aug 22, 12:47 am, Chris Rebert wrote:
> On Sun, Aug 22, 2010 at 12:23 AM, Russ P. wrote:
> > On Aug 21, 1:33 am, Steven D'Aprano > cybersource.com.au> wrote:
> >> On Fri, 20 Aug 2010 11:01:42 -0700, Russ P. wrote:
> >> > Most programmers probably never use vectors and matrices, so they don't
On Aug 22, 7:12 pm, Tim Chase wrote:
> On 08/22/10 12:50, Baba wrote:
>
>
>
> > level: beginners
>
> > I was trying to write simple code that compares 2 tuples and returns
> > any element in the second tuple that is not in the first tuple.
>
> > def tuples(t1, t2):
> > result = []
> > fo
On 8/21/2010 8:32 PM, Steven D'Aprano wrote:
On Sat, 21 Aug 2010 19:09:52 -0500, John Bokma wrote:
this means that Python should eliminate / optimize tail
recursion.
There have been various suggestions to add tail recursion optimization to
the language. Two problems:
* It throws away inform
Thanks a lot, this was the solution.
It would be greate, if you could also show me a way to extract the
inserted binary object from the table on the server to a file on a client.
> Peter Otten wrote:
Julia Jacobson wrote:
Hello everybody out there using python,
For the insertion of pictures
Le Sun, 22 Aug 2010 20:12:36 +0200, John Bokma a
écrit:
David Kastrup writes:
John Bokma writes:
David Kastrup writes:
John Passaniti writes:
Amen! All this academic talk is useless. Who cares about things
like
the big-O notation for program complexity. Can't people just *l
On Sunday 22 August 2010, it occurred to Julia Jacobson to exclaim:
> Thanks a lot, this was the solution.
> It would be greate, if you could also show me a way to extract the
> inserted binary object from the table on the server to a file on a client.
Probably something along the lines of:
* exe
On Aug 23, 1:10 am, "Michel Claveau -
MVP" wrote:
> Re !
>
> > Try your code with u"abcd\xa1" ... it says it's ASCII.
>
> Ah? in my computer, it say "False"
Perhaps your computer has a problem. Mine does this with both Python
2.7 and Python 2.3 (which introduced the unicodedata.normalize
function
Thomas Jollans wrote:
What if "set" has side effects? A
compiler could only exclude this possibility if it knew exactly what "set"
will be at run time,
And also that 'a' remains bound to the same object, and that
object or anything reachable from it is not mutated in
any way that could affect
I understand the concept of a static method.
However I don't know what is a class method.
Would anybody pls. explain me?
class C:
@classmethod
def ...
...
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva
wrote:
> I understand the concept of a static method.
> However I don't know what is a class method.
> Would anybody pls. explain me?
Please read this first:
http://docs.python.org/library/functions.html#classmethod
Then ask us questions :)
cheer
Em 23-08-2010 04:30, James Mills escreveu:
> On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva
> wrote:
>> I understand the concept of a static method.
>> However I don't know what is a class method.
>> Would anybody pls. explain me?
>
> Please read this first:
> http://docs.python.org/library/fun
On Mon, Aug 23, 2010 at 1:53 PM, Paulo da Silva
wrote:
> I did it before posting ...
> The "explanation" is not very clear. It is more like "how to use it".
Without going into the semantics of languages basically the
differences are quite clear:
@classmethod is a decorator that warps a function
On Sun, Aug 22, 2010 at 9:53 PM, Paulo da Silva
wrote:
> Em 23-08-2010 04:30, James Mills escreveu:
>> On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva
>> wrote:
>>> I understand the concept of a static method.
>>> However I don't know what is a class method.
>>> Would anybody pls. explain me?
>>
On 8/22/2010 11:53 PM, Paulo da Silva wrote:
Please read this first:
http://docs.python.org/library/functions.html#classmethod
Then ask us questions :)
I did it before posting ...
When you ask a question, it help people answer if they know what you
have already tried and failed with ;-)
On 8/22/2010 9:16 PM, James Mills wrote:
On Mon, Aug 23, 2010 at 1:53 PM, Paulo da Silva
wrote:
I did it before posting ...
The "explanation" is not very clear. It is more like "how to use it".
Without going into the semantics of languages basically the
differences are quite clear:
@classme
53 matches
Mail list logo