Yet another "split string by spaces preserving single quotes" problem

2012-05-14 Thread Massi
Hi everyone, I know this question has been asked thousands of times, but in my case I have an additional requirement to be satisfied. I need to handle substrings in the form 'string with spaces':'another string with spaces' as a single token; I mean, if I have this string: s ="This is a 'simple te

PyDev and multithreaded application debug

2011-12-12 Thread Massi
Hi everyone, I've just started to use pydev to develop my python application and I'm encountering some problems to debug it. The application I'm dealing with is a multithreaded application; when I try to debug it with pydev, it seems not to be able to handle the execution of multiple threads. The p

Re: Dynamic variable creation from string

2011-12-09 Thread Massi
Thank you all for your replies, first of all my Sum function was an example simplifying what I have to do in my real funciton. In general the D dictionary is complex, with a lot of keys, so I was searching for a quick method to access all the variables in it without doing the explicit creation: a,

Dynamic variable creation from string

2011-12-07 Thread Massi
Hi everyone, in my script I have a dictionary whose items are couples in the form (string, integer values), say D = {'a':1, 'b':2, 'c':3} This dictionary is passed to a function as a parameter, e.g. : def Sum(D) : return D['a']+D['b']+D['c'] Is there a way to create three variables dynamic

Automatic import of submodules

2011-11-25 Thread Massi
Hi everyone, in my project I have the following directory structure: plugins | -- wav_plug | -- __init__.py -- WavPlug.py -- mp3_plug | -- __init__.py -- Mp3Plug.py ... -- etc_plug | -- __init__.py

String splitting by spaces question

2011-11-23 Thread Massi
Hi everyone, I have to parse a string and splitting it by spaces. The problem is that the string can include substrings comprises by quotations which must mantain the spaces. What I need is to pass from a string like: This is an 'example string' to the following vector: ["This", "is", "an", "ex

Multiple windows services on the same machine

2011-06-05 Thread Massi
Hi everyone, I'm writing a script which implement a windows service with the win32serviceutil module. The service works perfectly, but now I would need to install several instances of the same service on my machine for testing purpose. This is hard since the service name is hard-coded in the servic

py2exe: executable is slower than code run from the interpreter

2011-06-04 Thread Massi
Hi everyone, I'm writing a big program (windows 7, python 2.6.6) which includes lots of python libraries (SQLalchemy, PyQt, SocketServer, Matplotlib,...). Now I'm trying to build a stand alone executable with py2exe (0.6.9) and everything works great. The only issue is that the executable seems to

Py2exe problem with pyqt+matplotlib

2011-03-15 Thread Massi
I everyone, I'm trying to write a setup file for py2exe (0.6.9) to convert my script into a windows (on win 7) executable. In my script (python2.6) I use PyQt and matplotlib. Here is the setup.py file: from distutils.core import setup import py2exe import matplotlib as mpl import glob, shutil mp

Re: SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
On 28 Feb, 13:34, cmcp wrote: > In method StopServer() of class MyServer try calling  self.server_close() > after the self.shutdown() call.  I believe this will actually close the > server's socket and allow its reuse. It works! Thank you!! -- http://mail.python.org/mailman/listinfo/python-lis

SocketServer problem: client hangs trying to reconnect after server restart

2011-02-28 Thread Massi
Hi everyone! in my script (Python 2.6 on windows 7) I have to set up a SocketServer server and use it to handle external connections. During the execution It can happen that this server should be closed and restarted (for example with different port or host). The following piece of code simulates

SQLalchemy+py2exe+pymssql error

2010-07-21 Thread Massi
Hi everyone, I'm trying to build an executable with py2exe. My script uses SQLalchemy and pymssql with python 2.6. Here is my setup file: from distutils.core import setup import py2exe manifest = """ myProgram """ setup(name="MyProg", windows=

SqlAlchemy: remote connection on problem on mysql database

2010-07-09 Thread Massi
Hi everyone, in my script I'm trying to connect to a remote database using sqlalchemy. Since I'm pretty new to this library I'm not really sure of what I am doing :-). Up to now what I'm doing to connect to the database is this: engine = create_engine("mysql:// my_username:my_passw...@phpmyadmin.

ctypes:Multiple library access problem

2010-05-06 Thread Massi
Hi everyone, in my script I need to execute multiple separated loading of the same dll library, in order to handle the internal variables with different threads. Consider the followin piece of code: lib1 = cdll.LoadLibrary("MyLib.dll")) lib2 = cdll.LoadLibrary("MyLib.dll")) lib1.var1 = 0 lib2.va

Create a new process to run python function

2010-05-05 Thread Massi
Hi everyone, in my script (python 2.5 on windows xp) I need to run a simple function in a separate process. In other words I need something similar to the fork function under UNIX. I tried with threads: import os, threading def func(s) : print "I'm thread number "+s, os.getpid() threading.T

Python and flash charts

2009-09-15 Thread Massi
Hi everyone, I'm trying to incorporate in my script flash charts like those of yahoo finance (for example this: http://it.finance.yahoo.com/echarts?s=^DJI#symbol=^DJI;range=1d), possibly using wxpython. Does anybody have any idea on how to do that? Thanks in advance. -- http://mail.python.org/mail

Urllib and login

2009-09-10 Thread Massi
Hi everyone, I'm trying to get data from an internet page which is accessed from a login page. Looking at the html source code of the login page I found that the name of the controls which handle username and password are "login_un" and "login_pw". So I tried to write a piece of code to access the

Web page data and urllib2.urlopen

2009-08-05 Thread Massi
Hi everyone, I'm using the urllib2 library to get the html source code of web pages. In general it works great, but I'm having to do with a financial web site which does not provide the souce code I expect. As a matter of fact if you try: import urllib2 res = urllib2.urlopen("http://www.marketwatc

Bug in IEHtmlWindow?

2009-07-30 Thread Massi
Hi everyone, I'm trying to use IEHtmlWindow in my application (python 2.5, wxpython 2.8 on win xp). Everything is ok, but I encountered a problem which also affects the demo. If I make a research on google a strange message appears, saying (I'll try to translate from italian): Error during executi

Ctypes debug of dll function

2009-02-21 Thread Massi
Hi everyone, I'm pretty new to the ctypes module and I'm encountering a problem. I'm working under windows xp with python 2.5 and in my script I use ctypes to call from a dll some functions I wrote in C. When I call one of these functions it happens that my script crashes raising the following erro

Matplotlib on Leopard Mac OS

2008-11-26 Thread Massi
Hi everyone, I've got some problems trying to install matplotlib on my mac (Leopard OS). I'm following the instructions I found in the official site to install it from the egg file (http:// matplotlib.sourceforge.net/users/installing.html), but when I run easy_install ./matplotlib-0.98.3-py2.5-maco

Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Massi
Hi everyone, I'm trying to install Python2.6 on my mac (Leopard 10.5.5), but I'm encountering some problems. To install the package I followed the instructions I found at this link: http://wiki.python.org/moin/MacPython/Leopard If I open wing, it turns out that the installed version is actually 2.6

Re: Midi manipulation

2008-11-17 Thread Massi
On 16 Nov, 23:23, Tim Roberts <[EMAIL PROTECTED]> wrote: > Massi <[EMAIL PROTECTED]> wrote: > > >Hi everyone, I'm searching for "something" which allows me to write > >scripts which handle midi files. I'm totally a newbie in audio > >manipu

Midi manipulation

2008-11-16 Thread Massi
Hi everyone, I'm searching for "something" which allows me to write scripts which handle midi files. I'm totally a newbie in audio manipulation, therefore any suggestion or link related to this field is welcome. Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wx.Grid and popup over cells

2008-10-14 Thread Massi
On 14 Ott, 16:13, Mike Driscoll <[EMAIL PROTECTED]> wrote: > On Oct 14, 5:21 am, Massi <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I'm writing a python script which uses a grid (PyGridTableBase) whose > > cells can contain very large values (n

Wx.Grid and popup over cells

2008-10-14 Thread Massi
lacing the last ones with dots. Now I would like to know if it is possible to have a popup which shows the whole contents of a certain cell when the mouse stops over the cell itself. Any ideas? Thanks in advance. Massi -- http://mail.python.org/mailman/listinfo/python-list

wxpython-wx.CheckListBox: changing item bacgkground color

2008-01-13 Thread Massi
Hi everyone! In my application (under windows) I'm using a wx.checklistbox. I would like the background color of an item to become red whenever an EVT_LISTBOX_DCLICK occurs. Is there any simple way to achieve it? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Getting stdout from ctypes module

2007-03-02 Thread Massi
Hi everyone, I have a program which is written in C and interfaced with python via Ctypes. The functions I call print stuff out to the console, using the usual function printf. I would like to know if it is possible to redirect the output of my C module to python. I'm working on windows environmen

wxGrid: Problem with unicode mathematical symbols

2006-12-20 Thread Massi
fine. I can't understand why I am wrong. I also tried to change the font of the cells in "Arial Unicode MS", but the result was the same. Have you got any idea about?. Thanks in advance, Massi -- http://mail.python.org/mailman/listinfo/python-list

Cactching Stdout

2006-11-08 Thread Massi
about PIPE and popen...is this what I need? How can I use them? It is very important for me that I could take the output in real-time. Thanks for the help! Massi -- http://mail.python.org/mailman/listinfo/python-list

Code generator

2006-10-12 Thread Massi
repository? Thank you for the help! Massi -- http://mail.python.org/mailman/listinfo/python-list

Enum

2006-10-12 Thread Massi
Hi Everyone! Does anybody know how to implemet Enumeration in python for Ctypes? Thank you! Massi -- http://mail.python.org/mailman/listinfo/python-list