Re: python backup script

2013-05-07 Thread Enrico 'Henryx' Bianchi
sive compared to (python needs to spawn an external process to execute the command) Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: python backup script

2013-05-06 Thread Enrico 'Henryx' Bianchi
Enrico 'Henryx' Bianchi wrote: > cmd2 = subprocess.Popen(['gzip' '-c'], > shell=False, > stdout=filename) Doh, my fault: cmd2 = subprocess.Popen(['gzip' '-c'], shell=False, stdout=

Re: python backup script

2013-05-06 Thread Enrico 'Henryx' Bianchi
nformation_schema', 'db_dev']: filename = "/backups/mysql/%s-%s.sql" % (database, filestamp) cmd1 = subprocess.Popen(['mysqldump', '-u ' + username, '-p' + password, '-h ' + hostname, '-e', '--opt', '-c ' + database], shell=False, stdout=subprocess.PIPE) cmd2 = subprocess.Popen(['gzip' '-c'], shell=False, stdout=filename) Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Python recursive tree, linked list thingy

2012-03-08 Thread Enrico Franchi
Wanderer wrote: > How > do you handle this sort of thing in Python? I believe that the best thing to do is a Union-Find algorithm. Depending on the exact nature of your problem, you may also want to check out the Hoshen-Kopelman Algorithm. Although the algorithm itself is rather efficient, it

Re: Python 2 or 3

2011-12-10 Thread Enrico 'Henryx' Bianchi
3 on a production environment which doesn't support it, I have to prepare at least a development environment similar to production (ok, ok, with a VM is simple, but I need to track the exception) Enrico P.S. an alternative may be cx_freeze, but I don't know exactly hot it works P.P.S. I&#

Re: Python 2 or 3

2011-12-09 Thread Enrico 'Henryx' Bianchi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tobiah wrote: > Use the newer version and don't look back. Interesting reply, but if I have a platform wich doesn't support Python 3 (e.g. RHEL 5.x)? ]:) Enrico P.S. note that: I *don't* want to recompile Python in prod

Numpy ndarray to C array

2011-12-08 Thread Enrico
I am trying to pass a multi-dimensional ndarray to C as a multi- dimensional C array for the purposes of passing it to mathematica. They already have a wrapper for a 1-D Python list. where the list is copied to "list". Shown below: static PyObject * mathlink_PutIntegerList(mathlink_Link *self, PyO

Re: msvcr90.dll is MIA?

2010-04-14 Thread Enrico
hon.org/py2exe (related to wxPython but look at the manifest) An other solution is to run the vcredist on the target machine and the application will run. This is the suggested solution if you cannot distibute the DLLs. Bye, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: A beginner question about GUI use and development

2009-11-13 Thread Enrico
hon and other packages installed you need to "build" the application. Look at py2exe and friends (freeze, py2app,...). You can prepare an application with everything needed to run it and install/copy it on the user machine. Regards, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing windows structures through ctypes.

2009-07-02 Thread Enrico
c_ulong)] > > I'm not sure what needs to go in the above empty tuple for > "PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine" (in Original > PEB). > > Please suggest. PostProcessInitRoutine should be a callback function or something similar. It should be enough to define a type PostProcessInitRoutine = WINFUNCTYPE(...parameters...) and use this. Regards, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbound Method Error

2009-06-09 Thread Enrico
n this case self is not needed. > > But as been mentioned in this thread before, there might be no reason to > use the class anyway. I agree but the code is not very clear about the use of this class as ancestor of MC. >>class MC(Funcoes, type): ? Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbound Method Error

2009-06-09 Thread Enrico
atribdescripto = Funcoes.CifradorDeCesar (atribcripto, 3, 2) Best regards, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Python, XML and XPath

2008-12-17 Thread Enrico
ld install I never used libxml2 but version 2.6.9 seems quite old, according to this page: http://users.skynet.be/sbi/libxml-python/ Bye, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Using an DTD not specified in XML file for validation

2008-08-07 Thread Enrico
despeak.net/lxml/validation.html With this package is quite simple (code not tested): from lxml import etree dtd = etree.DTD('mydtd.dtd') f = file('mydoc.xml') xml = etree.XML(f.read()) dtd.validate(xml) Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Hobbyist - Python vs. other languages

2008-08-05 Thread Enrico Franchi
<[EMAIL PROTECTED]> wrote: > A programming language is a tool to solve problems, so first of all: > do you have problems to solve? You can create some visualizations, > some program with GUI, some networked code to download things and > process them, etc. It's surprising how hard is this part. I

Re: very large dictionary

2008-08-05 Thread Enrico Franchi
Simon Strobl <[EMAIL PROTECTED]> wrote: > Well, as I was using Python, I did not expect to have to care about > the language's internal affairs that much. I thought I could simply do > always the same no matter how large my files get. In other words, I > thought Python was really scalable. It's n

Re: multiple inheritance and __getattr__

2008-07-29 Thread Enrico
A and B are > ordinary Python classes (ie: not builtin types, not C extensions, etc), > you can monkeypatch them. But that's not necessarily the best thing to > do (it would require more work than your actual solution). I know that I can do whatIwant with class A and class B (monkeypatc

multiple inheritance and __getattr__

2008-07-28 Thread Enrico
gt;>> class C(A,B): def __getattr__(self, name): try: return A.__getattr__(self, name) except AttributeError: return B.__getattr__(self, name) >>> c=C() >>> c.a A.__getattr__ 1 >>> c.b A.__getattr__ B.__getattr__ 1 A better solution is welcome. Many thanks, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: error with wxPython2.8-win32-unicode-2.8.7.1-py25.exe

2007-12-19 Thread Enrico
sible. I suggest you to try >>> from wx import * or better >>> import wx (I don't think that importing everything is a good choice) Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling private base methods

2007-04-12 Thread Enrico
ansformed name is extremely long (longer than 255 characters), implementation defined truncation may happen. If the class name consists only of underscores, no transformation is done. Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: why brackets & commas in func calls can't be ommited? (maybe it couldbe PEP?)

2007-03-22 Thread Enrico 'Mc Osten' Franchi
<[EMAIL PROTECTED]> wrote: > But I think in some situations Ruby allows to omit them, solving some > of the "impossibile" problems shown in this thread. This makes Ruby a > bit better than Python to create application-specific mini languages, > that are quite useful in some situations. Yes. Howev

Re: Best Free and Open Source Python IDE

2007-02-08 Thread Enrico 'Mc Osten' Franchi
Srikanth <[EMAIL PROTECTED]> wrote: > All I need is a good IDE, I can't find something like Eclipse (JDT). > Eclipse has a Python IDE plug-in but it's not that great. Have you tried the 'full' plugin (you have to pay about 30 $ IIRC or something like that)? My favourite Python editor is TextMate

Re: Help with ConfigParser

2006-10-02 Thread Enrico
or client code can set an attribute of this name on instances to affect this behavior. Setting this to str(), for example, would make option names case sensitive. Bye, Enrico -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]Is there a module for print object in a readable format?

2005-10-17 Thread enrico . sirola_NOSPAM
pprint import pprint pprint(object) bye, e. -- Enrico Sirola <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: Favorite non-python language trick?

2005-06-24 Thread Enrico
neat :) python: """ print 10 """ and #""" print 10 #""" C++: /* print(10); */ and ///* print(10); //*/ ? Bye, Enrico -- http://mail.python.org/mailman/listinfo/python-list