Changing path to python in pip.exe, ipython.exe, etc

2024-04-25 Thread Olivier B. via Python-list
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

Re: First two bytes of 'stdout' are lost

2024-04-11 Thread Olivier B. via Python-list
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

First two bytes of 'stdout' are lost

2024-04-11 Thread Olivier B. via Python-list
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

Re: Making 'compiled' modules work with multiple python versions on Linux

2024-03-29 Thread Olivier B. via Python-list
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

Making 'compiled' modules work with multiple python versions on Linux

2024-03-28 Thread Olivier B. via Python-list
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

Re: Bug 3.11.x behavioral, open file buffers not flushed til file closed.

2023-03-05 Thread Frank B
Am 05.03.23 um 15:35 schrieb aapost: I have run in to this a few times and finally reproduced it. Whether it is as expected I am not sure since it is slightly on the user, but I can think of scenarios where this would be undesirable behavior.. This occurs on 3.11.1 and 3.11.2 using debian 12 te

Module use of python3_d.dll conflicts with this version of Python

2023-01-26 Thread Olivier B.
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

Vb6 type to python

2022-11-30 Thread luca72.b...@gmail.com
Hello i have a byte file, that fill a vb6 type like: Type prog_real codice As String * 12'hsg denom As String * 24'oo codprof As String * 12 'ljio note As String * 100 programmer As String * 11 Out As Integer b_out As Byte'TRUE = Se

Update from 3.9 to 3.10.8 and uninstall 3.9

2022-10-23 Thread B N
I am new to python and wish to update 3.9 to3.10.8 which I have downloaded. How do I replace 3.9 with the 3.10.8 I downloaded. Kind regards JohnGee -- https://mail.python.org/mailman/listinfo/python-list

is there somebody that have experince with python and canopen

2022-04-15 Thread luca72.b...@gmail.com
We are searching for someone that can develop a python program for use servomotor for automotive. -- https://mail.python.org/mailman/listinfo/python-list

Issues

2022-04-08 Thread Stevenson, John B via Python-list
do to fix this? Error sent back is "'python' is not recognized as an internal or external command, operable program or batch file." Thank you. John B. (Jack) Stevenson -- https://mail.python.org/mailman/listinfo/python-list

python list files and folder using tkinter

2021-12-05 Thread Pascal B via Python-list
Hello, I have already posted a message some time ago for this app. Since then, I didn't code in python or made any changes. I think before getting further with functionnalities a few things or the whole thing need to be changed. For exemple, it would need a button to pick folders and maybe ask if

Php vs Python gui (tkinter...) for small remote database app

2021-06-14 Thread Pascal B via Python-list
Hi, I would like to know if for a small app for instance that requires a connection to a remote server database if php is more suitable than Python mainly regarding security. Php requires one port for http and one port for the connection to the database open. If using Python with a tkinter gui,

reactive programming use case

2020-03-11 Thread Raf B
hi, i am thinking about using RxPy to solve the following problem, and not yet sure if its the right tool for the job. I am working on a calculation engine, that takes a dataset (or multiple sets) and calculates new columns. so in pandas terms, it starts as DataFrame, and then i run it thro

How to POST html data to be handled by a route endpoint

2020-03-07 Thread =?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs
First i must say i use Bottle, but the same may also be the case in Flask too. I ask here and not in sub Bottle because there are only a few people there and i receive no responses. Actualy since i started here let me say what i have found. Iam just trying to post html form data to the followin

How to POST html data to be handled by a route endpoint

2020-03-06 Thread =?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs
First i must say i use Bottle, but the same may also be the case in Flask too. I ask here and not in sub Bottle because there are only a few people there and i receive no responses. Actualy since i started here let me say what i have found. Iam just trying to post html form data to the followin

Re: __hash__ and ordered vs. unordered collections

2017-11-21 Thread Josh B.
On Monday, November 20, 2017 at 3:17:49 PM UTC-5, Chris Angelico wrote: > Neither is perfect. You have to take your pick between them. Right on, thanks for weighing in, Chris. Your responses have been very helpful. I wouldn't feel comfortable claiming the authority to make this call alone. But f

Re: __hash__ and ordered vs. unordered collections

2017-11-20 Thread Josh B.
On Monday, November 20, 2017 at 2:31:40 PM UTC-5, MRAB wrote: > What if there are duplicate elements? > > Should that be MyColl(some_elements) == MyOrderedColl(other_elements) > iff len(some_elements) == len(other_elements) and set(some_elements) == > set(other_elements)? Yes, that's what I mea

Re: __hash__ and ordered vs. unordered collections

2017-11-20 Thread Josh B.
On Monday, November 20, 2017 at 1:55:26 PM UTC-5, Chris Angelico wrote: > But what you have is the strangeness of non-transitive equality, which > is likely to cause problems. But this is exactly how Python's built-in dict and OrderedDict behave: >>> od = OrderedDict([(1, 0), (2, 0), (3, 0)]) >>>

__hash__ and ordered vs. unordered collections

2017-11-20 Thread Josh B.
Suppose we're implementing an immutable collection type that comes in unordered and ordered flavors. Let's call them MyColl and MyOrderedColl. We implement __eq__ such that MyColl(some_elements) == MyOrderedColl(other_elements) iff set(some_elements) == set(other_elements). But MyOrderedColl(so

Re: Python in Perspective

2017-09-10 Thread Tristan B. Kildaire
On 2017-09-10 12:21 PM, Leam Hall wrote: y'all, My god-kids and their proginators lost most everything because of Harvey. I spent much of yesterday worrying about a friend who had gone quiet as he evacuated his family ahead of Irma. Please keep Python in perspective. Whether we use 1.5 or 4r

Re: Python.NET question?

2017-03-21 Thread Tristan B. Kildaire
On 2017/03/21 1:46 PM, Steve D'Aprano wrote: On Tue, 21 Mar 2017 08:39 pm, Tristan B. Kildaire wrote: On 2017/03/21 11:07 AM, Ivo Bellin Salarin wrote: IronPython? Le mar. 21 mars 2017 08:52, Tristan B. Kildaire a écrit : Is Python.NET a version of Python that compiles Python source

Re: Python.NET question?

2017-03-21 Thread Tristan B. Kildaire
On 2017/03/21 11:07 AM, Ivo Bellin Salarin wrote: IronPython? Le mar. 21 mars 2017 08:52, Tristan B. Kildaire a écrit : Is Python.NET a version of Python that compiles Python source code to Microsoft's IR for running by a MS runtime? -- https://mail.python.org/mailman/listinfo/python-li

Python.NET question?

2017-03-21 Thread Tristan B. Kildaire
Is Python.NET a version of Python that compiles Python source code to Microsoft's IR for running by a MS runtime? -- https://mail.python.org/mailman/listinfo/python-list

Python.NET question?

2017-03-21 Thread Tristan B. Kildaire
Is Python.NET a version of Python that compiles Python source code to Microsoft's IR for running by a MS runtime? -- https://mail.python.org/mailman/listinfo/python-list

Guido? Where are you?

2016-11-20 Thread Tristan B. Kildaire
Is Guido active on this newsgroup. Sorry for the off-topic ness. -- https://mail.python.org/mailman/listinfo/python-list

Re: help on "from deen import *" vs. "import deen"

2016-11-20 Thread Tristan B. Kildaire
On Tue, 15 Nov 2016 22:16:07 +, Erik wrote: > On 15/11/16 14:43, Michael Torrie wrote: >> As you've been told several times, if you "import deen" then you can >> place a new object into the deen namespace using something like: >> >> deen.foo=bar >> >> Importing everything from an imported modu

[no subject]

2016-04-17 Thread B N
Foor ages, I have been trying to summon up courage learn how to program. I chose o start with Python. I found that when the “black” screen comes on, I am unable to read/see any characters even if I turn up the brightness of the screen. So, I give up. I tried version 3.5.1. I shall be grateful fo

Best Practices for Internal Package Structure

2016-04-04 Thread Josh B.
My package, available at https://github.com/jab/bidict, is currently laid out like this: bidict/ ├── __init__.py ├── _bidict.py ├── _common.py ├── _frozen.py ├── _loose.py ├── _named.py ├── _ordered.py ├── compat.py ├── util.py I'd like to get some more feedback on a question about this layout

OBIEE Developer and Administrator @ Seattle WA

2015-08-13 Thread Amrish B
Hello Folks, Please go through below job description and send me updated resume to amr...@uniteditinc.com Job Title: OBIEE Developer and Administrator Location: Seattle WA Duration: 12+months Experience: 10+ years only Job Description: * maintain the Oracle Business Intelligence Enterp

Re: Not Able to Log in on XNAT server through PyXNAT

2014-12-05 Thread suyash . d . b
On Friday, December 5, 2014 2:41:54 AM UTC-5, dieter wrote: > suyash@gmail.com writes: > > > Hello All, > > > > I have installed pyxnat on my mac. With pyxnat i am trying to access XNAT > > server in our university. As mentioned on the tutorial i tried both ways, > > neither is working. Foll

Not Able to Log in on XNAT server through PyXNAT

2014-12-04 Thread suyash . d . b
Hello All, I have installed pyxnat on my mac. With pyxnat i am trying to access XNAT server in our university. As mentioned on the tutorial i tried both ways, neither is working. Following error is displayed: >>> central=Interface(server='http://hd-hni-xnat.cac.cornell.edu:8443/xnat') User: sdb

Re: try/except/finally

2014-06-06 Thread Frank B
Ok; thanks for the underscore and clarification. Just need to adjust my thinking a bit. -- https://mail.python.org/mailman/listinfo/python-list

try/except/finally

2014-06-06 Thread Frank B
Ok; this is a bit esoteric. So finally is executed regardless of whether an exception occurs, so states the docs. But, I thought, if I from my function first, that should take precedence. au contraire Turns out that if you do this: try: failingthing() except FailException: return 0 fina

Re: Bug asking for input number

2013-11-15 Thread Arturo B
MRAB your solution is good thank you I will use it. Terry Eddy I saw my mistake about for example 2 <= 2, I think it's easier to use break in this case thank you! -- https://mail.python.org/mailman/listinfo/python-list

Bug asking for input number

2013-11-15 Thread Arturo B
Hi! I hope you can help me. I'm writting a simple piece of code. I need to keep asking for a number until it has all this specifications: - It is a number - It's lenght is 3 - The hundred's digit differs from the one's digit by at least two My problem is that I enter a valid number like: 123, 32

Understanding how is a function evaluated using recursion

2013-09-25 Thread Arturo B
Hi, I'm doing Python exercises and I need to write a function to flat nested lists as this one: [[1,2,3],4,5,[6,[7,8]]] To the result: [1,2,3,4,5,6,7,8] So I searched for example code and I found this one that uses recursion (that I don't understand): def flatten(l): ret = [] for i

How is this list comprehension evaluated?

2013-09-16 Thread Arturo B
Hello, I'm making Python mini-projects and now I'm making a Latin Square (Latin Square: http://en.wikipedia.org/wiki/Latin_square) So, I started watching example code and I found this question on Stackoverflow: http://stackoverflow.com/questions/5313900/generating-cyclic-permutations-reduced-la

Best python web framework to build university/academic website

2013-07-26 Thread b . krishna2020
Hi, I got a chance to build an university website, within very short period of time. I know web2py, little bit of Django, so please suggest me the best to build rapidly. Thanks in advance Raghu -- http://mail.python.org/mailman/listinfo/python-list

How is this evaluated

2013-07-04 Thread Arturo B
I'm making this exercise: (Python 3.3) Write a function translate() that will translate a text into "rövarspråket" (Swedish for "robber's language"). That is, double every consonant and place an occurrence of "o" in between. For example, translate("this is fun") should return the string "tothoh

Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Fixed, the problem was in HANGMANPICS I didn't open the brackets. Thank you guys :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Sorry, I'm new in here So, if you want to see the complete code I've fixed it: http://www.smipple.net/snippet/a7xrturo/Hangman%21%20%3A%29 And here is the part of code that doesn't work: #The error is marked in the whitespace between letter and in def displayBoard(HANGMANPICS, missedLetters,

Re: Problem with the "for" loop syntax

2013-06-19 Thread Arturo B
Mmmm Ok guys, thank you I'm really sure that isn't a weird character, it is a space. My Python version is 3.3.2, I've runed this code in Python 2.7.5, but it stills the same. I've done what you said but it doesn't work. Please Check it again here is better explained: http://snipplr.com/v

Convert Latitude, Longitude To TimeZone

2013-03-31 Thread Steve B
Hi All I'm new to python (4 days J) and was wondering if anyone out there can help me I am trying to get the time zones for latitude and longitude coordinates but am having a few problems The mistakes are probably very basic I have a table in a database with around 600 rows. Each row

stuck in files!!

2012-07-06 Thread Chirag B
i want to kno how to link two applications using python for eg:notepad txt file and some docx file. like i wat to kno how to take path of those to files and run them simultaneously.like if i type something in notepad it has to come in wordpad whenever i run that code. -- http://mail.python.org/mai

Re: ctypes callback with char array

2012-06-02 Thread Diez B. Roggisch
ohlfsen writes: > Hello. > > Hoping that someone can shed some light on a tiny challenge of mine. > > Through ctypes I'm calling a c DLL which requires me to implement a callback > in Python/ctypes. > > The signature of the callback is something like > > void foo(int NoOfElements, char Elements[

Re: Python 2.7.3, C++ embed memory leak?

2012-06-02 Thread Diez B. Roggisch
Qi writes: > Hi guys, > > Is there any known memory leak problems, when embed Python 2.7.3 > in C++? > I Googled but only found some old posts. > > I tried to only call Py_Initialize() and Py_Finalize(), nothing else > between those functions, Valgrind still reports memory leaks > on Ubuntu? > >

Re: configobj validation

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > On 03/19/2012 12:59 PM, Andrea Crotti wrote: >> I seemed to remember that type validation and type conversion worked >> out of the box, but now >> I can't get it working anymore. >> >> Shouldn't this simple example actually fail the parsing (instead it >> parses perfectly

Re: pypi and dependencies

2012-03-21 Thread Diez B. Roggisch
Andrea Crotti writes: > When I publish something on Pypi, is there a way to make it fetch the > list of dependencies needed by my project automatically? > > It would be nice to have it in the Pypi page, without having to look > at the actual code.. > Any other possible solution? I don't understa

Re: "Decoding unicode is not supported" in unusual situation

2012-03-07 Thread Diez B. Roggisch
John Nagle writes: > I think that somewhere in "suds", they subclass the "unicode" type. > That's almost too cute. > > The proper test is > > isinstance(s,unicode) Woot, you finally discovered polymorphism - congratulations! Diez -- http://mail.python.org/mailman/listinfo/python-list

online data entry jobs

2011-12-15 Thread vengal b
online data entry jobs http://venuonlinejobs.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-23 Thread Amirouche B.
On Aug 22, 5:41 pm, Stephen Hansen wrote: > > 3) object's type is type : object.__class__ is type > > 4) type parent object is object : type.__bases__ == (object,) > > Saying "type" and "parent" and the like for new-style classes is > something of a misnomer. For "type" and "object", these things

Re: questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-23 Thread Amirouche B.
On Aug 22, 1:57 pm, Steven D'Aprano wrote: > The relationship between type and object is somewhat special, and needs to > be bootstrapped by the CPython virtual machine. Since you are talking about CPython, I'm wondering how it is bootstraped since you can easly reference PyType in PyObject tha

questions (& answers) about object, type, builtin types, class, metaclass and __getattribute__

2011-08-22 Thread Amirouche B.
ct.__class__ is type 4) type parent object is object : type.__bases__ == (object,) B) type vs metaclass 1) type is the first metaclass ? 2) type is its own metaclass : type(type) is type ? 3) object's metaclass is type ? 4) other metaclasses *MUST* inherit type ? 5) type(any

Can you recommend an Experienced Python/SQL contract developer for this 6 - 12 month contract in NYC?

2011-02-25 Thread Ben B. Diamond
Experienced Python/SQL contract developer * 3+ years experience writing clean, concise Python * 3+ years experience tracing, debugging, and maintaining existing code * Experience working closely with a team in a fluid environment with evolving requirements * Strong CS fundamentals (algorithms & da

Re: A http server

2011-01-28 Thread Diez B. Roggisch
Back9 writes: > Hi, > I'm trying to set up a http server to handle a single POST request. > That POST request is to upload a huge file and the server is supposed > to handle it with the just POST request. > With my python sample code, multiple post requests are working well, > but that is not my

Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz writes: > On 3 Gen, 22:17, Adam Skutt wrote: >> On Jan 3, 4:06 pm, Jean-Paul Calderone >> wrote: >> >> >> >> > > Multiple processes, ok, but then regarding processes' interruption >> > > there will be the same problems pointed out by using threads? >> >> > No.  Processes can be terminate

Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
Gerry Reno writes: > On 01/03/2011 03:13 PM, Diez B. Roggisch wrote: >> >> A fun hack. Have you bothered to compare it to the PyPy javascript >> backend - perfomance-wise, that is? >> >> Diez >> > > I don't think that exists anymore. Didn

Re: CPython on the Web

2011-01-03 Thread Diez B. Roggisch
azakai writes: > Hello, I hope this will be interesting to people here: CPython running > on the web, > > http://syntensity.com/static/python.html > > That isn't a new implementation of Python, but rather CPython 2.7.1, > compiled from C to JavaScript using Emscripten and LLVM. For more > details

Re: Interrput a thread

2011-01-03 Thread Diez B. Roggisch
gervaz writes: > On 31 Dic 2010, 23:25, Alice Bevan–McGregor > wrote: >> On 2010-12-31 10:28:26 -0800, John Nagle said: >> >> > Even worse, sending control-C to a multi-thread program >> > is unreliable in CPython.  See "http://blip.tv/file/2232410"; >> > for why.  It's painful. >> >> AFIK, that

Re: Is there anyway to run JavaScript in python?

2011-01-03 Thread Diez B. Roggisch
crow writes: > Hi, I'm writing a test tool to simulate Web browser. Is there anyway > to run JavaScript in python? Thanks in advance. Not really. Yes, you can invoke spidermonkey. But the crucial point about running JS is not executing JS, it's about having the *DOM* of the browser available. Wh

Re: position independent build of python

2010-12-03 Thread Diez B. Roggisch
erikj writes: > If my understanding is correct, the sys.prefix variable holds the root > directory python uses to find related files, and eg its site-packages. > > the value of sys.prefix is specified at compile time. > > it seems that on windows, when I build/install python at one location, > an

RE: Python's equivalent to Main calling program and subprograms

2010-12-01 Thread m b
> > > > if __name__ == "__main__": > > main() What does this mean? /Mikael -- http://mail.python.org/mailman/listinfo/python-list

Re: pyqt4: multi-threaded database access

2010-11-24 Thread Diez B. Roggisch
Adrian Casey writes: > I have a PyQt4 multi-threaded application which accesses many hosts > concurrently via ssh. I would like each thread to have access to a > database so that it can look up details about the particular system it > is connected to. > > The easy way is to have each thread crea

RE: try to use unicode

2010-11-20 Thread Mikael B
Meddelandetext 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 t

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 p

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

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 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: QT window closes immediately

2010-11-16 Thread Diez B. Roggisch
Martin Caum writes: > I am attempting to open a window on mouse activity which works, but > the window fails to stay open. > I set it to terminate when the escape key is pressed even when the > program is not currently selected. This works fine. Originally I had > it create the window only with a

RE: Leo 4.8 rc1 released

2010-11-15 Thread Mikael B
> From: edream...@gmail.com > Subject: Leo 4.8 rc1 released > Date: Mon, 15 Nov 2010 09:06:01 -0800 > To: python-list@python.org > > Leo 4.8 release candidate 1 is now available at: > http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 > > Leo is a text editor, data org

Re: Getting references to objects without incrementing reference counters

2010-11-15 Thread Diez B. Roggisch
Artur Siekielski writes: > On Nov 15, 1:03 am, de...@web.de (Diez B. Roggisch) wrote: >> You don't say what data you share, and if all of it is needed for each >> child. So it's hard to suggest optimizations. > > Here is an example of such a problem I'm de

Re: Getting references to objects without incrementing reference counters

2010-11-14 Thread Diez B. Roggisch
Artur Siekielski writes: > Hi. > I'm using CPython 2.7 and Linux. In order to make parallel > computations on a large list of objects I want to use multiple > processes (by using multiprocessing module). In the first step I fill > the list with objects and then I fork() my worker processes that d

Re: Why datetime module is so complicated?

2010-11-14 Thread Diez B. Roggisch
Zeynel writes: > It's about a week now I've been trying to convert a datetime object to > seconds since epoch; the object is set to current time by class Rep() > in Google App Engine: > > class Rep(db.Model): > ... > mCOUNT = db.IntegerProperty() > mDATE0 = db.DateTimeProperty(auto_no

Re: scipy code runs in empty directory, not another

2010-11-13 Thread Diez B. Roggisch
Beliavsky writes: > After installing numpy, scipy, and matplotlib for python 2.6 and > running the code from http://www.scipy.org/Cookbook/OptimizationDemo1 > (stored as xoptimize.py) in a directory with other python codes, I got > the error messages > > C:\python\code\mycode>python xoptimize.py

Re: strange behavor....

2010-11-13 Thread Diez B. Roggisch
alex23 writes: > Tracubik wrote: >> why the integer value doesn't change while the list value do? > > http://effbot.org/pyfaq/why-are-default-values-shared-between-objects.htm Not the issue here. The reason the OP sees a difference that there is only one way to pass parameters in python. Ther

Re: How find all childrens values of a nested dictionary, fast!

2010-11-04 Thread Diez B. Roggisch
macm writes: > Hi Folks > > How find all childrens values of a nested dictionary, fast! There is no faster than O(n) here. > >>>> a = {'a' : {'b' :{'/' :[1,2,3,4], 'ba' :{'/' :[41,42,44]} ,'bc

Re: Python documentation too difficult for beginners

2010-11-03 Thread Hallvard B Furuseth
Steven D'Aprano writes: > On Tue, 02 Nov 2010 03:42:22 -0700, jk wrote: >> The former is difficult to find (try searching for 'open' in the search >> box and see what you get). > > A fair point -- the built-in open comes up as hit #30, whereas searching > for open in the PHP page brings up fopen a

Re: no line breaks in xml file with elementTree

2010-10-31 Thread Diez B. Roggisch
hackingKK writes: > On Sunday 31 October 2010 01:58 PM, Lawrence D'Oliveiro wrote: >> In message, hackingKK >> wrote: >> >> >>> I want to know if there is a way to have the ElementTree module write to >>> an xml file with line breaks? >>> >> Why does it matter? The XML files you generat

Re: xml : remove a node with dom

2010-10-28 Thread Diez B. Roggisch
alain walter writes: > Hello, > I have many difficulties to manipulate xml routines. I'm working with > python 2.4.4 and I cannot change to a more recent one, then I use dom > package, why not. > In the following code, I'm trying unsuccessfully to remove a > particular node. It seems to me that i

RE: is list comprehension necessary?

2010-10-26 Thread Mikael B
> > That's from the functional programming crowd. > > Python isn't a functional language. A noob question: what is a functional language? What does it meen? -- http://mail.python.org/mailman/listinfo/python-list

Re: downcasting problem

2010-10-25 Thread Diez B. Roggisch
Nikola Skoric writes: > Hi everybody, > > I need to downcast an object, and I've read repeatedly that if you > need to downcast, you did something wrong in the design phase. So, > instead of asking how do you downcast in python, let me explain my > situation. > > I have a 2-pass parser. 1st pass

Re: Getting returncode of a command executed with Popen through xterm

2010-10-19 Thread Diez B. Roggisch
amfr...@web.de writes: > Hi, > > i have a program that have to execute linux commands. I do it like this: > > retcode = Popen(["xterm", "-e", command],stdin=PIPE, stdout=PIPE, > stderr=PIPE) > > I have to use xterm because some commands need further input from the > user after they are executed. >

Re: error in loading data into the code

2010-10-18 Thread Diez B. Roggisch
nakisa writes: > hello , I have started python last week,so maybe my question is a bit > stupid. > I got this error in my simple python code while trying to load data > into the code. I have added this libaraies > from pylab import * > from scipy import * > import matplotlib.mlab as mlab > from n

Re: python/c api

2010-10-16 Thread Diez B. Roggisch
alex23 writes: > On Oct 15, 5:53 am, de...@web.de (Diez B. Roggisch) wrote: >> For example Ableton Live, an audio sequencer. > > I _have_ Live and I didn't realise this :O Thanks! Well, it's not a feature for end-users, it's used internally for some midi controll

PEP 380 - the 'yield from' proposal

2010-10-15 Thread Hallvard B Furuseth
Regarding http://www.python.org/dev/peps/pep-0380/, "Syntax for Delegating to a Subgenerator": The first call can only be .next(), there's no way to provide an initial value to .send(). That matches common use, but an initial .send() is possible if .next() was called before "yield from". So I su

Re: My first Python program

2010-10-14 Thread Hallvard B Furuseth
Seebs writes: >> For long strings, another option is triple-quoting as you've seen in doc >> strings: print """foo >> bar""". > > I assume that this inserts a newline, though, and in this case I don't > want that. True. $ python >>> """foo ... bar""" 'foo\nbar' >>> """foo\

Re: GCC process not working as expected when called in Python (3.1.2) subprocess-shell, but OK otherwise

2010-10-14 Thread Diez B. Roggisch
Kingsley Turner writes: > Hi, > > I'm using GCC as a pre-processor for a C-like language (EDDL) to > handle all the includes, macros, etc. producing a single source file > for another compiler. My python code massages the inputs (which > arrive in a .zip file), then calls GCC. > > I have a prob

Re: python/c api

2010-10-14 Thread Diez B. Roggisch
Tony writes: > hi, > > is the python/c api extensively used? and what world-famous software > use it? thanks! It is, for a lot of extensions for python, and a lot of embedding python into a software. For example Ableton Live, an audio sequencer. Arc GIS has it, and the Eve Online. Many more do,

Re: My first Python program

2010-10-14 Thread Hallvard B Furuseth
Seebs writes: >> You can't really rely on the destructor __del__ being called. > > Interesting. Do I just rely on files getting closed? Sometimes, but that's not it. Think Lisp, not C++. __del__ is not that useful. Python is garbage-collected and variables have dynamic lifetime, so the class c

Re: send command to parent shell

2010-10-14 Thread Diez B. Roggisch
Martin Landa writes: > Hi, > > is there a way how to send command from python script to the shell > (known id) from which the python script has been called? More > precisely, the goal is to exit running bash (on Linux) or cmd (on > Windows) directly from wxPython application, currently user needs

Re: how to add patch

2010-10-13 Thread Diez B. Roggisch
jimgardener writes: > hi > I have some demo python code hosted on a public host that uses > subversion..and I want to modify one of the files using a patch file > handed to me by another person..How do I do this?Generally I checkout > the code and make the change and then commit again..I have ne

Re: Difficulty in easy_install

2010-10-13 Thread Diez B. Roggisch
John Nagle writes: > On 10/11/2010 1:45 AM, sankalp srivastava wrote: >> >> I am having difficulty in easy_installing >> I use a proxy server and strange errors , like it can't fetch the >> package is showing up . >> the package is pyspeech ...please help me :( >> >> I don't know if the proxy s

Re: My first Python program

2010-10-13 Thread Hallvard B Furuseth
Ethan Furman writes: >Seebs wrote: >>On 2010-10-12, Hallvard B Furuseth wrote: >>>> self.type, self.name = None, None >> >>> Actually you can write self.type = self.name = None, >>> though assignment statements are more limited than in C. &g

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Diez B. Roggisch
Gregory Ewing writes: > Philip Semanchuk wrote: > >> Hi Greg, >> Are you talking about compiling Python itself or extensions? > > I've managed to get Python itself compiled as 32 bit, > and that also seems to take care of extensions built > using 'python setup.py ...'. > > I'm mainly concerned ab

Re: My first Python program

2010-10-12 Thread Hallvard B Furuseth
I wrote: > except IOError: > if e.errno != errno.ENOENT: raise# if you are picky Argh, I meant "except IOError, e:". That's for Python 2 but not Python 3. "except IOError as e:" works on Python 2.6 and above. -- Hallvard -- http://mail.python.org/mailman/listinfo/python-list

Re: My first Python program

2010-10-12 Thread Hallvard B Furuseth
Seebs writes: > http://github.com/wrpseudo/pseudo/blob/master/makewrappers >self.f = file(path, 'r') >if not self.f: >return None No. Failures tend to raise exceptions, not return error codes. Except in os.path.exists() & co. $ python >>> open("nonesuch") Tracebac

Re: [Python-ideas] [Python-Dev] Inclusive Range

2010-10-12 Thread Hallvard B Furuseth
Steven D'Aprano writes: > On Fri, 08 Oct 2010 22:10:35 +0200, Hallvard B Furuseth wrote: >> Jed Smith writes: >>>>>> a = [1, 2, 3, 4, 5, 6] >>>>>> a[::-1] >>> [6, 5, 4, 3, 2, 1] >> >> Nice. Is there a trick to get a &q

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Stefan Behnel writes: >Hallvard B Furuseth, 11.10.2010 21:50: >> Fine, so programs will have to do it themselves... > > Yes, they can finally handle bytes and Unicode data correctly and > safely. Having byte data turn into Unicode strings unexpectedly makes > the behaviou

Re: harmful str(bytes)

2010-10-11 Thread Hallvard B Furuseth
Terry Reedy writes: >On 10/8/2010 9:45 AM, Hallvard B Furuseth wrote: >>> Actually, the implicit contract of __str__ is that it never fails, so >>> that everything can be printed out (for debugging purposes, etc.). >> >> Nope: >> >> $ python2 -c 's

  1   2   3   4   5   6   7   8   9   10   >