Re: How to create python web framework for ERP

2014-09-09 Thread Matteo Boscolo
Use the only odoo framework.. without addons .. will be the best choice .. do not reinvent the whell if you do not need web interface, you can have a look at http://www.tryton.org/ otherwise you could have flask for the top of flexibility regards, Matteo Il 09/09/2014 12:06, Vimal Rughani

Re: help to code...

2013-05-02 Thread Matteo Boscolo
The error is self expleined .. print str(current_month) + '/' + str(current_day) + '/' + str(current_year) +' *'+ * this line have a + at the end,the interpreter need something to add .. so remove it and it will work regards, Matteo Il 02/05/2013 15:50, le

Re: 2-D drawing/map with python

2013-03-14 Thread Matteo Boscolo
integrated with sympy .. regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: Import Question

2013-02-20 Thread Matteo Boscolo
.. if inside your module there is some code (no def or class) this code will be executed, and if for example you have some loop or some db query this will be executed too. regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: gc.get_objects()

2012-09-17 Thread Matteo Boscolo
gt;>>>>> RefCount 15 >>>> 'python_version': 34014192, 'defaultUnnamedArg': RefCount 6 >>>> win32com.gen_py.F4503A16-F637-11D2-BD55-00500400405Bx0x1x0.ITDProperty.I RefCount 4 >>>> (u'ItemsListCreator', u'tri

gc.get_objects()

2012-09-17 Thread Matteo Boscolo
but I do know how.. the .__del__() method dose not work on this object... there is someone that can give me some help on this ? Regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Initial pointers for web based LAMP installation

2012-09-08 Thread Matteo Grämlin
. I can do it except for the interface with a shell script. Because of the web interface I was told that python is the right language but I have no knowledge in python. Could you pl. give me the initial pointers for this scheme? Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: a problem about "print"

2012-07-04 Thread Matteo Boscolo
in the code2 aList=[1,2,3,4,5,6,7,8,9,10] aList=str(aList) #<--- here you convert the list in a string print aList print aList[2] #<-- here you are printing the third caracter of the string '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]' not the list '[1, 2, 3, 4, 5, 6, 7, 8, 9,

Re: Tkinter deadlock on graceful exit

2012-06-03 Thread Matteo Landi
On Jun/02, Dennis Lee Bieber wrote: > On Sat, 2 Jun 2012 14:57:17 +0200, Matteo Landi > declaimed the following in gmane.comp.python.general: > > > > Lesson learned: never invoke Tkinter functions / methods outside the > > mainloop > > thread.. NEVER! > &g

Re: Tkinter deadlock on graceful exit

2012-06-02 Thread Matteo Landi
On Jun/01, Matteo Landi wrote: > On Thu, May 31, 2012 at 3:02 PM, Matteo Landi wrote: > > On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote: > >> On 5/30/2012 6:19 PM, Matteo Landi wrote: > >>> > >>> On May/28, Matteo Landi wrote: > >>>>

Re: Tkinter deadlock on graceful exit

2012-06-01 Thread Matteo Landi
On Thu, May 31, 2012 at 3:02 PM, Matteo Landi wrote: > On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote: >> On 5/30/2012 6:19 PM, Matteo Landi wrote: >>> >>> On May/28, Matteo Landi wrote: >>>> >>>> Hi list, >>>> recently

Re: Tkinter deadlock on graceful exit

2012-05-31 Thread Matteo Landi
On Thu, May 31, 2012 at 3:42 AM, Terry Reedy wrote: > On 5/30/2012 6:19 PM, Matteo Landi wrote: >> >> On May/28, Matteo Landi wrote: >>> >>> Hi list, >>> recently I started to work on an application [1] which makes use of the >>> Tkinter >>

Re: Tkinter deadlock on graceful exit

2012-05-30 Thread Matteo Landi
On May/28, Matteo Landi wrote: > Hi list, > recently I started to work on an application [1] which makes use of the > Tkinter > module to handle interaction with the user. Simply put, the app is a text > widget displaying a file filtered by given criteria, with a handy feature th

Tkinter deadlock on graceful exit

2012-05-27 Thread Matteo Landi
awner and the file processor are terminated correctly. The only thread still active for some strange reasons, is the gui updater. Do you see anything wrong with the description presented above? Please say so, because I can't figure it out! Regards, Matteo [1] https://bitbucket.org/iamF

Re: while True or while 1

2012-01-21 Thread Matteo Landi
Probably because of the fact it is possible to set True equal to False and consequently then invalidate loop logic as presented below: True = False while True: ... On the other hand `1' will always be evaluated as a constant. Don't know, just guessing. Matteo

Re: Insert trusted timestamp to PDF

2011-12-07 Thread Matteo Boscolo
ing-pdf-file-in-python&catid=38%3Aprogramming&Itemid=55&lang=en> here I number some pdf files .. regards, Matteo Il 07/12/2011 20:41, Hegedüs, Ervin ha scritto: Hello Everyone, I'm looking for a tool, which can add a trusted timestamp to an existing PDF file (and can sign - but

Losing com pointer

2011-12-07 Thread Matteo Boscolo
to debug it .. any help is really appreciated.. it's the last dangerous bug in our application ... Regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

osaic - create photo mosaics w/ Python

2011-06-20 Thread Matteo Landi
around the source code, unless you are really interested in it :P. Instead, I’m here looking for some feedback, suggestions or comments. I would really appreciate your advices. Thank you so much. Cheers, Matteo [1] http://bitbucket.org/iamFIREcracker/osaic [2] http://pypi.python.org/pypi/o

Re: Playing WAV file with Python

2011-03-03 Thread Matteo Landi
I imagine he is looking for a cross-platform solution: n this case, I guess the most suitable solution is pygame. Regards, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: An easier way to do this? (spoiler if you're using pyschools for fun)

2010-11-10 Thread Matteo Landi
I agree with Peter: * iterate over the list directly * use %10 instead of string conversion + slice (*) use genexps Good luck, Matteo On Tue, Nov 9, 2010 at 8:18 PM, Terry Reedy wrote: > On 11/9/2010 2:00 PM, Matty Sarro wrote: > >> I'm working on one of the puzzles on pysch

Re: Dictionary of lists strange behaviour

2010-11-09 Thread Matteo Landi
]) The argument you pass which is used to fill the values of the new dict, is created once; this means that the empty list is shared between all the keys of the dict. I think you need to create the new dict by hand. Regards, Matteo > In [215]: rg > Out[215]: {'a': [], 'b&#

Re: pylint -- should I just ignore it sometimes?

2010-10-20 Thread Matteo Landi
Another situation in which I needed to disable such kind of warnings is while working with graphics modules. I often use variable names such as x, y, z for coordinates, or r,g,b for colors. Would longer names make the reader's life easier? Best regards, Matteo On Wed, Oct 20, 2010 at 9:

Re: How to implement retrying a lock tidily in Python?

2010-10-17 Thread Matteo Landi
You can use the 'else' keyword outside the for loop: for : if : break else The execution will step inside the else branch if the for loop ends normally, i.e. without encountering a break keyword. Hope it helps. Regards, Matteo On Sun, Oct 17, 2010 at 6:58 PM, wrote: >

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Matteo Landi
I got one a couple of months ago. I answered back I was interested and then we scheduled a phone conversation. Good luck, Matteo On Thu, Oct 14, 2010 at 5:58 PM, Grant Edwards wrote: > On 2010-10-14, Daniel Fetchinson wrote: > >> I keep getting recruiting emails from charlesngu..

Re: Control webbrowser from Python script

2010-10-09 Thread Matteo Landi
Well, if you need to issue http POST/GET commands, you can take a look at urllib/urllib2 modules. Instead if you want to take control of the web-browser I've heard about selenium, but I've never used it. Best regards, Matteo On Sat, Oct 9, 2010 at 11:39 AM, Johny wrote: > Is i

Re: How to convert a string into a list

2010-10-05 Thread Matteo Landi
What about using the json library? It could handle errors for you: >>>import json >>>s = '["1", "2"]' >>>json.loads(s) [u'1', u'2'] Now you can convert then to integer values. Best regards, Matteo On Tue, Oct 5, 2010

Re: That interesting notation used to describe how long a loop will take.

2010-10-04 Thread Matteo Landi
Here you are: http://en.wikipedia.org/wiki/Big_O_notation Best regards, Matteo On Mon, Oct 4, 2010 at 8:38 PM, Tobiah wrote: > It gets used here frequently, but not > having majored in programming, I'm not > familiar with it.  One might say: > > Don't do it that way,

Re: palindrome iteration

2010-08-29 Thread Matteo Landi
: while True: if str[i] != str[j]: return False i, j = i + 1, j - 1 return True except IndexError: return True On Sun, Aug 29, 2010 at 12:36 PM, Arnaud Delobelle wrote: > Matteo Landi writes: > >> W

Re: palindrome iteration

2010-08-29 Thread Matteo Landi
", min(t.repeat()) > > t = Timer("is_palindrome_reversed('madamimadam')", "from __main__ > import is_palindrome_reversed") > print "is_palindrome_reversed", min(t.repeat()) > > The results: > is_palindrome_recursive 6.32680866827 > is_pali

Re: Fibonacci: How to think recursively

2010-08-28 Thread Matteo Landi
I suggest you to memoize results in order to prevent overlapping recursion. Regards, Matteo On Sun, Aug 29, 2010 at 2:23 AM, Ben Finney wrote: > Baba writes: > >> my brainstorming so far brought me to a stand still as i can't seem to >> imagine a recursive way to code t

Re: palindrome iteration

2010-08-27 Thread Matteo Landi
except IndexError: return True Regards, Matteo > >> Here's a possible (and a >> bit tricky) Python 2.x implementation: >> >> def is_palindrom(s): >>    s = s.lower() >>    slen = len(s) >>    until = slen / 2 # Python 2x integer

Re: Python Developer - HFT Trading firm - Chicago, IL

2010-08-18 Thread Matteo Landi
try), fantastic benefits and very generous relocation packages. > Please contact me immediately with a resume! > > Send resumes to: > > Rich Moss > r...@mossltd.com > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint scores

2010-08-06 Thread Matteo Landi
On Sun, Aug 1, 2010 at 12:27 PM, News123 wrote: > Hi, > > > On 07/31/2010 11:04 AM, Matteo Landi wrote: >> What are the messages one should really care about while evaluating >> its code using pylint? It's easy to get 5 scored with a "lot of public >> me

Re: Python Script Cannot Write to Directory

2010-08-04 Thread Matteo Landi
CTORY/DSTNTN_FILE_NAME") > > WTF; modules aren't callable. Typo? I suppose he/she would have written: shutil.copyfile("YOUR_SOURCE_FILE_NAME","DESTINATION_DIRECTORY/DSTNTN_FILE_NAME") Cheers. > > Cheers, > Chris > -- > http://blog.rebertia.com

Re: Global variables problem

2010-08-04 Thread Matteo Landi
;> >>> Any help would be awesome : ) >>> >>> Regards, >>> Nav >>> >>> -- >>> http://mail.python.org/mailman/listinfo/python-list >> >> >> This is a working code, streamlined, but it is where the problem is: &

Re: Get name of file from directory into variable

2010-08-03 Thread Matteo Landi
ally, so is definitely the way to go. > > http://docs.python.org/library/glob.html > > -- > Rory Campbell-Lange > r...@campbell-lange.net > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Get name of file from directory into variable

2010-08-03 Thread Matteo Landi
g/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL

2010-08-03 Thread Matteo Landi
> Thank you in advance. > > Thanks. > Navid > > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Normalizing A Vector

2010-08-01 Thread Matteo Landi
will normalize > in more than one place. In fact, you may well want a vlen function. > > def vlen(seq): return math.sqrt(sum(x*x for x in seq)) > > -- > Terry Jan Reedy > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint scores

2010-07-31 Thread Matteo Landi
will need > to work on your code), but tabs allow everyone to see code indented the way > -they- want to see it, not just the way the original author wanted to see > it. > This script (./this-pylint) will also save output from the test in a text > file, for make (or other dependency handling program) to use to avoid > re-pylint'ing unmodified code.  It'll give an error typically, if pytlint > detects any errors other than FIXME's (excluding ones, as I mentioned > before, that have a comment disabling the warning, of course). > I'm more than a little sad that pylint doesn't seem to be moving to python 3 > in any big hurry. > > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: measuring a function time

2010-07-29 Thread Matteo Landi
t to do this (pseudocode): > start_time = get_current_time; > function(); > end_time = get_current_time; > print (end_time - start_time) > > the output should be 7600 (s) for example. What is the best and easiest way > to do that? > > Thanks, > > // Naderan *Mahmood; >

Re: how to delete "\n"

2010-07-12 Thread Matteo Landi
found there is still "\n" . Could someone help me why it is not > correct? > > Thank you > > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: super() woes (n00b)

2010-06-17 Thread Matteo Landi
doing wrong? > > I tried this, too: > >>>> class C(P): >    def __init__(self): >        super(__class__).__init__(self) >        print("I am a member of class C") > > >>>> x=C() > Traceback (most recent call last): >  File "", line 1, in >    x=C() >  File "", line 3, in __init__ >    super(__class__).__init__(self) > TypeError: must be type, not C >>>> > > > > -- > The missionaries go forth to Christianize the savages - > as if the savages weren't dangerous enough already. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 08:31 -0700, Stephen Hansen wrote: > On 6/17/10 6:23 AM, Matteo Landi wrote: > > itself. If you try and pickle a function, it is not pickled as a whole, > > indeed, once you unpickle it, it will raise an exception telling you > > that the target function

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote: > Matteo Landi writes: > > If you try and pickle a function, it is not pickled as a whole, > > indeed, once you unpickle it, it will raise an exception telling you > > that the target function was not found in the current m

Re: Serializing functions

2010-06-17 Thread Matteo Landi
On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote: > Matteo Landi writes: > > If you try and pickle a function, it is not pickled as a whole, > > indeed, once you unpickle it, it will raise an exception telling you > > that the target function was not found in the current m

Serializing functions

2010-06-17 Thread Matteo Landi
here, with nothing in my hands; how would you implement this? Thanks in advance. [1] http://www.picloud.com/ -- Matteo Landi http://www.matteolandi.net -- http://mail.python.org/mailman/listinfo/python-list

Re: List of lists surprising behaviour

2010-06-17 Thread Matteo Landi
7445996L) >>>> > > > So what is the right way to initialize to 0 a 2D array ? Is that way correct >  : > > >>>> t=[[0 for _ in range(2)] for _ in range(3)] > > It seems there is no more trouble now : > >>>> t > [[0, 0], [0, 0]

Re: Syntax question

2010-06-02 Thread Matteo Landi
gt; >>> b >> [5,2,3,4] >> >>> # here's the issue >> >>> a >> [5,2,3,4] >> >>> # and the resolution >> >>> c >> >> [1,2,3,4] >> >> Hope this helps. >> >> Geremy Condra > > Thank you for such fast answer! I quite catch, but: > As I see, the d[:] is equal to sentence "get the d array from the > first to the last element"? :) > > P. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax question

2010-06-02 Thread Matteo Landi
[1,2,3,4] >>>> b = a >>>> c = [:] >>>> b[0] = 5 >>>> b > [5,2,3,4] >>>> # here's the issue >>>> a > [5,2,3,4] >>>> # and the resolution >>>> c > [1,2,3,4] > > Hope this helps. > > Geremy Condra > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: function that counts...

2010-05-24 Thread Matteo Landi
t; have property x"). > > If speed is important, the global lookups can be localized: > > def prttn(m, n, map=itertools.imap, int=int, str=str, range=range): >return sum(m == sum(map(int, str(x))) for x in range(n)) > > Raymond > > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQL, Python, NumPy and formatted read

2010-05-23 Thread Matteo Landi
a single > tuple.  What I'd like is to somehow put the tuple into a NumPy array > with each value as one element.  Then I can continue to do some > numerical processing. > > Any advice/help? > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: stopping execution window on error - newbie

2010-05-13 Thread Matteo Landi
dow. > > when the code finishes, the window closes, i do a time.sleep(10) to > see what has happened. > > unfortunately when there is an error it just closes the window. > anyway of seeing the error messages? > > thanks > > a > -- > http://mail.python.org/ma

Re: plot debugging problem

2010-05-12 Thread Matteo Landi
interactively in Python, be sure >>> > to call the function show() after all >>> > graphs have been generated, as it enters a user interface main loop >>> > that will stop execution of the rest of >>> > your code. The reason behind this behavior is that matplotlib i

Re: plot debugging problem

2010-05-11 Thread Matteo Landi
o be embedded in a GUI as well. >> > In Windows, if you’re working from interactive Python, you need only >> > issue show() once; close the figures >> > (or figures) to return to the shell. Subsequent plots will be drawn >> > automatically without issuing show(), an

Re: plot debugging problem

2010-05-11 Thread Matteo Landi
> (or figures) to return to the shell. Subsequent plots will be drawn > automatically without issuing show(), and > you’ll be able to plot graphs interactively. > > Best Regards > Sandy > ____ > Hotmail: Free, trusted and rich email se

Re: Sqlite3. Substitution of names in query.

2009-10-30 Thread Matteo
On Oct 30, 7:27 am, "Diez B. Roggisch" wrote: [snip] > Or even better, by > not doing it at all - because usually, your datamodel is tied to your > program, so the need for this kind of dynamicity shouldn't arise in the > first place. > > Die Perhaps that is true in the majority of cases, but the

Re: Sqlite3. Substitution of names in query.

2009-10-30 Thread Matteo
On Oct 30, 7:10 am, Lacrima wrote: > Hello! > > I use sqlite3 module for my sqlite database. I am trying to substitute > table name in sql query. > > >>> import sqlite3 > >>> con = sqlite3.connect('mydb') > >>> cur = con.execute("select * from table where name='Joe'") > > That's ok > > >>> cur = c

Passing a sqlite connection into an extension module

2009-10-19 Thread Matteo
Hello- I'm trying to find out if there is a way to share a sqlite database connection between python and an extension module written in C or C+ +. My setup is that I have some pretty intensive OpenGL rendering code that gets its values from a largish sqlite database, performs a fair bit of computat

Re: logging sound / speech handler?

2009-09-10 Thread Matteo
On Sep 9, 6:02 pm, Tim Chase wrote: > > For an application in an industrial environment where the workers are > > not always sitting in front of the monitor, but are within earshot of > > the PC I would need an sound / speech handler for the standard logging > > system. It should beep or better sa

Re: Fill Javascript form

2009-05-12 Thread Matteo
On 11 Mag, 23:06, Shawn Milochik wrote: > How is the form "written in JavaScript"? Is it dynamically generated? > > In any case, can you just send a POST request if you know the values required? The problem is indeed that the form is dynamically generated. That's the .js file: if (navigator.appV

Fill Javascript form

2009-05-11 Thread Matteo
Hi everybody, I have to fill a web form to authenticate and connect to the internet. I thought it would have been easy to make a script to do that automatically on startup. Unfortunately, it turned out that the form is written in JavaScript, and urllib2 therefore fails to even fetch the form. The

Re: Play sound at wanted frequency

2009-04-18 Thread Matteo
On 15 Apr, 19:25, Scott David Daniels wrote: > Diez B. Roggisch wrote: > > Matteo schrieb: > >> I need to playback a sound on a linux machine of a pre-determined > >> frequency like, say, 440 Hz. How can I do that with python? I found > >> the ossau

Play sound at wanted frequency

2009-04-14 Thread Matteo
I need to playback a sound on a linux machine of a pre-determined frequency like, say, 440 Hz. How can I do that with python? I found the ossaudiodev package, but it says that the ossaudiodev.write() method accepts data as a raw string. It doesn't explain what the string should be like, and the oss

Reading 3 objects at a time from list

2009-04-11 Thread Matteo
Hi all, let's see if there is a more "pythonic" way of doing what I'm trying to do. I have a lot of strings with numbers like this one: string = "-1 1.3 100.136 1 2.6 100.726 1 3.9 101.464 -1 5.2 102.105" I need to pass the numbers to a function, but three at a time, until the string ends. The st

Re: "Pythoner",Wish me luck!

2009-04-03 Thread Matteo
On Apr 3, 9:05 am, Linuxwell wrote: > Starting today I would like to study Python,Wish me luck! Good luck! Don't forget to... >>> print 'Hello World!' ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending SMS using python script

2009-04-02 Thread Matteo
I don't really know, because I didn't write it myself ;) I think it basically logs in into a service provider site with pycurl, follows the right links, reads captcha's and writes an SMS, which is then sent by the provider itself. I can give you the direct link to the source code from the same sit

Re: Sending SMS using python script

2009-04-02 Thread Matteo
I use a programme, written in Python, which sends sms through the sms providers. You might want to have a look to the source code: http://www.moioli.net/Progetti___1/MoioSMS___Messaggi_GRATIS_da_Internet22.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Downloading binary files - Python3

2009-03-21 Thread Matteo
> srcdata = urlopen(url).read() > dstfile = open(path,mode='wb') > dstfile.write(srcdata) > dstfile.close() > print("Done!") Have you tried reading all files first, then saving each one on the appropriate directory? It might work if you have enough memory, i

SWIG, c++ to Python: array of pointers (double pointer) not working

2009-03-14 Thread Matteo
lso is imported without problems, but then... mat...@matteo:~/lab/sandbox$ python Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import dptest as dp >>

Re: c++ extension, problem passing argument

2009-03-14 Thread Matteo
On 14 Mar, 02:08, Aaron Brady wrote: > On Mar 13, 5:42 pm, Matteo wrote: > > > > > On 13 Mar, 22:35, Aaron Brady wrote: > > > > On Mar 13, 1:34 pm, Matteo wrote: > > > > > hmmm... looks like SWIG has a problem with double pointers. I googled

Re: parsing tab separated data efficiently into numpy/pylab arrays

2009-03-13 Thread Matteo
On 13 Mar, 23:19, per wrote: > hi all, > > what's the most efficient / preferred python way of parsing tab > separated data into arrays? for example if i have a file containing > two columns one corresponding to names the other numbers: > > col1    \t     col 2 > joe    \t  12.3 > jane   \t 155.0

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
On 13 Mar, 22:35, Aaron Brady wrote: > On Mar 13, 1:34 pm, Matteo wrote: > > > hmmm... looks like SWIG has a problem with double pointers. I googled > > around a bit and found: > > >http://osdir.com/ml/programming.swig/2003-02/msg00029.html > > > anyone know

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
hmmm... looks like SWIG has a problem with double pointers. I googled around a bit and found: http://osdir.com/ml/programming.swig/2003-02/msg00029.html anyone knows how to write a small wrapper to do the appropriate dereferencing? -- http://mail.python.org/mailman/listinfo/python-list

Re: c++ extension, problem passing argument

2009-03-13 Thread Matteo
On 13 Mar, 18:19, Aaron Brady wrote: > On Mar 13, 12:03 pm, Matteo wrote: > > > > > Hi all, > > > I wrote a few c++ classes for some data analysis on a physics > > esperiment. Now I want to glue the lot with Python, so I built the > > necessary wrap code

c++ extension, problem passing argument

2009-03-13 Thread Matteo
Hi all, I wrote a few c++ classes for some data analysis on a physics esperiment. Now I want to glue the lot with Python, so I built the necessary wrap code with SWIG and compiled the library with Distutils. All is fine, I can import the module and classes work as expected... ...but for one thing

ANNOUNCE: PyQt3Support r1 - Python bindings for Qt3Support

2007-09-17 Thread Matteo Bertini
.QTabWidget, Gui.QMenu, Core.QTimer, Gui.QLayout, Gui.QPalette, Gui.QMenuBar, Gui.QLineEdit, Gui.QDialog, Gui.QInputDialog, Gui.QCheckBox, Gui.QWidget, Gui.QTextEdit, Gui.QEvent, Gui.QSlider Download http://www.develer.com/oss/PyQt3Support -- Matteo Bertini - [EMAIL PROTECTED] Deve

Extracting attributes from compiled python code or parse trees

2007-07-23 Thread Matteo
Hello- I am trying to get Python to extract attributes in full dotted form from compiled expression. For instance, if I have the following: param = compile('a.x + a.y','','single') then I would like to retrieve the list consisting of ['a.x','a.y']. I have tried using inspect to look at 'co_names'

Re: mapping subintervals

2007-06-13 Thread Matteo
On Jun 13, 2:32 pm, Lee Sander <[EMAIL PROTECTED]> wrote: > hi, > I have the following problem which is turning out to be non-trivial. I > realize that this is not > exactly a python problem but more of an algorithm problem -- but I > post it here because > I want to implement this in python. > > I

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Matteo
On May 30, 1:29 pm, Matteo <[EMAIL PROTECTED]> wrote: > - Write an autoflush class: > class AutoFlush: > def __init__(self, stream): > self.stream = stream > def write(self, text): > self.stream.write(text) > self.stream.flush() >

Re: Appending a log file and see progress as program executes

2007-05-30 Thread Matteo
On May 30, 1:03 pm, "Karim Ali" <[EMAIL PROTECTED]> wrote: > Hi, > > I am writing a program that will take several days to execute :) and would > like to append to a log file but be able to open that file at any time and > see the errors that have occured. > > So this is what I am doing: > > --

Re: n-body problem at shootout.alioth.debian.org

2006-10-06 Thread Matteo
Peter Maas wrote: > I have noticed that in the language shootout at shootout.alioth.debian.org > the Python program for the n-body problem is about 50% slower than the Perl > program. This is an unusual big difference. I tried to make the Python program > faster but without success. Has anybody an

Re: extract certain values from file with re

2006-10-06 Thread Matteo
Fabian Braennstroem wrote: > Hi, > > I would like to remove certain lines from a log files. I had > some sed/awk scripts for this, but now, I want to use python > with its re module for this task. > > Actually, I have two different log files. The first file looks > like: > >... >'some text'

Re: Scientific computing and data visualization.

2006-09-06 Thread Matteo
Fie Pye wrote: > Hallo > > I would like to have a high class open source tools for scientific > computing and powerful 2D and 3D data visualisation. Therefore I chose > python, numpy and scipy as a base. Now I am in search for a visualisation > tool. I tried matplotlib and py_opendx with

Re: list of polynomial functions

2006-06-19 Thread Matteo
Josiah Manson wrote: > In the following program I am trying to learn how to use functional > programming aspects of python, but the following program will crash, > claiming that the recursion depth is too great. I am attempting to make > a list of polynomial functions such that poly[0](3) = 1, poly

string.count issue (i'm stupid?)

2006-05-22 Thread Matteo Rattotti
n the number of substring in the master string, if we spoke about substring i count 3 substring... Can someone explain me this? And in which way i can count all the occurrence of a substring in a master string? (yes all occurrence reusing already counter character if needed) Thanks a lot Matteo R

Re: Perl-Python-a-Day: split a file full path

2005-10-17 Thread matteo d'addio 81
www.scsh.net/docu/html/man-Z-H-6.html#node_sec_5.1 matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: set of sets

2005-08-11 Thread Matteo Dell'Amico
;, so it won't work. Doesn't look like a documented behaviour to me, though. -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: set of sets

2005-08-11 Thread Matteo Dell'Amico
set([0, 2]), 2: set([2,4]), 3: set([5]), 4: set([5]), 5: set([])} If node ids are consecutive integers, you could also of course use a list as the outer structure. PS: we could also discuss this in italian in it.comp.lang.python :) -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: set of sets

2005-08-11 Thread Matteo Dell'Amico
fails eventually not calling hash(s). Why don't you just use "frozenset"? -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

benchmarking with threading module

2005-06-28 Thread Matteo Memelli
same time. The plotting the time VS number of queries I'd like to understand which would be the critical number of simultaneous connection to the web server. Do you think that using the Threading module would be a good idea? Any other suggestion? Thank you very much Matteo Memelli -- http://

Re: Python Cookbook, 2'nd. Edition is published

2005-04-06 Thread Matteo Dell'Amico
Python. +1. The Python Cookbook is really great, and being included in the contributors, even if for a little tiny idea that got heavily refactored, feels wonderful. I'm really grateful to the python community. -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-20 Thread Matteo Dell'Amico
dn't it be easier to fill in default values when you gather data as opposed to when you use it? -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Matteo Dell'Amico
terables. I can imagine a list of iterables of different types, and a default value of maybe [] or set([]). -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Matteo Dell'Amico
turns a new default value? That's exactly what Duncan proposed with the "function" keyword argument. -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-20 Thread Matteo Dell'Amico
containers. defaultdicts look to me as a solution that is more elegant and solves more problems. What is the problem with them? -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: returning True, False or None

2005-02-07 Thread Matteo Dell'Amico
mprehension, but sets are just more elegant... -- Ciao, Matteo -- http://mail.python.org/mailman/listinfo/python-list

Re: else condition in list comprehension

2005-01-09 Thread Matteo Dell'Amico
nt i to be "i-2" if i%2 is not equal to 0? You could use [(i-2, i+2)[bool(i%2 == 0)] for i in range(10)] or, in a less general but shorter way [(i+2, i-2)[i%2] for i in range(10)] or even [i%2 and i-2 or i+2 for i in range(10)] The "if" clause in comprehensions is used as a filter