How to save clipboard data as bmp file

2009-04-21 Thread gopal mishra
I have used ImageGrab.grabclipboard() to get the clipboard image data, it returns None. This function only supports if the clipboard data format is CF_BITMAP. Is there any way to save clipboard data format CF_ENHMETAFILE to bitmap file using win32 programming. -- Gopal > I am trying to save my

Re: generating random tuples in python

2009-04-21 Thread Paul Rubin
per writes: > to be more formal by very different, i would be happy if they were > maximally distant in ordinary euclidean space... In that case you want them placed very carefully, not even slightly random. So you are making conflicting requests. -- http://mail.python.org/mailman/listinfo/pyth

Re: Python and GMP.

2009-04-21 Thread Paul Rubin
casevh writes: > Python 3.1 is significantly faster than Python 2.x on 64-bit > platforms. The following times are for multiplication with 2, 30 and > 300 decimal digits. Could you test pow(a,b,c) where a,b,c are each 300 decimal digits? This is an important operation in cryptography, that GMP is

problem with PyMapping_SetItemString()

2009-04-21 Thread rahul
i have a c extension tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; char *varName; if (!PyArg_ParseTuple(args, "s", &varName)){ return NULL; } dict=PyEval_GetLocals();

Re: generating random tuples in python

2009-04-21 Thread Aaron Brady
On Apr 20, 11:04 pm, per wrote: > On Apr 20, 11:08 pm, Steven D'Aprano > > > > wrote: > > On Mon, 20 Apr 2009 11:39:35 -0700, per wrote: > > > hi all, > > > > i am generating a list of random tuples of numbers between 0 and 1 using > > > the rand() function, as follows: > > > > for i in range(0,

problem with PyMapping_SetItemString()

2009-04-21 Thread rahul
i have a c extension tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; char *varName; if (!PyArg_ParseTuple(args, "s", &varName)){ return NULL; } dict=PyEval_GetLocals();

Self-intro and possible offtopic: creation of group integrating translators and experts in the fields they translate

2009-04-21 Thread vocabulo
Dear Owner, This is a message announcing the creation of a google translation project group (I appologize if 's against the rules). Thank you, Marco Dear Members, My name is Marco Juliano e Silva, and I'm basically a technical translator. This is to let you know that

Re: PEP 401

2009-04-21 Thread alessiogiovanni . baroni
On 19 Apr, 21:28, Stefan Behnel wrote: > alessiogiovanni.bar...@gmail.com wrote: > > Are 19 days that I read this PEP; it's all true? > > Yep. Actually, the Cython project was lucky that the FLUFL did not > recognise it as an "alternative implementation of Python". That way, we can > easily finish

Re: generating random tuples in python

2009-04-21 Thread Steven D'Aprano
On Mon, 20 Apr 2009 21:04:25 -0700, per wrote: > i realize my example in the original post was misleading. i dont want to > maximize the difference between individual members of a single tuple -- > i want to maximize the difference between distinct tuples. in other > words, it's ok to have (.332,

Re: Python and GMP.

2009-04-21 Thread alessiogiovanni . baroni
On 21 Apr, 09:11, Paul Rubin wrote: > casevh writes: > > Python 3.1 is significantly faster than Python 2.x on 64-bit > > platforms. The following times are for multiplication with 2, 30 and > > 300 decimal digits. > > Could you test pow(a,b,c) where a,b,c are each 3

Re: Programming in Python with a view to extending in C at a later date.

2009-04-21 Thread Carl Banks
On Apr 20, 11:57 am, "dug.armad...@googlemail.com" wrote: > Say you set out to program in Python knowing that you will be > converting parts of it into C ( or maybe C++) at a later date, but you > do not know which parts. > > Can you give any general Python structure / syntax advice that if > impl

Re: generating random tuples in python

2009-04-21 Thread Steven D'Aprano
On Tue, 21 Apr 2009 07:53:29 +, Steven D'Aprano wrote: > Third strategy: divide the cube into eight half-cubes. Label then A > through H: Sheesh. Obviously they're not *half* cubes if there are eight of them. What I meant was that their edges are half as long as the edge of the 1x1x1 cube.

Re: out of memory with processing module

2009-04-21 Thread alessiogiovanni . baroni
On 20 Apr, 18:32, Brian wrote: > On Apr 20, 9:18 am, alessiogiovanni.bar...@gmail.com wrote: > > > > > On 20 Apr, 17:03, Brian wrote: > > > > I'm using the third-party "processing" module in Python 2.5, which may > > > have become the "multiprocessing" module in Python 2.6, to speed up > > > the

Re: A Special Thanks

2009-04-21 Thread Nick Craig-Wood
norseman wrote: > I'm one of those that tries to get an outline of the project and then > puts in code as things become clear. Once the basics are working > reasonably I go back and organize the thing for maintainability. Then > finish flushing it out. It is the one stage I dread the most.

who is calling the base class __new__ method

2009-04-21 Thread Andreas Otto
Hi, I have the following example: 1. I create a new type in "C" with it's own tp_new called "PyMqS_new" 2. I use this type as basis-class for a python class called "Server". class Server(pymsgque.MqS): -> I checked: self.__class__.__bases__: (,) from a "Ser

Problem with COM and variants

2009-04-21 Thread Simon Carter
Hullo! I'm having a problem interfacing with a proprietary COM library on Windows, and I was hoping someone could help. I'm no COM guru, so apologies in advance if my terminology gets a little muddled... I'm accessing the COM library via gencache.EnsureModule. It was all working as expected un

Re: The Python standard library and PEP8

2009-04-21 Thread Lawrence D'Oliveiro
In message , Steven D'Aprano wrote: > Everybody understands what you mean when you say something is tasty, even > though everyone's understanding of tasty is different. You don't need to > agree on what tasty *is* to agree that something *isn't* tasty But you do if you want to describe somethin

Re: How to save clipboard data as bmp file

2009-04-21 Thread Tim Golden
gopal mishra wrote: I have used ImageGrab.grabclipboard() to get the clipboard image data, it returns None. This function only supports if the clipboard data format is CF_BITMAP. Is there any way to save clipboard data format CF_ENHMETAFILE to bitmap file using win32 programming. Well I'm symp

Re: Is there a programming language that is combination of Python and Basic?

2009-04-21 Thread Ivan Illarionov
On Apr 18, 3:39 pm, BJörn Lindqvist wrote: > I first started programming basic and i don't think it has hurt me much. > > I can somewhat sympathise with the op, neither python nor any other > mainstream language can still do this: > > SCREEN 13 > PSET 160,100,255 This is not true. It's trivial wi

Re: Python and GMP.

2009-04-21 Thread bearophileHUGS
casevh: > Testing 2 digits. This primarily measures the overhead for call GMP > via an extension module. > ... Thank you for adding some actual data to the whole discussion :-) If you perform similar benchmarks with Bigints of Java you will see how much slower they are compared to the Python ones.

Re: who is calling the base class __new__ method

2009-04-21 Thread Andreas Otto
Hi, found a solution - "PyObject_GC_New" seems not to be *not* the right function to create a new Python object with a base class included - "PyType_GenericNew" is the right one ... but this one is not documented from: http://docs.python.org/3.0/c-api/type.html

Re: sorting two corresponding lists?

2009-04-21 Thread Esmail
Esmail wrote: items = [apple, car, town, phone] values = [5, 2, 7, 1] I would like to sort the 'items' list based on the 'values' list so that I end up with the following two list: items = [town, apple, car, phone] values = [7, 5, 2, 1] Hello all, thanks for all the great suggestions. I use

Re: Python and GMP.

2009-04-21 Thread Mark Dickinson
On Apr 21, 12:04 pm, bearophileh...@lycos.com wrote: > Using inline ASM in Python sources isn't an option. Except when it is. :) There's a tiny amount of inline assembler in the sources already: see Python/pymath.c and Python/ceval.c. Not surprisingly, there's some in the ctypes module as well.

Re: python-magic with python2.6

2009-04-21 Thread Gabriel
Gabriel wrote: Is there any way to use python-magic(http://pypi.python.org/pypi/python-magic/0.1) with python2.6? Or do somebody know something similar to this what is running on 2.6? If somebody care .. .) I have found sources of python-magic here: http://wiki.python.org/moin/HowTo/FileMagic

ANN: PyGUI 2.0.4

2009-04-21 Thread Greg Ewing
PyGUI 2.0.4 is available: http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ Fixes a few more bugs and hopefully improves things on Windows, although I can't be sure it will fix all the Windows problems people are having, because I haven't been able to reproduce some of them. What is Py

Re: Python and GMP.

2009-04-21 Thread Mark Dickinson
On Apr 21, 8:57 am, alessiogiovanni.bar...@gmail.com wrote: > Ok, thanks for your answers. I understand the problems of licensing, > but > we could to learn from GMP's source code to improve the Python's int > implementation, > mainly because, GMP is very fast. We could violate the GPL? Suggestion

Re: the correct way to install python packages as non root user in non default path

2009-04-21 Thread News123
Hi Alex, Thanks a lot. Reading the description this sounds to be the right thing. But now I'm stuck installing virtualenv as a user as this seems to be no ubunbtu package: export PYTHONPATH=/opt/newpymod/lib/python2.5/site-packages mkdir -p $PYTHONPATH easy_install --prefix /opt/newpymod inst

Re: Problem with COM and variants

2009-04-21 Thread John Machin
On Apr 21, 7:37 pm, "Simon Carter" wrote: > Hullo! I'm having a problem interfacing with a proprietary COM library on > Windows, and I was hoping someone could help. I'm no COM guru, so apologies > in advance if my terminology gets a little muddled... [snip] > - I'm running 32bit python 2.6 and

Re: Python and GMP.

2009-04-21 Thread casevh
On Apr 21, 12:11 am, Paul Rubin wrote: > casevh writes: > > Python 3.1 is significantly faster than Python 2.x on 64-bit > > platforms. The following times are for multiplication with 2, 30 and > > 300 decimal digits. > > Could you test pow(a,b,c) where a,b,c are eac

Re: Python and GMP.

2009-04-21 Thread Paul Rubin
alessiogiovanni.bar...@gmail.com writes: > > Could you test pow(a,b,c) where a,b,c are each 300 decimal digits? > > This is an important operation in cryptography, that GMP is carefully > > optimized for.  Thanks. > > Ok, thanks for your answers. I understand the problems of licensing, > but we co

Re: Python and GMP.

2009-04-21 Thread Paul Rubin
casevh writes: > > Could you test pow(a,b,c) where a,b,c are each 300 decimal digits? > > $ py25 -m timeit -s "a=long('23'*150);b=long('47'*150);m=long > ('79'*150)" "c=pow(a,b,m)" > 10 loops, best of 3: 52.7 msec per loop > $ py31 -m timeit -s > 100 loops, best of 3: 8.85 msec per loop > $

Re: not homework... something i find an interesting problem

2009-04-21 Thread Trip Technician
Thank you Dave. This does it but slowly. takes every subset of the list a of squares, and then gets a 'partition' that will work, many are very inefficient (with lots of 1s). any hints about how to speed up ? def subset(x): for z in range(1,2**len(x)): q=bin(z) subs=[]

Re: Programming in Python with a view to extending in C at a later date.

2009-04-21 Thread bobicanprogram
On Apr 20, 2:57 pm, "dug.armad...@googlemail.com" wrote: > Hi, > > Say you set out to program in Python knowing that you will be > converting parts of it into C ( or maybe C++) at a later date, but you > do not know which parts. > > Can you give any general Python structure / syntax advice that if

Re: the correct way to install python packages as non root user in non default path

2009-04-21 Thread Diez B. Roggisch
News123 wrote: > Hi Alex, > > > Thanks a lot. Reading the description this sounds to be the right thing. > > > But now I'm stuck installing virtualenv as a user as this seems to be no > ubunbtu package: > > > export PYTHONPATH=/opt/newpymod/lib/python2.5/site-packages > mkdir -p $PYTHONPATH

[no subject]

2009-04-21 Thread karlos barlos
hello to everybody... having problem withe this code : dom = raw_input("The Domain name..:")   ad_user.Put('userPrincipalName',user['login']+'@(['dom']) but it wont change whay ? -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2009-04-21 Thread karlos barlos
hello to everybody... having problem withe this code : dom = raw_input("The Domain name..:")   ad_user.Put('userPrincipalName',user['login']+'@(['dom']) but it wont change whay ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with COM and variants

2009-04-21 Thread Simon Carter
Doh! Ta. Simon "John Machin" wrote in message news:023fcc82-6e98-4ddd-9977-06d95ab44...@c18g2000prh.googlegroups.com... On Apr 21, 7:37 pm, "Simon Carter" wrote: Hullo! I'm having a problem interfacing with a proprietary COM library on Windows, and I was hoping someone could help. I'm no C

Re: Python and GMP.

2009-04-21 Thread casevh
On Apr 21, 5:47 am, Paul Rubin wrote: > casevh writes: > > > Could you test pow(a,b,c) where a,b,c are each 300 decimal digits? > > > $ py25 -m timeit -s  "a=long('23'*150);b=long('47'*150);m=long > > ('79'*150)" "c=pow(a,b,m)" > > 10 loops, best of 3: 52.7 msec per

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: hello to everybody... having problem withe this code : dom = raw_input("The Domain name..:") ad_user.Put('userPrincipalName',user['login']+'@(['dom']) but it wont change whay ? Some more context would help, including a code fragment and traceback if there is a

Problem updating AD user [was: Re:]

2009-04-21 Thread Tim Golden
[... snip vague question re AD user update ...] ... and please add a (useful) subject line TJG -- http://mail.python.org/mailman/listinfo/python-list

Re:

2009-04-21 Thread karlos barlos
ok sorry TIM I just took some piece of code  that ADDs users to AD import win32com,win32com.client     def add_acct(location,account):   ad_obj=win32com.client.GetObject(location)   ad_user=ad_obj.Create('user','cn='+user['login'])   ad_user.Put('sAMAccountName',u

Re: not homework... something i find an interesting problem

2009-04-21 Thread MRAB
Trip Technician wrote: Thank you Dave. This does it but slowly. takes every subset of the list a of squares, and then gets a 'partition' that will work, many are very inefficient (with lots of 1s). any hints about how to speed up ? def subset(x): for z in range(1,2**len(x)): q=bin(

Re: ANN: PyGUI 2.0.4

2009-04-21 Thread Kent Johnson
On Apr 21, 8:05 am, Greg Ewing wrote: > PyGUI 2.0.4 is available: > >    http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ > > Fixes a few more bugs and hopefully improves things > on Windows, although I can't be sure it will fix all > the Windows problems people are having, because I > have

Re: and [True,True] --> [True, True]?????

2009-04-21 Thread Grant Edwards
On 2009-04-21, Steven D'Aprano wrote: > No matter what x is (excluding buggy classes), "if x" means > "test whether x is true in a boolean context". > > If x happens to be a list, that means "x is empty". If x is a > float, it means "x is positive or negative zero". I think you've got your true/

Re: A Special Thanks

2009-04-21 Thread Aahz
In article , Nick Craig-Wood wrote: > >Python also converted me to using unit tests. If you add unit tests >into your methodology above then when you re-organize (or refactor to >use the modern jargon) the code you can be 100% sure that you didn't >break anything which is a wonderful feeling. N

Re: sorting two corresponding lists?

2009-04-21 Thread 邓弈龙
solution by jadec.se...@gmail.commailto:jadec.se...@gmail.com>, China values,items = zip( *sorted( zip (values,items))) - Original Message - From: "Esmail" mailto:ebo...@hotmail.com> > To: mailto:python-list@python.org> > Sent: Tuesday, April 21, 2009 12:10 AM Subject: sorting two corr

Re: not homework... something i find an interesting problem

2009-04-21 Thread Trip Technician
On 21 Apr, 14:46, MRAB wrote: > Trip Technician wrote: > > Thank you Dave. This does it but slowly. takes every subset of the > > list a ofsquares, and then gets a 'partition' that will work, many > > are very inefficient (with lots of 1s). > > > any hints about how to speed up ? > > > def subset(

Re: and [True,True] --> [True, True]?????

2009-04-21 Thread Peter Pearson
On 21 Apr 2009 03:06:40 GMT, Steven D'Aprano wrote: > On Mon, 20 Apr 2009 15:53:41 +, Peter Pearson wrote: > >> Like Gerhard, I prefer the construction that explicitly says, "This is a >> list, and this is what I'll do if it's not empty." To me, and I suspect >> to a great many programmers, "i

Export variables

2009-04-21 Thread msolem
Hello, I want to make a certain subset of public attributes available through an interface. The client should not need to know the names of the attributes. Here is some code with the important parts missing. Anyone care to fill in the missing parts? class C: def __init__(self): se

execfile (exec?) create non consistent locals() state

2009-04-21 Thread Doron Tal
Hi, Recently I tried to execute a python file using execfile (exec performed just the same for that reason). I encountered the behavior below: """ $ cat execme.py a = 2 $ python Python 2.4.3 (#1, May 24 2008, 13:57:05) [GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2 Type "help", "copyright", "c

Re: sorting two corresponding lists?

2009-04-21 Thread tiefeng wu
> > Esmail wrote: > > > items = [apple, car, town, phone] > > values = [5, 2, 7, 1] > > > > I would like to sort the 'items' list based on the 'values' list so > > that I end up with the following two list: > > > > items = [town, apple, car, phone] > > values = [7, 5, 2, 1] My solution, I know th

Re:

2009-04-21 Thread Tim Golden
karlos barlos wrote: ok sorry TIM I just took some piece of code that ADDs users to AD import win32com,win32com.client def add_acct(location,account): ad_obj=win32com.client.GetObject(location) ad_user=ad_obj.Create('user','cn='+user['login']) ad_user

Python winappdbg module v1.0 is out!

2009-04-21 Thread Mario Alejandro Vilas Jerez
What is winappdbg? == The winappdbg python module allows developers to quickly code instrumentation scripts in Python under a Windows environment. It uses ctypes to wrap many Win32 API calls related to debugging, and provides an object-oriented abstraction layer to manipulate thre

SqlAlchemy and mssqlserver

2009-04-21 Thread Stefano
Using sqlalchemy with pyodbc and mssqlserver Why sa always generate identity ? many thanks here the sample tb = Table('prova',meta,Column('chiave', Integer, primary_key=True)) tb.create() CREATE TABLE prova ( chiave INTEGER NOT NULL IDENTITY(1,1), PRIMARY KEY (chiave) ) Stefano -- http://ma

Re: Export variables

2009-04-21 Thread Diez B. Roggisch
mso...@linuxmail.org wrote: > Hello, > > I want to make a certain subset of public attributes available through > an interface. > > The client should not need to know the names of the attributes. > > Here is some code with the important parts missing. Anyone care to > fill in the missing parts

Re: sorting two corresponding lists?

2009-04-21 Thread nathanielpeterson08
>From http://wiki.python.org/moin/HowTo/Sorting#Sortingbykeys, using the >Decorate-Sort-Undecorate (aka Schwartzian transform) idiom: #!/usr/bin/env python items = ['apple', 'car', 'town', 'phone'] values = [5, 2, 7, 1] zipped=zip(values,items) zipped.sort(reverse=True) values_sorted,items_sorte

using python logo at startup

2009-04-21 Thread Dhruv
Is there a way to display/flash "python powered" logo for like 2 seconds at startup of a helloworld application? Well actually I have an application that takes data from an excel file and generates a kml file and opens it up with google earth. All this is compiled in an exe file using py2exe. Now

Re: not homework... something i find an interesting problem

2009-04-21 Thread MRAB
Trip Technician wrote: On 21 Apr, 14:46, MRAB wrote: Trip Technician wrote: Thank you Dave. This does it but slowly. takes every subset of the list a ofsquares, and then gets a 'partition' that will work, many are very inefficient (with lots of 1s). any hints about how to speed up ? def subset

Re:

2009-04-21 Thread Andre Engels
On Tue, Apr 21, 2009 at 3:00 PM, karlos barlos wrote: > hello to everybody... > > having problem withe this code : > > dom = raw_input("The Domain name..:") >   ad_user.Put('userPrincipalName',user['login']+'@(['dom']) > > but it wont change whay ? Well, you don't tell what ad_user is, an

Re: Is there a programming language that is combination of Python and Basic?

2009-04-21 Thread Mensanator
On Apr 21, 5:37 am, Ivan Illarionov wrote: > On Apr 18, 3:39 pm, BJörn Lindqvist wrote: > > > I first started programming basic and i don't think it has hurt me much. > > > I can somewhat sympathise with the op, neither python nor any other > > mainstream language can still do this: > > > SCREEN

Re: Python interpreter speed

2009-04-21 Thread Fabio Zadrozny
> Further, I have an accounting software which was previously in java, but > now in python and the performance gain is ausom. > > Yes it depends on how we write the code but comparing the 2 at least at > the middle layer and front-end (pygtk) python is faster than java. > Infact I am most certain t

Re: who is calling the base class __new__ method

2009-04-21 Thread Aahz
In article , Andreas Otto wrote: > > Question: What is the difference between these both functions >and why is one working and the other not ? If you don't get an answer here, try capi-sig. -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "If you think

Re: using python logo at startup

2009-04-21 Thread Mike Driscoll
On Apr 21, 11:46 am, Dhruv wrote: > Is there a way to display/flash "python powered" logo for like 2 > seconds at startup of a helloworld application? > > Well actually I have an application that takes data from an excel file > and generates a kml file and opens it up with google earth. All this >

Re: not homework... something i find an interesting problem

2009-04-21 Thread bearophileHUGS
MRAB: > I think I might have cracked it: > ... >      print n, sums Nice. If you don't want to use dynamic programming, then add a @memoize decoration before the function, using for example my one: http://code.activestate.com/recipes/466320/ And you will see an interesting speed increase, even if

Python, MS SQL, and batch inserts

2009-04-21 Thread ericwoodworth
Hi, I have a python script I'm writing that grabs some data from a com object, does a little formatting, and then inserts that data into a MS SQL 2003 DB. Because I'm using COM objects I'm importing win32com.client. That also allows me to use ADODB.connection and ADODB.command objects for wo

Re: execfile (exec?) create non consistent locals() state

2009-04-21 Thread Chris Rebert
On Tue, Apr 21, 2009 at 9:08 AM, Doron Tal wrote: > Hi, > > Recently I tried to execute a python file using execfile (exec performed > just the same for that reason). > I encountered the behavior below: > > """ > $ cat execme.py > a = 2 > $ python > Python 2.4.3 (#1, May 24 2008, 13:57:05) > [GCC

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread Philip Semanchuk
On Apr 21, 2009, at 2:02 PM, ericwoodwo...@gmail.com wrote: Hi, I have a python script I'm writing that grabs some data from a com object, does a little formatting, and then inserts that data into a MS SQL 2003 DB. Because I'm using COM objects I'm importing win32com.client. That also all

Re: execfile (exec?) create non consistent locals() state

2009-04-21 Thread Doron Tal
On Tue, Apr 21, 2009 at 9:13 PM, Chris Rebert wrote: > On Tue, Apr 21, 2009 at 9:08 AM, Doron Tal > wrote: > > Hi, > > > > Recently I tried to execute a python file using execfile (exec performed > > just the same for that reason). > > I encountered the behavior below: > > > > """ > > $ cat exec

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread ericwoodworth
On Apr 21, 2:15 pm, Philip Semanchuk wrote: > On Apr 21, 2009, at 2:02 PM, ericwoodwo...@gmail.com wrote: > > > > > Hi, > >     I have a python script I'm writing that grabs some data from a > > com object, does a little formatting, and then inserts that data into > > a MS SQL 2003 DB.  Because I'

Re: Python interpreter speed

2009-04-21 Thread Terry Reedy
Fabio Zadrozny wrote: Further, I have an accounting software which was previously in java, but now in python and the performance gain is ausom. Yes it depends on how we write the code but comparing the 2 at least at the middle layer and front-end (pygtk) python is faster than java. Infact I am m

Re: execfile (exec?) create non consistent locals() state

2009-04-21 Thread Chris Rebert
On Tue, Apr 21, 2009 at 11:25 AM, Doron Tal wrote: > On Tue, Apr 21, 2009 at 9:13 PM, Chris Rebert wrote: >> >> On Tue, Apr 21, 2009 at 9:08 AM, Doron Tal >> wrote: >> > Hi, >> > >> > Recently I tried to execute a python file using execfile (exec performed >> > just the same for that reason). >>

Best Python Web Framework ?

2009-04-21 Thread SKYLAB
Greetings.. First , my english is not good . I heard that was written in python ( Youtube Programming Language : PYTHON :S ) Correct ? That's not correct ? Then youtube is PHP application ? That's correct ; Which python web framework in friendfeed ? Web.py ? Django ? web2py ? Thanks.. -- http:

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread Philip Semanchuk
On Apr 21, 2009, at 2:30 PM, ericwoodwo...@gmail.com wrote: I'm not 100% sure it's python and not SQL but I do suspect there's a better way to do this than just serial inserts. I could be wrong about that which is what i'm trying to explore. I don't think the SQL standard provides a way to

Re: problem with PyMapping_SetItemString()

2009-04-21 Thread Stefan Behnel
rahul wrote: > tatic PyObject *upadteCheck(PyObject *self,PyObject *args){ > PyObject *var_pyvalue=NULL,*newVar_pyvalue=NULL,*dict=NULL; > char *varName; > > if (!PyArg_ParseTuple(args, "s", &varName)){ > return NULL; > } > dict=PyEval_GetLocals(); >

Re: Best Python Web Framework ?

2009-04-21 Thread Stefan Behnel
Hi, SKYLAB wrote: > First , my english is not good . Note that there are many python news groups and mailing lists. There may also be one in your native language. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Please help me grok: webserver > python

2009-04-21 Thread Phillip B Oldham
I'm having trouble grok'ing how to get python talking through a webserver. I've got a lot of experience working with nginx+php-fcgi (via a unix socket) and I'd like to know what would be the bare minimum to get python talking in the same way. Now, I've looked at modules like CherryPy but they're a

Re: generating random tuples in python

2009-04-21 Thread Robert Kern
On 2009-04-20 23:04, per wrote: to be more formal by very different, i would be happy if they were maximally distant in ordinary euclidean space... so if you just plot the 3-tuples on x, y, z i want them to all be very different from each other. i realize this is obviously biased and that the t

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread Scott David Daniels
Philip Semanchuk wrote: ... If you're doing a mass insert to populate a blank table it also often helps to postpone index creation until after the table is populated I forget the name of the SQL Server bulk loader, but for large loads, I used to populate a fresh table with the bulk data, th

Re: Best Python Web Framework ?

2009-04-21 Thread Wes James
On Tue, Apr 21, 2009 at 12:46 PM, SKYLAB wrote: > Greetings.. > > First , my english is not good . > > I heard that was written in python ( Youtube Programming Language : > PYTHON :S ) Correct ? > > That's not correct ? Then youtube is PHP application ? > > That's correct ; Which python web framew

Re: Passing all extra commandline arguments to python program, Optparse raises exception

2009-04-21 Thread Robert Kern
On 2009-04-16 19:32, Saptarshi wrote: Saptarshi Preprocess the sys.args before calling optparse. Simply search sys.args for the string "start" and the string "stop", and note whichever comes first. Then use slice operators to peel the extra arguments off of sys.args. Thanks, i implemented you

Re: Best Python Web Framework ?

2009-04-21 Thread SKYLAB
Thanks all post. my english is not good . But techincal english very good. Anyway , i understand english documents. That's not problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread ericwoodworth
On Apr 21, 3:36 pm, Scott David Daniels wrote: > Philip Semanchuk wrote: > > ... If you're doing a mass insert to populate a blank table it also often > > helps to postpone index creation until after the table is populated > > I forget the name of the SQL Server bulk loader, but for large load

Accessing items in nested tuples

2009-04-21 Thread alex
Hello everybody I am able to access the data in a tuple via a for loop (see example below). #!/usr/bin/env python class Test(): def Data(self): return ("aa", "bb", "cc", "dd", "ee", "ff", "gg", "hh") #return (("aa", ("bb", "cc", "dd")), ("ee", ("ff", "gg", "hh")), ("ii", ("jj

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread ericwoodworth
On Apr 21, 4:01 pm, ericwoodwo...@gmail.com wrote: > On Apr 21, 3:36 pm, Scott David Daniels wrote: > > > Philip Semanchuk wrote: > > > ... If you're doing a mass insert to populate a blank table it also often > > > helps to postpone index creation until after the table is populated > > > I fo

Re: Accessing items in nested tuples

2009-04-21 Thread Tim Chase
IDLE 1.2.1 data=(("aa", ("bb", "cc", "dd")), ("ee", ("ff", "gg", "hh")), ("ii", ("jj", "kk", "ll"))) print data[0] ('aa', ('bb', 'cc', 'dd')) print data[1] ('ee', ('ff', 'gg', 'hh')) etc... I would like to be able to access the dataitem "aa" or "bb", "cc", "dd" individualy. You're s

Re: SqlAlchemy and mssqlserver

2009-04-21 Thread Mike Driscoll
On Apr 21, 11:22 am, "Stefano" wrote: > Using sqlalchemy with pyodbc and mssqlserver > Why sa always generate identity ? > > many thanks here the sample > > tb = Table('prova',meta,Column('chiave', Integer, primary_key=True)) > tb.create() > > CREATE TABLE prova ( >  chiave INTEGER NOT NULL IDENTI

Re: not homework... something i find an interesting problem

2009-04-21 Thread MRAB
bearophileh...@lycos.com wrote: MRAB: I think I might have cracked it: ... print n, sums Nice. If you don't want to use dynamic programming, then add a @memoize decoration before the function, using for example my one: http://code.activestate.com/recipes/466320/ And you will see an inter

Re: Accessing items in nested tuples

2009-04-21 Thread Mensanator
On Apr 21, 3:03 pm, alex wrote: > Hello everybody > I am able to access the data in a tuple via a for loop (see example > below). > > #!/usr/bin/env python > > class Test(): >     def Data(self): >         return ("aa", "bb", "cc", "dd", "ee", "ff", "gg", "hh") > #        return (("aa", ("bb", "cc

question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Kent
Hi there, I wrote a desktop application with wxPython2.8. And got a problem. Hope here someone can give some hint. Thanks in advance. There was a ListCtrl (lc) in my GUI, and it was a bit long, so that there would be some blank space below ("empty area") in case there were only a few items. I bi

Re: Best Python Web Framework ?

2009-04-21 Thread laplacia...@gmail.com
On Apr 21, 2:46 pm, SKYLAB wrote: > Greetings.. > > First , my english is not good . > > I heard that was written in python ( Youtube Programming Language : > PYTHON :S ) Correct ? > > That's not correct ? Then youtube is PHP application ? > > That's correct ; Which python web framework in friendf

cx_oracle

2009-04-21 Thread gita ziabari
Hello everyone, 1. I installed Oracle client on my linux x86_64 machine. 2. Set oracle home and LD_LIBRARY_PATH 3. Installed cx_oracle using rpm for python 2.5 -> It's installed and the following file exists: /usr/local/lib/python2.5/site-packages/cx_Oracle.so -> When I run python -c 'import cx_O

Re: the correct way to install python packages as non root user in non default path

2009-04-21 Thread News123
Danke Diez, easy_install without 'install' works better :-) . As as you indicated: Virtualenv installs cleanly in a separate directory named virtualenv-1.3.3-py2.5.egg, So I removed the --prefix option and installed it in the default path. By the way: Adding the word 'install' wasn't inspired b

Re: Python, MS SQL, and batch inserts

2009-04-21 Thread Scott David Daniels
ericwoodwo...@gmail.com wrote: On Apr 21, 4:01 pm, ericwoodwo...@gmail.com wrote: On Apr 21, 3:36 pm, Scott David Daniels wrote: I forget the name of the SQL Server bulk loader, bcp (bulk copy) was the name of the bulk loader. I just remembered. Sorry, no more exciting advice. i

Re: Accessing items in nested tuples

2009-04-21 Thread alex
Tim and Mensanator Thank you very much, this will get me further. I can not recall having seen this in my books... I am still getting my grips with Python and OOP. Regards Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Mike Driscoll
On Apr 21, 3:35 pm, Kent wrote: > Hi there, > > I wrote a desktop application with wxPython2.8. And got a problem. > Hope here someone can give some hint. Thanks in advance. I recommend joining the wxPython mailing list and posting there. The guys there are great and can probably help you out. Se

Re: using python logo at startup

2009-04-21 Thread Carl Banks
On Apr 21, 10:50 am, Mike Driscoll wrote: > On Apr 21, 11:46 am, Dhruv wrote: > > > Is there a way to display/flash "python powered" logo for like 2 > > seconds at startup of a helloworld application? > > > Well actually I have an application that takes data from an excel file > > and generates a

Re: question about wxpython CtrlList event binder: wx.EVT_LIST_ITEM_RIGHT_CLICK

2009-04-21 Thread Kent
Hi Mike, thx for the wxpython maillist link, I will give it a shot. But I would like to paste the code snippet here as well, hope it can tell sufficient information. (I added some comments in the class. ) Thank you. class TagListCtrl(wx.ListCtrl): ''' Tag list ListCtrl widget '''

Re: A Special Thanks

2009-04-21 Thread Fuzzyman
On Apr 21, 3:52 pm, a...@pythoncraft.com (Aahz) wrote: > In article , > Nick Craig-Wood   wrote: > > > > >Python also converted me to using unit tests.  If you add unit tests > >into your methodology above then when you re-organize (or refactor to > >use the modern jargon) the code you can be 100%

Inputting data into a website question

2009-04-21 Thread grocery_stocker
Let's say that I have a file with the following words shirt jeans belt jacket Now I want to be able to enter these words into the search function at the following website.. http://oldnavy.gap.com/?redirect=true Is there some method in the urllib method that would allow me to do this? I tried goo

Re: Inputting data into a website question

2009-04-21 Thread Benjamin Edwards
On Apr 21, 11:10 pm, grocery_stocker wrote: > Let's say that I have a file with the following words > shirt > jeans > belt > jacket > > Now I want to be able to enter these words into the search function at > the following website.. > > http://oldnavy.gap.com/?redirect=true > > Is there some metho

  1   2   >