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": False }'
lockup_info(var)



The code above doesn't work. A variable so defined is considered a string.
Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


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 <no...@nowhere.com>:
>> 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')
>>> ['ab']
>>>
>>> Why for search() the match is 'abab' and for findall the match is
>>> 'ab'?
>>
>> finditer seems to be consistent with search:
>> regex = re.compile('(ab){2}')
>>
>> for match in regex.finditer('abzzababab'):
>>   print ("%s: %s" % (match.start(), match.span() ))
>> ...
>> 4: (4, 8)
>>
>> -- https://mail.python.org/mailman/listinfo/python-list
> 
> Hi,
> as was already pointed out, findall "collects" the content of the
> capturing groups (if present), rather than the whole matching text;
> 
> for repeated captures the last content of them is taken discarding the
> previous ones; cf.:
> 
>>>> re.findall('(?i)(a)x(b)+','axbB')
> [('a', 'B')]
>>>>
> (for multiple capturing groups in the pattern, a tuple of captured parts
> are collected)
> 
> or with your example with differenciated parts of the string using
> upper/lower case:
>>>> re.findall('(?i)(ab){2}','aBzzAbAB')
> ['AB']
>>>>
>>>>
> hth,
>vbr

You explanation of re.findall() results is correct. My point is that the 
documentation states:

re.findall(pattern, string, flags=0)
Return all non-overlapping matches of pattern in string, as a list of 
strings

and this is not what re.findall does. IMHO it should be more reasonable 
to get back the whole matches, since this seems to me the most useful 
information for the user. In any case I'll go with finditer, that returns 
in match object all the infos that anyone can look for.
-- 
https://mail.python.org/mailman/listinfo/python-list


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')
> ['ab']
> 
> Why for search() the match is 'abab' and for findall the match is 'ab'?

finditer seems to be consistent with search:
regex = re.compile('(ab){2}')

for match in regex.finditer('abzzababab'): 
  print ("%s: %s" % (match.start(), match.span() ))
... 
4: (4, 8)

-- 
https://mail.python.org/mailman/listinfo/python-list


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 rustompm...@gmail.com wrote:
 On Jun 17, 6:05 am, Chris Angelico ros...@gmail.com 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 heading tab
characters but not spaces.


#!/bin/bash

for i in 1 2 3 4; do
python /dev/stdin -EOF
for i in range($i):
print i # two tabs and four spaces
EOF
done

Or alternatively you can use a temporary file:


#!/bin/bash

TEMPFILE=$(mktemp)
trap 'rm -f $TEMPFILE' TERM INT

cat  $TEMPFILE EOF
import sys

for i in range(int(sys.argv[1])):
print i
EOF

for i in 1 2 3 4; do
python $TEMPFILE $i
done


-- 
http://mail.python.org/mailman/listinfo/python-list


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 build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/
Modules/_ctypes/libffi/src
creating build/temp.solaris-2.10-i86pc-2.5/home/ecuser/Python-2.5.1/
Modules/_ctypes/libffi/src/x86
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/_ctypes.c -o build/temp.solaris-2.10-i86pc-2.5/home/
ecuser/Python-2.5.1/Modules/_ctypes/_ctypes.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/callbacks.c -o build/temp.solaris-2.10-i86pc-2.5/home/
ecuser/Python-2.5.1/Modules/_ctypes/callbacks.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/callproc.c -o build/temp.solaris-2.10-i86pc-2.5/home/
ecuser/Python-2.5.1/Modules/_ctypes/callproc.o
/home/ecuser/Python-2.5.1/Modules/_ctypes/callproc.c: In function
`_CallProc':
/home/ecuser/Python-2.5.1/Modules/_ctypes/callproc.c:918: warning:
implicit declaration of function `alloca'
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/stgdict.c -o build/temp.solaris-2.10-i86pc-2.5/home/
ecuser/Python-2.5.1/Modules/_ctypes/stgdict.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/cfield.c -o build/temp.solaris-2.10-i86pc-2.5/home/
ecuser/Python-2.5.1/Modules/_ctypes/cfield.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/malloc_closure.c -o build/temp.solaris-2.10-i86pc-2.5/
home/ecuser/Python-2.5.1/Modules/_ctypes/malloc_closure.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/libffi/src/prep_cif.c -o build/temp.solaris-2.10-
i86pc-2.5/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/src/
prep_cif.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/
temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-
i86pc-2.5/libffi -I/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/
src -I./Include -I. -I/usr/local/include -I/home/ecuser/Python-2.5.1/
Include -I/home/ecuser/Python-2.5.1 -c /home/ecuser/Python-2.5.1/
Modules/_ctypes/libffi/src/x86/ffi64.c -o build/temp.solaris-2.10-
i86pc-2.5/home/ecuser/Python-2.5.1/Modules/_ctypes/libffi/src/x86/
ffi64.o
gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
prototypes -I. -I/home/ecuser/Python-2.5.1/./Include -Ibuild/

Re: VisualStudio2005 supported in distutils

2006-08-03 Thread mg
I know the incompatibility problem to have Python compiled with one 
compiler and packages with another one. Nevertheless, in my case, Python 
is well compiled with VisualStudio2005 thank to project files provided 
by Mr Python himself. So, Python is not yet ready to support completely 
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, distutils does not support VisualStudio2005. I tried to
 modify the file msvccompiler.py without success (this case requires to
 support some changes of the Visual Studio 8 register for both Win32 and
 Win64). So, I wonder if the integration of VisualStudio2005 in distutils
 is scheduled in the Python developments or better, if someone has
 experiences or patch to support VisualStudio2005 in distutils.
 

 You shouldn't attempt to do that. Even if you manage to convince
 distutils to use VS 2005 to compile your extension, the resulting
 code may crash Python because of obscure incompatibilities between
 the compiler that was used to compile Python (VS 2003) and the compiler
 that was used to compile the extension (VS 2005).

 Whether or not it will actually crash depends on obscure details
 of the API that the extension uses.

 Regards,
 Martin
   

-- 
http://mail.python.org/mailman/listinfo/python-list


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.

Unfortunately, distutils does not support VisualStudio2005. I tried to 
modify the file msvccompiler.py without success (this case requires to 
support some changes of the Visual Studio 8 register for both Win32 and 
Win64). So, I wonder if the integration of VisualStudio2005 in distutils 
is scheduled in the Python developments or better, if someone has 
experiences or patch to support VisualStudio2005 in distutils.

Thanks,
Mathieu.
-- 
http://mail.python.org/mailman/listinfo/python-list


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/python/bin/python
  import Tkinter
 

Second, I tried to install python on IBM-Aix5.1 with tk bindings too. 
Because of tcl/tk doesn't exist on my default platform, I have installed 
tcl8.4.11 in /usr/local/tcl8.4.11. Now, I ran the compilation of Python 
and tried to import Tkinter :

./configure --prefix=/usr/local/python
make
make install
/usr/local/python/bin/python
  import Tkinter
Traceback (most recent call last):
  File stdin, line 1, in ?
  File /usr/local/python/lib/python2.5/lib-tk/Tkinter.py, line 38, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter
 

In fact, when Python is compiled, the shared library _tkinter.so should 
be compiled (Tkinter.py is just a Python script which import 
_tkinter.so) if tk is detected on the platform.

So, my questions are :
- Must I install tcl/tk in the default directories give by the 
distribution to compile python and Tkinter (_tkinter) ?
- or can I specify the tcl/tk installation to compile Python and Tkinter 
(_tkinter) ?

Regards,
Mathieu.

-- 
http://mail.python.org/mailman/listinfo/python-list


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 how) the number of iterations ?

Regards,
Mathieu
-- 
http://mail.python.org/mailman/listinfo/python-list


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 :

begin script
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
end script

The problem is simple. The function 'round' allow to obtain the value 
with the specified number of digits after the ,. Then, when the 
variable 'freq' is printed, there is no problem; but when freq is set in 
the table and the table printed, all the digits are come back.

Is it a bug or a control behavour ? I don't understand ?!?!?!?!...

Thanks

Mathieu


-- 
http://mail.python.org/mailman/listinfo/python-list


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 framework have 
some dependencies to fortran projects.
Then, in order to know if Distutils can be use in our case, I would like 
to know if :
- Can distutil compile static C/C++ libraries ?
- Can distutil compile C/C++ applications ?
- Can distutil manage fortran compiler and compile fortran libraries and 
applications ?

Thank for your answers
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: catch argc-argv

2005-06-21 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 there, that's probably for a good reason -- no demand, no use
case. 


  

Leaving aside whether or not there is a use-case for this, the reason they 
aren't there is that they aren't needed.



no use-case == no need in my book

  

As the OP was already told, to 
access argv, you simply import the 'sys' module and access sys.argv.



Simple in Python, not in C.

  

There are apis both to import modules and to get an attribute of an 
existing Python object.



I know that; my point was why should you do something tedious like that 
when you shouldn't be interested in accessing sys.argv from a C 
extension anyway.

  

 So all you need is something like (untested):

PyObject *sys = PyImport_ImportModule(sys);
PyObject *argv = PyObject_GetAttrString(sys, argv);
int argc = PyObject_Length(argv);
if (argc != -1) {
   ... use argc, argv ...
}
Py_DECREF(argv);
Py_DECREF(sys);


I understand all the good arguments explained before, and I am agree 
with them.
Nevertheless, I implement Python bindings from a generic parallel 
framework and a new application based on this framework needs to call a 
kind of initilization class : the constructor arguments are argc and 
argv... Then, the previous solution can be a work around to test some 
behavours of my bindings.
Thanks for your answers ;-) 
-- 
http://mail.python.org/mailman/listinfo/python-list


catch argc-argv

2005-06-20 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 'get_argv()' ?

Thanks,



-- 
http://mail.python.org/mailman/listinfo/python-list


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 function of Python.
So, my question is: does the Python API containe fonctions like 
'get_argc()' and 'get_argv()' ?

Thanks,





Use sys.argv:
http://python.org/doc/2.4.1/lib/module-sys.html

HTH,
Wolfram
  

I know this module and this function. But, I search the same function in 
the C-API because a would like to know these variables directly in my 
bindings written in C++.

As an example, I try to create the following fonction :

PyMODINIT_FUNC initMyModule( void )
{
int argc = Py_GetArgc() ; // I don't know if this function exist : I 
would like to know...
char** argv = Py_GetArgv() ; // I don't know if this function exist 
: I would like to know...

myfunction( argc, argv ) ;

   PyObject* module = Py_InitModule3( MyModule, 0, module of my FEM 
application ) ;
}

Thanks to this C function written with the C-API of Python, I will 
create a new Python module and import it in the Python interpreter :

  import MyModule


-- 
http://mail.python.org/mailman/listinfo/python-list


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
|   |-- __init__.py
|   `-- config.py
`-- src2
   `-- pkg
   |-- __init__.py
   `-- spkg2
   |-- __init__.py
   `-- config2.py

and main.py is a python script that contains this imports:



from pkg.spkg1 import config
from pkg.spkg2 import config2
  

executed in linux whith this:

env PYTHONPATH=src:src2 src/pkg/main.py
Traceback (most recent call last):
 File src/pkg/main.py, line 4, in ?
   from pkg.spkg2 import config2
ImportError: No module named spkg2

changing the order of the python path only inverts the problem, is there
any way to solve this without changing the directory structure?



Nope.  When Python goes to look for a package called pkg, it starts at
the beginning of PYTHONPATH and stops as soon as it finds one.  You either
need to use different names for the two packages (pkg1, pkg2), or use a
symbolic link to link spkg2 into the src directory.
  

If I remember, I think you need to add an __init__.py file just in your 
directories src  src2.
Moreover, you can add the path of src and src2 to the variable sys.path 
at the beginning of your main script (in that case, it not necessary to 
define PYTHONPATH)

I hope I help you
Mathieu
-- 
http://mail.python.org/mailman/listinfo/python-list


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 compiled with the -g flag  
which might be the debug flag. (On the other hand, the option -DNDEBUG 
is defined : it's normal !)

Then my question is :
Is exist a flag/option to run the shell script named 'configure' 
allowing to remove the '-g' flag located in the generated makefile ?

Thanks



-- 
http://mail.python.org/mailman/listinfo/python-list


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. What is the solution ?

Thanks





-- 
http://mail.python.org/mailman/listinfo/python-list


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 is normal, because only python25_d.lib 
exist !)

I opened the source file which include Python.h, which include 
pyconfig.h.located in the directory PC. Then, I found  this :

#ifdef MS_COREDLL
#   ifndef Py_BUILD_CORE /* not building the core - must be an ext */
#   if defined(_MSC_VER)  /* So MSVC users need not specify 
the .lib file in   their Makefile (other compilers are generally  taken 
care of by distutils.) */
#   ifdef _DEBUG
#   pragma comment(lib,python25_d.lib)
#   else
#   pragma comment(lib,python25.lib)
#   endif /* _DEBUG */
#   endif /* _MSC_VER */
#   endif /* Py_BUILD_CORE */
#endif /* MS_COREDLL */ 

Then, the symbol _DEBUG need to be define... (I added at the beginning 
of the file: it seems to be the solution) to import the debug version 
instead of the release version.

But, how can I run the compilation (options on the comand line maybe) 
which use the python25_d.lib, i.e. how the symbol _DEBUG can be defined 
when I write 'python_d setup.py build' ? In other words, with a Python 
in debug, I would generate packages in debug too and propagate the debug 
mode from Python to the packages...

Thanks



-- 
http://mail.python.org/mailman/listinfo/python-list


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_cvs --with-cxx=aCC


(...)
creating Makefile
aCC -c  -DNDEBUG -O  -I. -I./Include   -DPy_BUILD_CORE -o
Modules/ccpython.o ./Modules/ccpython.cc
/usr/include/sys/unistd.h, line 594: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline truncate(const char *a, off_t b)   { return
__truncate64(a,b); }
 ^
 
/usr/include/sys/unistd.h, line 595: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline prealloc(int a, off_t b)   { return
__prealloc64(a,b); }
 ^
 
/usr/include/sys/unistd.h, line 596: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline lockf(int a, int b, off_t c)   { return
__lockf64(a,b,c); }
 ^
 
/usr/include/sys/unistd.h, line 597: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline ftruncate(int a, off_t b)  { return
__ftruncate64(a,b); }
 ^
 
/usr/include/sys/stat.h, line 173: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
   inline lstat __((const char *, struct stat *));
  ^
 
./Include/pyport.h, line 612: error #2035: #error directive: LONG_BIT
  definition appears wrong for platform (bad gcc/glibc
config?).
  #error LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?).
   ^
 
1 error detected in the compilation of ./Modules/ccpython.cc.
*** Error exit code 2
 
Stop.
aCC -c  -DNDEBUG -O  -I. -I./Include   -DPy_BUILD_CORE -o
Modules/ccpython.o ./Modules/ccpython.cc
/usr/include/sys/unistd.h, line 594: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline truncate(const char *a, off_t b)   { return
__truncate64(a,b); }
 ^
 
/usr/include/sys/unistd.h, line 595: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline prealloc(int a, off_t b)   { return
__prealloc64(a,b); }
 ^
 
/usr/include/sys/unistd.h, line 596: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline lockf(int a, int b, off_t c)   { return
__lockf64(a,b,c); }
 ^
 
/usr/include/sys/unistd.h, line 597: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
  inline ftruncate(int a, off_t b)  { return
__ftruncate64(a,b); }
 ^
 
/usr/include/sys/stat.h, line 173: warning #2837-D: omission of
explicit
  type is nonstandard (int assumed)
   inline lstat __((const char *, struct stat *));
  ^
 
./Include/pyport.h, line 612: error #2035: #error directive: LONG_BIT
  definition appears wrong for platform (bad gcc/glibc
config?).
  #error LONG_BIT definition appears wrong for platform (bad gcc/glibc
config?).
   ^
 
1 error detected in the compilation of ./Modules/ccpython.cc.
*** Error exit code 2
 
Stop.



-- 
http://mail.python.org/mailman/listinfo/python-list


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.h and some symbols who are 
not defined. See the trace :

   running install
   running build
   running build_py
   running build_ext
   Warning - can't find an installed platform SDK
   Found WINDOWS.H version 0x501 in C:\Program Files\Microsoft 
Visual Studio .NET 2003\Vc7\PlatformSDK\include
   building 'win32print' extension
   C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\bin\link.exe /DLL /nologo /INCREMENTAL:NO 
/LIBPATH:C:\ext_projects\python\dist\src\libs 
/LIBPATH:C:\ext_projects\python\dist\src\PCBuild 
/LIBPATH:build\temp.win32-2.5\Release winspool.lib user32.lib 
/EXPORT:initwin32print 
build\temp.win32-2.5\Release\win32\src\win32print\win32print.obj 
/OUT:build\lib.win32-2.5\win32\win32print.pyd 
/IMPLIB:build\temp.win32-2.5\Release\win32\src\win32print\win32print.lib 
/MACHINE:ix86
   Creating library 
build\temp.win32-2.5\Release\win32\src\win32print\win32print.lib and 
object build\temp.win32-2.5\Release\win32\src\win32print\win32print.exp
   win32print.obj : error LNK2019: unresolved external symbol 
[EMAIL PROTECTED] referenced in function struct _object * __cdecl 
PyStartDoc(struct _object *,struct _object *) 
(?PyStartDoc@@YAPAU_object@@[EMAIL PROTECTED]@Z)
   win32print.obj : error LNK2019: unresolved external symbol 
[EMAIL PROTECTED] referenced in function struct _object * __cdecl 
PyEndDoc(struct _object *,struct _object *) 
(?PyEndDoc@@YAPAU_object@@[EMAIL PROTECTED]@Z)

Then, I don't kwnow how to solve theses problem ! Is there someone tho 
help me ?
Thank,

Mathieu G.
--
http://mail.python.org/mailman/listinfo/python-list