Dynamic query in mongodb and variable

2016-07-11 Thread MG
Ciao, I have this function: def lockup_info(refer): info = [] amb = CONN.db..find({"reference": refer} for a in amb: print a How can I pass this value { "$exists": False } and tell python to not consider it as a string? var = '{ "$exists": Fals

Re: one more question on regex

2016-01-22 Thread mg
Il Fri, 22 Jan 2016 21:10:44 +0100, Vlastimil Brom ha scritto: > 2016-01-22 16:50 GMT+01:00 mg : >> Il Fri, 22 Jan 2016 15:32:57 +, mg ha scritto: >> >>> python 3.4.3 >>> >>> import re re.search('(ab){2}','abzzabab') >>> &

Re: one more question on regex

2016-01-22 Thread mg
Il Fri, 22 Jan 2016 15:32:57 +, mg ha scritto: > python 3.4.3 > > import re re.search('(ab){2}','abzzabab') > <_sre.SRE_Match object; span=(4, 8), match='abab'> > >>>> re.findall('(ab){2}','abzzabab')

one more question on regex

2016-01-22 Thread mg
python 3.4.3 import re re.search('(ab){2}','abzzabab') <_sre.SRE_Match object; span=(4, 8), match='abab'> >>> re.findall('(ab){2}','abzzabab') ['ab'] Why for search() the match is 'abab' and for findall the match is 'ab'? -- https://mail.python.org/mailman/listinfo/python-list

Re: Embedding Python in a shell script

2011-06-17 Thread mg
rusi wrote: > On Jun 17, 6:05 am, Chris Angelico wrote: > >> > Python call becomes.  I'd prefer something like: >> >> #!/bin/bash >> for i in 1 2 3 4; do >>   python -c "if True: > # comfortably indented python code > > Thanks. Nice! You can use bash here document feature, <<-, that strips hea

trouble building Python 2.5.1 on solaris 10

2008-07-09 Thread mg
When make gets to the _ctypes section, I am getting the following in my output: building '_ctypes' extension creating build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/ Modules/_ctypes creating build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/ Modules/_ctypes/libffi creating bui

Re: VisualStudio2005 supported in distutils

2006-08-03 Thread mg
VisualStudio2005: Python can be compiled with VisualStudio2005 but a VisualStudio2005-compiled-Python can not install additional packages. So, if someone can help me or provides me a solution, I am very interested ;-) Martin v. Löwis wrote: > mg schrieb: > >> Unfortunately, distut

VisualStudio2005 supported in distutils

2006-08-02 Thread mg
Hello, I try to compile Python and several packages (like Numarray) with Visual Studio 2005. I downloaded the last version of Python from Subversion, and project files are provided for Visual Studio 2005. With some few simple corrections, everything compile and Python run correctly. Unfortunat

Compilation of _tkinter, tcl/tk bindings

2005-10-14 Thread mg
Hello, First, I installed Python on a traditionnal default linux-x86 platform (tk.h is located in /usr/include) and I did not meet any problem. I can write the following instruction without error in my python interpreter: ./configure --prefix=/usr/local/python make make install /usr/local/pyth

recursive function

2005-10-07 Thread mg
Hello, In a recursive function like the following : def foo( j ) : j += 1 while j < n : j = foo( j ) return j in found that the recursivity is limited (1000 iterations). Then, I have two questions : - why this mecanism has been implemented ? - it is possible to increase or remove (and h

round function problem

2005-09-06 Thread mg
Hi everybody... We try to white scripts with Pyrhon 2.4 for an acoustic simulation and we wrote these follow lines : c = 340 i =j=k= 1 sum_ = 23 table = [] freq = round((c/2*(sum_)**0.5),2) print freq table.append([freq,(i,j,k)]) print i,j,k,' freq',freq for item in table: print item The prob

distutils is able to handle...

2005-07-05 Thread mg
Hello I work on an finite element framework and Python bindings have been developped. Actually, we use Boost.Build as build system but we would like to change it. We have two kinds of problems. First, the framework is used for generate pure C++ applications with static libraries ; second, the

Re: catch argc-argv

2005-06-20 Thread mg
John Machin wrote: >Duncan Booth wrote: > > >>John Machin wrote: >> >> >> >> So, my question is: does the Python API containe fonctions like 'get_argc()' and 'get_argv()' ? >>>If you can't see them in the documentation, they aren't there. If they >>>aren't the

Re: catch argc-argv

2005-06-20 Thread mg
Wolfram Kraus wrote: >mg wrote: > > >>Hello, >> >>I am writting bindings for a FEM application. In one of my function >>'initModulename', called when the module is imported, I would like to >>get the argc and argv arguments used in the main f

catch argc-argv

2005-06-19 Thread mg
Hello, I am writting bindings for a FEM application. In one of my function 'initModulename', called when the module is imported, I would like to get the argc and argv arguments used in the main function of Python. So, my question is: does the Python API containe fonctions like 'get_argc()' and

Re: Help with pythonpath

2005-06-06 Thread mg
Tim Roberts wrote: >Observer <[EMAIL PROTECTED]> wrote: > > >>Hi, im a newbie both to python and this list. >>I hope someone can help me whith this: >> >>I have a directory structure like this: >>. >>|-- src >>| `-- pkg >>| |-- __init__.py >>| |-- main.py >>| `-- spkg1 >>|

Compile debug packages on windows

2005-06-03 Thread mg
First, I compiled Python in DEBUG on Win32 with MSCV.net and the solution distributed in the Python packages. Second, I try to compiled NUMARRAY with my python debug : python_d setup.py build And the compilation crash with the following message : the file python25.lib does not exist (it

bdist_wininst to distribute a patched python

2005-06-03 Thread mg
Hi, Because of I have patched Python, I would like to create a Windows installer containing my patched-Python. So, I try to use the option 'bdist_wininst' on the setup.py file distributed by python it is supported ? If yes, I have a problem : the run tell me that pyconfig.h does not exist

compile python in release...

2005-06-03 Thread mg
Hi, I try to install two Python environments on my platform: one in release, the other in debug. I generate the RELEASE Python environment with the following instructions : > ./configure --prefix=/usr/local/python --enable-shared > make My problem is here : all the source files are comp

Python 2.5 CVS broken for HP-UX platform?

2005-05-31 Thread mg
Hello, While trying to compile Python 2.5 from the nighlty CVS image, it raises the following errors on HP-UX. This disables me the use of HP-UX for some projects: Compilation flags: export CC=aCC export CFLAGS="-Ae +DD64" export LDFLAGS="+DD64" make clean ./configure --prefix=/usr/local/python_c

PyWin32 installation

2005-01-24 Thread mg
Hi all, I have reinstalled my Win32 computer last week and I did an update of the project PyWin32 to complete my Python installation. (I have to use sources from CVS for my project !) So, when I run 'python setup.py' in my PyWin32 directory, I have two problem : the version indacated in windows.