RE: try to use unicode

2010-11-19 Thread Mikael B
Date: Sat, 20 Nov 2010 08:47:18 +0100 From: stefan.sonnenb...@pythonmeister.com To: mba...@live.se CC: python-list@python.org Subject: Re: try to use unicode Meddelandetext Am 20.11.2010 06:53, schrieb Mikael B: Hi. I'm learning python.

Re: try to use unicode

2010-11-19 Thread Stefan Sonnenberg-Carstens
Am 20.11.2010 06:53, schrieb Mikael B: Hi. I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I try to use unicode to get swedish characters. I've checked wikipedia. utf-8 is said to be an unicode encoding.. this is the test program: # -*- coding: utf-8 -*- import readline s=

Re: dict diff

2010-11-19 Thread Jin Yi
i don't think this piece of code is obscure. i think the use case is there when you know that dicta != dictb, but you need to know where they're different. i wouldn't really care to have it on the dict since it's useful as an unbound method anyway. On Sat, Nov 20, 2010 at 01:11:53AM -0500, Ste

Re: dict diff

2010-11-19 Thread Steve Holden
On 11/19/2010 8:58 PM, Jin Yi wrote: > so i came up with a diff method to compare 2 dicts. i found it pretty > useful so i thought i'd share it with everyone. you can see the doctest > to check out suggested uses. since we can't modify built-ins, i > demonstrated adding a diff method to OrderedD

try to use unicode

2010-11-19 Thread Mikael B
Hi. I'm learning python. python 2.6.6 on ubuntu 10.10 I'm swedish so I try to use unicode to get swedish characters. I've checked wikipedia. utf-8 is said to be an unicode encoding.. this is the test program: # -*- coding: utf-8 -*- import readline s=raw_input(u'Månadslön:') and this is the

dict diff

2010-11-19 Thread Jin Yi
so i came up with a diff method to compare 2 dicts. i found it pretty useful so i thought i'd share it with everyone. you can see the doctest to check out suggested uses. since we can't modify built-ins, i demonstrated adding a diff method to OrderedDict to show how one could add it to your own

Re: How to run an EXE, with argument, capture output value

2010-11-19 Thread noydb
Thanks to Jerry Hill above who helped. This worked: from pywinauto.application import Application app = Application() app.start_(r'C:\temp\hallbig2.exe') app.Form1.Edit6.TypeKeys(r'C:\temp\input\Ea39j.txt') E_Value = "" while (E_Value == ""): app.Form1.Compute.Click() E_Value = app.Form1.E

Re: strange behavor....

2010-11-19 Thread Arnaud Delobelle
Hrvoje Niksic writes: > m...@distorted.org.uk (Mark Wooding) writes: > >>> So even if the globals() dictionary is custom, its __setitem__ method is >>> *not* called. >> >> Fascinating. Thank you. > > In case it's not obvious, that is because CPython assumes the type for > many of its internal or

Earn in Management careers.

2010-11-19 Thread gaurav
On Management careers base, Earn monthly. Supporting Management careers. http://managementjobs.webs.com/pm.htm & http://topcareer.webs.com/humanresourcemgmt.htm Offers for job seekers Opportunities for you Make your career. http://rojgars1.webs.com/gov.htmhttp://rojgars.webs.com/bankingjobs.h

Re: Distribution of Python Scripts

2010-11-19 Thread Stefaan Himpe
So, what's my options. Maybe this page can give some inspiration? http://wiki.python.org/moin/deployment -- http://mail.python.org/mailman/listinfo/python-list

Re: Module locale throws exception: unsupported locale setting

2010-11-19 Thread Ned Deily
In article , Sibylle Koczian wrote: > on a german Windows installation I get problems with locale. If I run > that module as a script from a command window this is the output: > > C:\Python31\Lib>locale.py > Locale aliasing: > > Locale defaults as determined by getdefaultlocale(): > --

Module locale throws exception: unsupported locale setting

2010-11-19 Thread Sibylle Koczian
Hello, on a german Windows installation I get problems with locale. If I run that module as a script from a command window this is the output: C:\Python31\Lib>locale.py Locale aliasing: Locale defaults as determined by getdefaultlocale(): --

Re: Round Trip: C to Python to C Module

2010-11-19 Thread Diez B. Roggisch
Eric Frederich writes: > I have a proprietary software PropSoft that I need to extend. > They support extensions written in C that can link against PropLib to > interact with the system. > > I have a Python C module that wraps a couple PropLib functions that I > call PyProp. >>From an interactive

Re: How to run an EXE, with argument, capture output value

2010-11-19 Thread Tim Harig
C:\Documents and Settings\Tim Harig\My Documents\autoCalc>dir Volume in drive C has no label. Volume Serial Number is 30D9-35E0 Directory of C:\Documents and Settings\Tim Harig\My Documents\autoCalc 11/19/2010 12:20 PM . 11/19/2010 12:20 PM .. 11/19/2010 12:19 PM

Re: what's the precision of fractions.Fraction?

2010-11-19 Thread Peter Pearson
On Fri, 19 Nov 2010 07:29:59 -0800 (PST), RJB wrote: > Does Fractions remove common factors the way it should? > > If it does and you want to find the closest fraction with a smaller > denominator i think tou'll need some number theory and continued > fractions. No heroics required, finding the g

Re: strange behavor....

2010-11-19 Thread Steve Holden
On 11/16/2010 9:12 AM, Arnaud Delobelle wrote: > Hrvoje Niksic writes: > >> m...@distorted.org.uk (Mark Wooding) writes: >> So even if the globals() dictionary is custom, its __setitem__ method is *not* called. >>> >>> Fascinating. Thank you. >> >> In case it's not obvious, that is bec

Re: Modifying Element In For List

2010-11-19 Thread Steve Holden
On 11/19/2010 12:17 PM, Johannes Bauer wrote: > Am 15.11.2010 18:27, schrieb Duncan Booth: > >> Comparing directly against True or False is error prone: a value in >> Python can be false without actually being equal to False. > > Well, you can always use "is" instead of "==", which makes a compa

Re: Modifying Element In For List

2010-11-19 Thread Johannes Bauer
Am 15.11.2010 18:27, schrieb Duncan Booth: > Comparing directly against True or False is error prone: a value in > Python can be false without actually being equal to False. Well, you can always use "is" instead of "==", which makes a comparison to True or False perfectly safe. Regards, Johanne

Re: Program, Application, and Software

2010-11-19 Thread Steve Holden
On 11/19/2010 9:22 AM, Martin Gregorie wrote: [...] > Indeed, > it doesn't make sense there since executables are limited to .BAR or .CMD > files, which are directly interpreted by the command processor, and .EXE > or .COM files, which must be compiled before they can be run. AFAIK > there's no

Re: How to run an EXE, with argument, capture output value

2010-11-19 Thread Jerry Hill
On Fri, Nov 19, 2010 at 9:52 AM, noydb wrote: > Any other help?  I am guessing not, just wanted to try one more time. > Could really use help, please!! You'll need to give us more information about the program you're trying to automate. It originally sounded like you just needed to run a console

Re: What was your strategy?

2010-11-19 Thread Steve Holden
On 11/19/2010 10:55 AM, Lou Pecora wrote: > In article <7xr5ei1p2j@ruckus.brouhaha.com>, > Paul Rubin wrote: > >> Lou Pecora writes: > I'll jump in and recommend the book "Python in a Nutshell" by Martelli. It's encyclopedic. >>> Indeed. I hope Martelli updates it. I'd buy anot

Re: Changing the EAX register with Python

2010-11-19 Thread Grant Edwards
On 2010-11-19, Tim Roberts wrote: > dutche wrote: >> My project is to have a python program that loads a C program and >> sets a breakpoint at some address, and then with this breakpoint I >> change the EAX register and then continue the program execution. > You will need to find a Linux applic

ANN: PyGUI 2.3.1

2010-11-19 Thread Greg Ewing
PyGUI 2.3.1 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ This version incorporates a modification that I hope will improve the behaviour of ScrollableViews on Windows with pywin32 builds later than 212. (There are still problems with it, though. If the Scrollable View

Round Trip: C to Python to C Module

2010-11-19 Thread Eric Frederich
I have a proprietary software PropSoft that I need to extend. They support extensions written in C that can link against PropLib to interact with the system. I have a Python C module that wraps a couple PropLib functions that I call PyProp. >From an interactive Python shell I can import PyProp and

Re: What was your strategy?

2010-11-19 Thread Lou Pecora
In article <7xr5ei1p2j@ruckus.brouhaha.com>, Paul Rubin wrote: > Lou Pecora writes: > >> > I'll jump in and recommend the book "Python in a Nutshell" by Martelli. > >> It's encyclopedic. > > Indeed. I hope Martelli updates it. I'd buy another copy right away. > > It's a great book but

Re: Changing the EAX register with Python

2010-11-19 Thread Robert Kern
On 11/19/10 7:08 AM, dutche wrote: Well, I think using ptrace is really the best way, at least what I have found on Google told me that. You may also want to look into pinktrace for another wrapper around ptrace. I haven't used it myself, but it's worth looking into. http://dev.exherbo.org

Re: what's the precision of fractions.Fraction?

2010-11-19 Thread RJB
Does Fractions remove common factors the way it should? If it does and you want to find the closest fraction with a smaller denominator i think tou'll need some number theory and continued fractions. RJB On Nov 18, 8:26 pm, Steven D'Aprano wrote: > On Thu, 18 Nov 2010 20:08:00 +0100, Stefan Sonn

Re: Program, Application, and Software

2010-11-19 Thread Josef Frank
Am 19.11.2010 15:22, schrieb Martin Gregorie: On Fri, 19 Nov 2010 01:43:28 +0100, Alexander Kapps wrote: What difference does it make? Is 'print "Hello"' a program or a script? Are you saying, that it depends on whether you have to manually call some compiler? Thats the way the term 'script'

Re: Extension on Windows

2010-11-19 Thread Eric Frederich
On Fri, Nov 19, 2010 at 8:12 AM, Ulrich Eckhardt wrote: > Eric Frederich wrote: >> Do I put them [DLL dependencies] in some environment variable? >> Do I put them in site-packages along with the .pyd file, or in some >> other directory? > > Take a look at the LoadLibrary() docs: >  http://msdn.mic

Re: How to run an EXE, with argument, capture output value

2010-11-19 Thread noydb
Any other help? I am guessing not, just wanted to try one more time. Could really use help, please!! -- http://mail.python.org/mailman/listinfo/python-list

Re: regenerating unicodedata for py2.7 using py3 makeunicodedata.py?

2010-11-19 Thread Vlastimil Brom
2010/11/18 Martin v. Loewis : > >> Thanks for the confirmation Martin! >> >> Do you think, it the mentioned omission of the character names of some >> CJK ranges in unicodedata intended, or should it be reported to the >> tracker? > > It's certainly a bug. So a bug report would be appreciated, but

Re: Bunch 2.0 - a dict with a default

2010-11-19 Thread nn
On Nov 18, 8:45 pm, Phlip wrote: > Pythonistas: > > If everyone likes this post, then the code is a "snippet" for > community edification. Otherwise, it's a question: How to do this kind > of thing better? > > I want a dict() variant that passes these test cases: > >         map = Map() >        

Re: Program, Application, and Software

2010-11-19 Thread Martin Gregorie
On Fri, 19 Nov 2010 01:43:28 +0100, Alexander Kapps wrote: > What difference does it make? Is 'print "Hello"' a program or a script? > Are you saying, that it depends on whether you have to manually call > some compiler? Thats the way the term 'script' is usually used in the UNIX/Linux world. I

Re: Extension on Windows

2010-11-19 Thread Ulrich Eckhardt
Eric Frederich wrote: > Do I put them [DLL dependencies] in some environment variable? > Do I put them in site-packages along with the .pyd file, or in some > other directory? Take a look at the LoadLibrary() docs: http://msdn.microsoft.com/en-us/library/ms684175(VS.85).aspx These further lead

Re: Changing the EAX register with Python

2010-11-19 Thread dutche
Well, I think using ptrace is really the best way, at least what I have found on Google told me that. Stefan, your answer will fit perfectlly for me, it was what I'm searching. Thank you On Nov 19, 10:43 am, David Cournapeau wrote: > On Fri, Nov 19, 2010 at 4:17 PM, Tim Roberts wrote: > > dutc

Re: How to correctly pass “pointer-to-pointer” i nto DLL via ctypes?

2010-11-19 Thread Grigory Petrov
Thank you a lot! I have stripped down my production code to the sample - and it worked. Bug was in another part of my code where free() was called for the memory in question. On Fri, Nov 19, 2010 at 3:39 PM, Diez B. Roggisch wrote: > Grigory Petrov writes: > >> Hello. >> >> I have a DLL that al

Re: Extension on Windows

2010-11-19 Thread Eric Frederich
On Fri, Nov 19, 2010 at 7:28 AM, Ulrich Eckhardt wrote: >> Now when I created a 2nd function to wrap a library function I get the >> following. >> >> ImportError: DLL load failed: The specified module could not be found. > > This can mean that the module itself couldn't be loaded or that one of t

Re: Changing the EAX register with Python

2010-11-19 Thread David Cournapeau
On Fri, Nov 19, 2010 at 4:17 PM, Tim Roberts wrote: > dutche wrote: >> >>Hi folks, I have a unusual question here. >> >>How can I change the value of EAX register under python under Linux?? >>As paimei does under Windows. >> >>My project is to have a python program that loads a C program and sets

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 01:03:14PM +0100, Wolfgang Rohdewald wrote: > On Freitag 19 November 2010, Alexander Gattin wrote: > > It's better to select count(1) instead of > > count(*). not true, > > The latter may skip rows consisting > > entirely of NULLs IIRC. not true either. I've heard

Re: How to correctly pass “pointer-to-pointer ” into DLL via ctypes?

2010-11-19 Thread Diez B. Roggisch
Grigory Petrov writes: > Hello. > > I have a DLL that allocates memory and returns it. Function in DLL is like > this: > > void Foo( unsigned char** ppMem, int* pSize ) > { >   * pSize = 4; >   * ppMem = malloc( * pSize ); >   for( int i = 0; i < * pSize; i ++ ) (* pMem)[ i ] = i; > } > > Also,

Re: Extension on Windows

2010-11-19 Thread Ulrich Eckhardt
Eric Frederich wrote: > I am trying to create an extension on Windows and I may be over my > head but I have made it pretty far. > > I am trying to create bindings for some libraries which require me to > use Visual Studio 2005. > > I set up the spammodule example and in VS set the output file to

Re: SQLite3 and lastrowid

2010-11-19 Thread Alain Ketterlin
Alexander Gattin writes: > On Fri, Nov 19, 2010 at 12:32:19PM +0100, Alain > Ketterlin wrote: >> Alexander Gattin writes: >> > It's better to select count(1) instead of >> > count(*). The latter may skip rows consisting >> > entirely of NULLs IIRC. >> >> Wrong: count(anyname) ignores NULL, wher

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Fri, Nov 19, 2010 at 12:32:19PM +0100, Alain Ketterlin wrote: > Alexander Gattin writes: > > It's better to select count(1) instead of > > count(*). The latter may skip rows consisting > > entirely of NULLs IIRC. > > Wrong: count(anyname) ignores NULL, whereas count(*) does not. I'm u

Re: SQLite3 and lastrowid

2010-11-19 Thread Wolfgang Rohdewald
On Freitag 19 November 2010, Alexander Gattin wrote: > It's better to select count(1) instead of > count(*). The latter may skip rows consisting > entirely of NULLs IIRC. in some data bases count(1) is said to be faster than count(*), I believe -- Wolfgang -- http://mail.python.org/mailman/list

Re: strange subprocess behavior when calling ps

2010-11-19 Thread Alexander Gattin
Hello, On Wed, Nov 17, 2010 at 01:19:09AM -0800, Ned Deily wrote: > As far as I know, COMMAND_MODE has no special > meaning on other platforms UNIX_STD=2003 on HP-UX if anyone's interested... -- With best regards, xrgtn -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite3 and lastrowid

2010-11-19 Thread Alain Ketterlin
Alexander Gattin writes: >> The proper way to get the number of rows is to >> use the COUNT aggregate function, e.g., "SELECT >> COUNT(*) FROM TABLE1", which will return a >> single row with a single column containing the >> number of rows in table1. > > It's better to select count(1) instead of

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
On Fri, Nov 19, 2010 at 01:14:34PM +0200, Alexander Gattin wrote: > On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian > wrote: > > The proper way to get the number of rows is to > > use the COUNT aggregate function, e.g., "SELECT > > COUNT(*) FROM TABLE1", which will return a > > single row with a sing

HI ALL, COUPLE R INVITING U FOR HOT DATING FOR FREE.... PLZ WELCOME(ABOVE 18YEARS ONLY)

2010-11-19 Thread d...@couples
HI ALL, COUPLE R INVITING U FOR HOT DATING FOR FREE PLZ WELCOME(ABOVE 18YEARS ONLY) http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 http://x2c.eu/58 -- http://mail.python.org/mailman/listinfo/python-list

Re: SQLite3 and lastrowid

2010-11-19 Thread Alexander Gattin
Hello, On Tue, Nov 16, 2010 at 01:52:42PM -0800, Ian wrote: > The proper way to get the number of rows is to > use the COUNT aggregate function, e.g., "SELECT > COUNT(*) FROM TABLE1", which will return a > single row with a single column containing the > number of rows in table1. It's better to s

Re: Distribution of Python Scripts

2010-11-19 Thread Jean-Michel Pichavant
tazz_ben wrote: Hi Folks - I'm an experienced programmer, but this is my first app with python, so I apologize for any stupidity on my part. So I've written/still working on a command line tool written in Python. It talks to a web service, so there really isn't anything in it that is dependen

Re: Changing the EAX register with Python

2010-11-19 Thread Stefan Sonnenberg-Carstens
Hi, just read my mail :-) You can just build an debugger in python yourself. The script I posted should give you an idea. Am Fr, 19.11.2010, 08:17 schrieb Tim Roberts: > dutche wrote: >> >>Hi folks, I have a unusual question here. >> >>How can I change the value of EAX register under python under