I am building a python work environment where
- i build python from sources
- install pip with the wheel bundled with python
- then install things with pip, like Jupyter
That environment is then deployed on various machines, at various
installation folders.
One issue I encounter, is the path t
Partly answering myself:
For some reason, right after mystdout has been created, i now have to
do mystdout.seek(0) and this solves the issue.
No idea why though..
Le jeu. 11 avr. 2024 à 14:42, Olivier B.
a écrit :
>
> I am trying to use StringIO to capture stdout, in code that looks lik
I am trying to use StringIO to capture stdout, in code that looks like this:
import sys
from io import StringIO
old_stdout = sys.stdout
sys.stdout = mystdout = StringIO()
print( "patate")
mystdout.seek(0)
sys.stdout = old_stdout
print(mystdout.read())
Well, it is not exactly like this, since this
libpython.so, which could be pointing to any
version. I'll try that next
Le ven. 29 mars 2024 à 10:10, Barry a écrit :
>
>
>
> > On 28 Mar 2024, at 16:13, Olivier B. via Python-list
> > wrote:
> >
> > But on Linux, it seems that linking to libpython3.so instead of
I have a python module that includes some C++ code that links with the
Python C API
I have now modified the c++ code so that it only uses the Limited API,
and linked with python3.lib instead of python311.lib.
I can now use that python module with different python versions on Windows
But on Linux
Hi,I am in the process of trying to make my code (an c++ executable
and swig modules using the Python C API) lose the dependency to python
3.7, to be compatible with all Python 3.2+
I tried linking to python.lib instead of python37.lib. As i am still
using a few things that are not in the limited
Envoye `a partir de [1]Courrier pour Windows
[2][IMG] Garanti sans virus. [3]www.avast.com
References
Visible links
1. https://go.microsoft.com/fwlink/?LinkId=550986
2.
https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=em
samedi 13 octobre 2018 à 19:24:28 UTC+2, Anthony Flury
a écrit :
Olivier,
Welcome to the list - before we can help you, we need some more information :
- What Operating system are you using - Windows/Mac/Linux/Raspberry
Pi/Android for something else ?
- What command or
Hi!I downloaded and installed python 3.6.4 (32-bit) on my computer but I have
problems and can not access the python interface.
I need your technical assistance to solve this matter.
Best regard!
Olivier OUSSOUMedical entomologist, Benin
--
https://mail.python.org/mailman/listinfo/python-list
If i try to build a normal python and a 'with-pydebug' python in the same
folder, I can run both versions of python by running the real executable names
instead of the generic name symlinks.
However, if i want to use sysconfig.get_config_var() to check "Py_DEBUG" (to
then know from .py files wh
Je vais essayer de programmer en python. On verra bien !
--
https://mail.python.org/mailman/listinfo/python-list
fore
each step. But it is not very elegant ...
One other approach would be to add dynamically an attribute the the
step1 function, and retrieve it inside the function, but it is perhaps
overkill.
Do you have some ideas ?
Thanks,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
You're right, I use Python 2.6.6
--
http://mail.python.org/mailman/listinfo/python-list
Thank you to all of you !!
so finally, I can simply write :
#!/usr/bin/env python
def int2binPadded(number, size):
"""The purpose of this function is to convert integer number to binary
number
0-padded."""
if type(number)!=int or number < 0:
raise ValueError, "should be a
print int2binPadded(int(sys.argv[1]),int(sys.argv[2]))
This satisfies my needs !
Though, what do you think about it ?
Thank you for you remarks,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
Hey
Want to free hosting... This is for very short time.
Visithttp://www.balticwebhost.com/aff.php?aff=001
--
http://mail.python.org/mailman/listinfo/python-list
gt; with open("tmp.jpg", "w") as f: f.write(img)
> ...
>>>>
>
> Now if you are using that workaround a lot he may come up with more
> sophisticated techniques. So dont ;)
>
> Peter
Thanks Peter, it works perfectly !
At 60 fps I can even make a video ...
;-)
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
n previous pictures can be displayed ...
So I am a bit lost ... Any help would be very appreciate !!
Thanks,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
lso worth mentioning:
>
> - The Python Computer Graphics Kit ( http://cgkit.sourceforge.net )
>
> Cheers
>
And you could add Cortex, http://cortex.devjavu.com, various C++
libraries with Python binding to manipulate 3d content creation format
and either display them in OpenGL format or export them to RIB format
for rendering.
--
Olivier Renouard
--
http://mail.python.org/mailman/listinfo/python-list
I found an even simpler solution: use the -mstackrealign GCC option to
build the shared library.
--
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
Replying to myself:
haypo found the origin of the problem. Apparently this problem stems
from a GCC bug [1] (that should be fixed on x86 as of version 4.4).
The bug is that GCC does not always ensure the stack to be 16 bytes
aligned hence the "__m128 myvector" local variable in the previous
code
* and then
> return the latter in a function with C bindings.
http://cython.org also has some support for C++ bindings.
I also heard that Boost.Python is very well suited to make full
featured C++ / python bindings though I never tried myself.
--
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
m not familiar with python internal at all so I cannot understand
what's wrong. You can notice that valgrind make the program run till
the end and display the correct results (4 zeros) on stdout while
logging a bunch of errors (most of those are not related to our
problem since they appear when
On Sep 28, 11:21 am, est <[EMAIL PROTECTED]> wrote:
> On Sep 28, 4:38 pm, Steven D'Aprano <[EMAIL PROTECTED]
> Can anyone tell me how to customize a default encoding, let's say
> 'ansi' which handles range(256) ?
I assume you are using python2.5
Edit the file /usr/lib/python2.5/site.py
There is a
David a écrit :
Also, I can't find any reference to cookies or sessions in the webpy
online docs. Maybe it's possible to bolt on support with Python's
Cookie module.
The web.py cookbook describes how to use sessions and cookies:
http://webpy.org/cookbook
Regards,
O
>> But in python eventually stdout.readline() hangs. This is a real
>> nuisance: why can't it just return None?
>
> Because that would be quite annoying because most of the time people want
> blocking behavior.
Just an afterthought: do people prefer the blocking behaviour because
blocking until
pexpect looks promising, thanks.
-- O.L.
--
http://mail.python.org/mailman/listinfo/python-list
>> Yes, that has since occurred to me. I need to echo some magic string
>> after each command to know that I reached the end of the answer to
>> the previous command. In interactive mode the prompt fulfills that
>> role.
>
> And hope that that "magic string" does not occur somewhere within
> the r
> The buffering behavior at the interactive prompt is very often different
> from connections via pipes.
I hadn't thought of that. I will ask on the Octave list.
Thanks,
-- O.L.
--
http://mail.python.org/mailman/listinfo/python-list
>> Indeed, if I do this interactively, I can tell after 3 lines that I've
>> gotten all there is to get right now and the fourth readline() call
>> hangs.
>
> Can you really?
Yes interactively: at the command prompt, you can tell when it's over
because you know the command you just sent and whet
> The `trheading` module is modeled after Java's threading API.
OK. Thanks for the hint. However BufferedReader.readline() does
not block in Java, so it is still difficult to transpose.
>> But how can I find out *programmatically* that there is no more
>> input?
>
> You can't.
How do people han
Hi Steve,
Thanks for the answer. Yes this is tricky. I have done it in Java
before, where you can, e.g., set up a thread to pump stuff out of
both stderr and stdout continuously but my python is too rudimentary
for that. There is a key difference anyway: in Java you can write
while (br.readL
I am calling subprocess.Popen with
p = Popen(args, bufsize=-1, stdin=PIPE, stdout=PIPE, stderr=PIPE)
and after sending come command to the process, I try to read
from p.stdout but after a few calls I hang. What is the correct
way to do this, i.e., to read everything w/o getting stuck? I am
not fami
rator on win32. It should be "/" or "\\",
never "\".
Regards,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
, where the theses lib versions are not
allways the same.
Is it possible to configure that ?
thanks,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> En Tue, 01 May 2007 04:44:57 -0300, Olivier Oost <[EMAIL PROTECTED]>
> escribió:
>
>> I need to login to a online forum, like a phpbb forum, and leave a
>> message there. I figured I need to use cookielib, but the
>> documentation of
Hi,
I need to login to a online forum, like a phpbb forum, and leave a
message there. I figured I need to use cookielib, but the documentation
of cookielib is not very clear to me.
I tried to just copy/paste all the cookies from FireFox into my
Python-program, like this:
import cookielib, urll
Hi,
I'm encountering an odd problem while running a python script which
calls a C program
called 'st_time' :
Traceback (most recent call last):
File "ccdd.py", line 177, in ?
answer=proc_request(conn,addr,request) # proc
the
request
File "ccdd.py", line 69, in proc_re
an utf-8
should be advised against). Such a feature would be greatly
appreciated by all of us non native English speakers around the world.
Best regards,
== Olivier
--
http://mail.python.org/mailman/listinfo/python-list
str is a text representation of the object, you can see it as a nice print
repr is the text representation of the object that you can evaluate to
get the same object
Johny wrote:
> Where and when is good/nescessary to use `repr` instead of `str` ?
> Can you please explain the differences
> Than
I'm working on a tree and I have refcounting problems.
Is it possible from an object, to get the list of objects referencing it ?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
There was a coding standard where I worked and the intention behind this
requirement was to make the code printer friendly. Printing code source
with lines longer than 80 chars greatly hinder readability on paper.
Greetings,
Olivier Langlois
http://www.olivierlanglois.net
>
> I also
ot;,
line 69, in Validate
raise CDKeyException, self.logger.error(e) CDKeyException
Any idea what is happening?
Thanks,
Olivier Langlois
http://www.olivierlanglois.net
--
http://mail.python.org/mailman/listinfo/python-list
s but if I do that and compile _mysql.pyd. When that module
is initialized, python is crashing because PyRun_String returns a NULL
pointer instead of the expected valid PyObject pointer.
Is there anybody that can help me?
Thank you,
Olivier Langlois
http://www3.sympatico.ca/olanglois
--
facing.
I have kept thinking about the original problem and I now believe that
the only solution if he wants to store 3.6GB of data in a Python script
is to recompile Python in 64 bits. I do not know if this is something
that someone has already done successfully...
Olivier Langlois
http
That is a good observation!
Considering that hash tables to have good performance need to have a
fill rate of 70% or lower means that if you try to fit 3.6 GB of data
into a dict, your memory requirement will be much higher than 3.6GB.
BTW, this brings a new question. How does Python controls dic
Just out of curiosity. What is the OS that you are using? I am asking
because I do not know about XP 64bits edition but if you are using
Windows XP 32 bits version, no matter how much RAM you have on your
machine, the OS has an inherent 4GB address space limit per process.
Olivier Langlois
http
Gary Robinson wrote:
> I'm in the market for a server to run some python code which is
> optimized via psyco.
>
> Sun T2100 servers come with Solaris 10, which comes with python
> pre-installed.
You can always install a 32bits version of Linux or Solaris on the X2100
yourself. The X2100 is even
Hi Michael,
Normalizing the whitespace is what I was looking to do. I guess that
that aspect of my original query was not enough clear. But with either
solutions, I get the result I wanted.
Greetings,
Olivier Langlois
http://www.quazal.com
> -Original Message-
> Fredrik Lundh
Hi Michael!
Your suggestion is fantastic and is doing exactly what I was looking
for! Thank you very much.
There is something that I'm wondering though. Why is the solution you
proposed wouldn't work with Unicode strings?
Olivier Langlois
http://www.quazal.com
>
> impo
Hi,
I would like to make a string comparison that would
return true without regards of the number of spaces and new lines chars between
the words
like ‘A B\nC’ = ‘A\nB
C’
What would be the easiest way to do it in Python?
Thanks,
Olivier Langlois
http://www.quazal.com
capacities (for instance, a wrap around grep).
I used to run it behind apache with cgi, but it should be possible to
use it with a lightweight-no install web server.
HTH,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
flag has on
scripts but I have not found much…
So my question is: what are the ‘optimizations’
that the Python interpreter is doing when you specify the optimize flag and is
there anything I should be cautious about when using it?
Thank you,
Olivier Langlois
http://www.quazal.com
path to launch the relevant version at will.
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
rame database.
>
> Looks like I'd probably want to use something that conforms to the
> DB-API 2.0.
You want to use cx_Oracle :
http://www.python.net/crew/atuining/cx_Oracle/index.html
which is nowadays the very best python Oracle driver.
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
;
req.write("Under Construction")
if APACHE:
return apache.OK
##
if __name__ == "__main__":
req = DummyRequest()
handler(req)
HTH,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
s(sys.modules, str)
> and objgrep, which i didn't know about
>
This looks relevant too (not tested though):
http://pysizer.8325.org/
--
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
p.python.org/pypi?%3Aaction=browse
--
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
__main__.MyClass instance at 0xb7bfb76c>
>>> obj.a, obj.b, obj.done
(1, 2, 1)
>>>
As I've never used the persistent_id mechanism of pickle I don't know
if that would do the trick.
Cheers,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
Christophe wrote:
> [EMAIL PROTECTED] a écrit :
>
>>> I found LGT http://lgt.berlios.de/ but it didn't seem as if the
>>> NanoThreads module had the same capabilites as stackless.
>>
>> What specific capabilities of Stackless are you looking for, that are
>> missing from NanoThreads?
>
> Capabili
-so
> Also, if this is not appropriate for this group, does anyone know of a
> Python group for which this is more appropriate?
The mod_python mailing list ? At http://www.modpython.org/ .
Regards,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
What do you mean about "a couple of day" ? because I need to do this for
next month (a beta version) and the final version for september. do you
think plone 2.1 will be release at this date ?
thanks.
Olivier.
- Original Message -
From: <[EMAIL PROTECTED]>
Newsgroups:
i need to create a multilinguage site and i need help :
first i want to know what is the best and simple solution for a
multilinguage site with plone 2?
i want some tutorial, how to and if possible exemple
next i need to modify the user standard information to put my personnal
information like ad
On Wed, 01 Jun 2005 22:27:44 +, John J. Lee wrote:
> Olivier Favre-Simon <[EMAIL PROTECTED]> writes:
>
>> On Tue, 31 May 2005 00:52:33 -0700, Michele Simionato wrote:
>>
>> > I would like to know what is available for scripting browsers from
>>
On Tue, 31 May 2005 00:52:33 -0700, Michele Simionato wrote:
> I would like to know what is available for scripting browsers from
> Python.
> For instance, webbrowser.open let me to perform GET requests, but I
> would like
> to do POST requests too. I don't want to use urllib to emulate a
> browse
Hi Jeff,
You was right, my problem was coming from the number of items that I
gave to the "unpack" method.
I was thinking,like an array in C, that slice [2:5] will give 4 items and not 3.
Thanks a lot for your help.
Olivier
On 5/3/05, Jeff Epler <[EMAIL PROTECTED]> wrote:
>
program since I got a syntax error.
Could you help me to find a solution?
Thanks,
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
Le lundi 28 fÃvrier 2005 Ã 17:08 +, Dennis Lee Bieber a Ãcrit :
> On Mon, 28 Feb 2005 16:43:45 +0100, Olivier Ravard
> <[EMAIL PROTECTED]> declaimed the following in
> comp.lang.python:
>
> >
> > Remark : This problem does not exist under Linux.
> >
This problem does not exist under Linux.
Thanks for your answers and ideas.
Olivier
--
http://mail.python.org/mailman/listinfo/python-list
variable then?)
regards,
Olivier
(I know extending is the preferred solution, unfortunately I was not aware
of this some years ago)
And now a word from our sponsor --
For a quality usenet news server, try DNEWS, easy to install,
fast, efficient and reliable. For
"Caleb Hattingh" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Olivier
>
> If you consider using the ctypes module, you can write a dll (windows) or
> a shared object (linux) using anything that can make one of those.
>
> For example, I
Hi,
When I tryed to compile a python module using distutils under windows,
and there is an error message if we do not have Microsoft Visual C++ 6
installed.
This is because python have been compiled with MSVC6 and distutils wants it
in order to compile C++ python modules.
One of the reasons why I
Hello
What is the equivalent function of php isset() in python
Thank you very much.
olivier noblanc
http://www.logiciel-erp.fr
--
http://mail.python.org/mailman/listinfo/python-list
how to move in function ?
"Fredrik Lundh" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Olivier Noblanc wrote:
>
>> In the botom of this post you will see my source code.
>>
>> The problem is when i launch main.py that doesn
Hello,
In the botom of this post you will see my source code.
The problem is when i launch main.py that doesn't make anything why ?
Thanks
olivier noblanc
Atousoft
http://www.logiciel-erp.fr
I have main.py :
-
import wx
import inc.impor
Problem solved thanks a lot
"Steve Holden" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Olivier Noblanc ATOUSOFT wrote:
>
>> Hello,
>>
>>
>> When i want to import a .py fire from another subdirectory i make
>>
>&
Hello,
When i want to import a .py fire from another subdirectory i make
import inc/setupxml
but that make me an error message.
A man tell me to put a dot but that doesn't work.
Can you help me ?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
77 matches
Mail list logo