Floating point minimum and maximum exponent values

2013-07-16 Thread Marco
rounds=1) The values (in double precision) 0 and 2047 are reserved for zero, infinity and NaN (in combination with the fraction), so I was expecting -1022 and 1023... -- Marco Buttu -- http://mail.python.org/mailman/listinfo/python-list

Division and multiplication have a different behavior in the overflow case

2013-07-27 Thread Marco
t;, line 1, in OverflowError: long int too large to convert to float I think the multiplication should have the same behavior than the division: * `inf` or `-inf` when the operands are inside the limits, but the result is not * `OverflowError` when the result, and at least one oper

Built-in open() with buffering > 1

2012-08-23 Thread Marco
f = open('myfile', 'w', buffering=2) >>> f.write('a') 1 >>> open('myfile').read() '' >>> f.write('b') 1 >>> open('myfile').read() '' >>> f.write('cdefghi\n') 8 >>> open('myfile').read() '' >>> f.flush() >>> open('myfile').read() 'abcdefghi\n' Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Built-in open() with buffering > 1

2012-08-23 Thread Marco
On 08/24/2012 06:35 AM, Marco wrote: Please, can anyone explain me the meaning of the "buffering > 1" in the built-in open()? The doc says: "...and an integer > 1 to indicate the size of a fixed-size chunk buffer." Sorry, I get it: >>> f = open('myfi

Re: Built-in open() with buffering > 1

2012-08-30 Thread Marco
On 08/26/2012 10:25 AM, Hans Mulder wrote: The algorithm is explained at http://docs.python.org/library/io.html#io.DEFAULT_BUFFER_SIZE Thanks ;) In other words: open() tries to find a suitable size by calling os.stat(your_file).st_blksize and if that fails, it uses io.DEFAULT_BUFFER_SIZE, wh

The opener parameter of Python 3 open() built-in

2012-09-03 Thread Marco
Does anyone have an example of utilisation? -- http://mail.python.org/mailman/listinfo/python-list

Re: The opener parameter of Python 3 open() built-in

2012-09-03 Thread Marco
On 09/03/2012 03:05 PM, Dave Angel wrote: Does anyone have an example of utilisation? As of Python 3.2.3, there is no "opener" parameter in the open() function. http://docs.python.org/py3k/library/functions.html I don't know of any such parameter in earlier or later versions, but I coul

Python 3.3 and .pyo files

2012-09-21 Thread Marco
I was trying to import a pyo module in Python 3.3, but Python does not find it: $ echo "print(__file__)" > foo.py $ python3.3 -O -m foo /home/marco/temp/foo.py $ ls foo.py __pycache__ $ rm foo.py $ mv __pycache__/foo.cpython-33.pyo foo.pyo $ rm __pycache__ -r $ ls foo.pyo # The fo

Re: Python 3.3 and .pyo files

2012-09-21 Thread Marco
; and (3) it does work in Python 3.3 if you don't use the -O option. It doesn't work with Python 3.3.0rc2 too. -- Marco -- http://mail.python.org/mailman/listinfo/python-list

The type.__call__() method manages the calls to __new__ and __init__?

2012-11-20 Thread Marco
new__(cls): ... print('Foo.__new__()') ... return super().__new__(cls) ... def __init__(self): ... print('Foo.__init__(self)') ... >>> f = type.__call__(Foo) Foo.__new__() Foo.__init__(self) Is that right? Thanks in advance -- Marco -- http://mail.python.org/mailman/listinfo/python-list

A question about readability

2012-12-07 Thread Marco
script.py 261 94 216 is explicit enough? Do you prefer a clearer solution? Thanks in advance, Marco -- Marco -- http://mail.python.org/mailman/listinfo/python-list

Meaning of `\newline` as escape sequence

2012-12-28 Thread Marco
Hi all, in the documentation: http://docs.python.org/3.3/reference/lexical_analysis.html the escape sequence `\newline` is expained as "Backslash and newline ignored". What does it mean? Thanks in advance, M. -- Marco -- http://mail.python.org/mailman/listinfo/python-list

Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Marco
;> print('\u0660123') ٠123 >>> '\u0660123'.isdigit(), '\u0660123'.isdecimal() (True, True) >>> print('\u216B') Ⅻ >>> '\u216B'.isdecimal(), '\u216B'.isdigit() (False, False) Can anyone give me some help? Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread Marco
On 05/16/2012 06:24 PM, Ulrich Eckhardt wrote: Marco wrote: >>>> '123'.isdecimal(), '123'.isdigit() > (True, True) >>>> print('\u0660123') > ٠123 >>>> '\u0660123'.isdigit(), '\u0660123&#

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-17 Thread Marco
meric() (False, True, True) py> unicodedata.numeric(c) 2.0 Perfect explanation, thanks again, Marco -- http://mail.python.org/mailman/listinfo/python-list

str.isnumeric and Cuneiforms

2012-05-17 Thread Marco
Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Marco -- http://mail.python.org/mailman/listinfo/python-list

[TWISTED] Howto Deferred

2011-07-14 Thread marco
Hello gals and guys, I'm an experienced Python user and I'd like to begin playing with Twisted. I started RTFM the tutorial advised on the official site and I found it really useful and well done. Now I'd like to practice a bit by coding a little program that reads strings from a serial device an

minidom appendChild confusion

2005-09-23 Thread Marco
Hello! Can anyone explain why the following code does not work? (I'm using python2.4.) Cheers, Marco -- # the following code does _not_ work. # intended: put child-nodes as children to another node from xml.dom.minidom import Document doc = Document() node1 = doc.createElement('

Re: minidom appendChild confusion

2005-09-23 Thread Marco
That's it. Thank you very much! Marco -- http://mail.python.org/mailman/listinfo/python-list

python problems with dos lineendings in python-scripts

2005-10-21 Thread marco
hi folks, i can not run any python scripts with dos lineendings under cygwin's python. if i run such a scripts i get stupid syntax error messages from python. what can i do to run these scripts without changing the lineending of these scripts. regards marco pgpz3U7zraEvK.pgp Description

Re: noob question

2005-06-28 Thread Marco
Steven D'Aprano <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Can anyone think of some good, easy to understand examples of where > Python's name/object model differs from the variable/value model? a = b = [ 1 ] a and b are _not_ two variables, each with [ 1 ] as value, but

Re: check if object is number

2005-02-12 Thread marco
1.0 / 7:\t', isnumber(1.0 / 7) print '1+0j:\t', isnumber((1+0j)) print '"spam":\t', isnumber("spam") output: 1: True 1.25: True 1.0/7: True 1+0j: True "spam": False Ooops! While checking other posts I realized that this is alm

Re: A completely silly question

2004-12-17 Thread marco
uld/) in the section "Event Driven programming" Hope it helps Marco -- http://mail.python.org/mailman/listinfo/python-list

Temp dir creation

2005-03-23 Thread marco
I'm a bit puzzled by the following behaviour (at least in the way I read http://docs.python.org/lib/module-tempfile.html ) > python Python 2.4 (#1, Mar 21 2005, 23:04:52) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more informati

Re: New Python regex Doc (was: Python documentation moronicities)

2005-04-20 Thread marco
Re: http://xahlee.org/perl-python/python_re-write/lib/module-re.html Bill Mill <[EMAIL PROTECTED]> writes: > Alright, I feel like I'm feeding the trolls just by posting in this > thread. Just so that nobody else has to read the "revised" docs, no it > doesn't: I find that Lee's version compleme

Required arguments in argparse: at least one of a group

2013-03-23 Thread Marco
--dir mydir python finder.py --file myfile --pattern mypattern --dir mydir where --dir is required, and --file _or_ --parser have to be specified. In other words, I want the parser prints an error message just in this case: python finder.py --dir mydir Thanks in advance, Marco -- Marco -- http

Re: Required arguments in argparse: at least one of a group

2013-03-24 Thread Marco
ot; Thanks Rob, but I was looking for a solution in the stdlib -- Marco -- http://mail.python.org/mailman/listinfo/python-list

python setup.py install and dependencies

2013-04-14 Thread Marco
quot; has installed pygments too. So my question is: if I want "python3.3 setup.py install" installs the dependencies of a package I need to have distribute? And pip installs the dependencies because of it uses distribute? Thanks in advance, -- Marco -- http://mail.python.org/mailman/listinfo/python-list

PyOpengl text rendering with autocad font

2005-12-15 Thread Marco
ed to scale rotate the text. I don't know anything about handling fonts, I must use this .shx but I don't know. In which way can I take this file and put them in my programs? In two afternoons in Google I don't find anything. If somebody wants to help me :-) Thanks. Ma

generating a wm5 executable

2007-06-06 Thread Marco
e quite a niche. Can I run py2exe runs under wm5? Any other suggestion? Thanks in advance Marco -- http://mail.python.org/mailman/listinfo/python-list

Hey! A VERY c00l feature of X and mplayer(could bind to PyQt4)

2007-03-04 Thread Marco
I found a Very c00l feature, that you can write your own MPlayer GUI. The core is Xembed (http://www.freedesktop.org/wiki/Standards/xembed-spec) And Of course MPlayer support it as its para: -wid I hope you like it! -- LinuX Power -- http://mail.python.org/mailman/listinfo/python-list

How to create pid.lock via python?

2007-03-05 Thread Marco
Hello, I write a program control a device via RS232, I hope to add some code to let the program canNOT be used by other people when one people using. Can you tell me how to create pid.lock file in python? Thank you!! -- LinuX Power -- http://mail.python.org/mailman/listinfo/python-list

how to set different TCP_KEEPALIVE parameters for different socket ?

2007-03-12 Thread Marco
Hi, I can use sd.setsockopt() to enable the socket use TCP keepalive feature, but how to set a different parameters(interval, probes and time) for it? Sure, I can modify /proc/sys/net/ipv4/tcp_* , but need root password and will affect other program. Thank you! -- LinuX Power -- http://mail.p

Re: how to set different TCP_KEEPALIVE parameters for different socket ?

2007-03-12 Thread Marco
Oh, I see, sd.getsockopt(SOL_TCP, TCP_*) On 3/13/07, Marco <[EMAIL PROTECTED]> wrote: > Hi, > > I can use sd.setsockopt() to enable the socket use TCP keepalive > feature, but how to set a different parameters(interval, probes and > time) for it? > Sure, I can modify

How to set SA_RESTART flag in Python

2007-03-20 Thread Marco
Hi, I want to set SA_RESTART flag to restart a system-call. How to do this in Python? Thank you! -- LinuX Power -- http://mail.python.org/mailman/listinfo/python-list

about second parameter of signal handler func.

2007-03-26 Thread Marco
Hi, In C, a signal handler function has only one parameter, that is signal number. But in Python(import signal), a signal handler function has two parameters, the first is signal number, the second is "frame"? What is "frame", please? Thank you! -- LinuX Power -- http://mail.python.org/mailm

frame of Qt program

2007-04-02 Thread Marco
Hi, I want to write a PyQt4 program, which like a graph-ssh. One side user choose server moder, and other side(s) user choose client mode. Both of them have a GUI, they can connect via socket. I have study PyQt4 for a while and learn a little socket(from W.R Stevens Unix Networking Programming).

communication between two classes which in different threading

2007-04-05 Thread Marco
Hello, I write two class, which one is Gui(PyQt4) other is socket server. I wanna: if socket recv() something, Gui will show it in a label. But it seems that I cannot call the func from other threading. How to reslove it? Thank you! -- LinuX Power -- http://mail.python.org/mailman/listinfo/

Re: communication between two classes which in different threading

2007-04-05 Thread Marco
Yes, use signal/slot could reslove this question! On 4/6/07, Marco <[EMAIL PROTECTED]> wrote: > Hello, > > I write two class, which one is Gui(PyQt4) other is socket server. I > wanna: if socket recv() something, Gui will show it in a label. > But it seems that I cannot cal

[no subject]

2007-04-09 Thread Marco
Hi, I have a problem to install wxPython on my MacBook (Pythonversion 2.5). If would install the wxPython (python setup.py install), then I got this error: Traceback (most recent call last): File "/Users/marco/Desktop/flexo1/wxpython/wxPython-src-2.8.3.0/ wxPython/setup.py", l

install wxPython

2007-04-09 Thread Marco
Hi, I have a problem to install wxPython on my MacBook (Pythonversion 2.5). If would install the wxPython (python setup.py install), then I got this error: Traceback (most recent call last): File "/Users/marco/Desktop/flexo1/wxpython/wxPython-src-2.8.3.0/ wxPython/setup.py", l

Re: Free Python Ebook

2007-09-16 Thread Marco
Hi George, > Please tell me from which website I will get the free Python Ebook. which one do you mean? I only know this one: http://diveintopython.org Bye, Marco PS: Sorry, hit the wrong button the first time ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: vim - what's a smarttab?

2007-09-24 Thread Marco
is reset when 'compatible' is set. If you'd like to use VIM for Python make sure you have the following settings for the best result: http://www.vex.net/~x/python_and_vim.html Marco -- http://mail.python.org/mailman/listinfo/python-list

IOError: [Errno 4] Interrupted system call

2007-02-05 Thread Marco
Hello,every one, I meet a question: in my old script, I usually use os.popen2() to get info from standard unix(LinuX) program like ps,ifconfig... Now, I write a OO-based programme, I still use os.popen2( check whether mplayer still working via ps command ), but some things I got the following mes

IOError: [Errno 4] Interrupted system call

2007-02-06 Thread Marco
Hello,every one, I meet a question: in my old script, I usually use os.popen2() to get info from standard unix(LinuX) program like ps,ifconfig... Now, I write a OO-based programme, I still use os.popen2( check whether mplayer still working via ps command ), but some things I got the following mes

mplayer bug or python bug?

2007-02-07 Thread Marco
The following code is my test program for control mplayer. in movies/ there are about 20 movies, the code plays them in circle, but mplayer will crash silently after a circle, the "sliently" means I can handle popen2 without except, but no movie. I have no idea about it... Can you help me? class

Linux-Signal VS QT

2007-02-08 Thread Marco
Can I use LinuX signal as a tool for commuction with a QT(PyQt4) programme? The follow code didNOT work... from PyQt4 import QtCore,QtGui import signal import sys import os try: import psyco psyco.full() except: pass class Main(QtGui.QWidget): def __init__(self): QtGui.

How to write a programe that include both pipe(low speed system call) and signal

2007-02-14 Thread Marco
Hi, I have know that signal will interrupt some kind low speed system call like pipe. But how to design a program that both support signal and pipe? I have a mplayer.py to play movie via os.popen2() and mplayer slave mode. And there is a mplayer_ctl.py send signal to mplayer.py to trigger

select which lib for iNet?

2007-02-25 Thread Marco
Hello everyone, I wanta know why (Py)Qt has its own lib on socket/ sql/ openGL,etc ? Is the lib better than standard lib? Thank you! -- LinuX Power -- http://mail.python.org/mailman/listinfo/python-list

a question in python curses modules

2008-02-14 Thread Marco
Hi, I wanna write a simple curses program, but somethings confuse me, my code here: #!/usr/bin/python import os import sys import time import curses class CursesObject( object ): def __init__(self): self.STDSCR = curses.initscr() curses.noecho() curses.cbreak()

python and rcp, portbind communication

2008-12-27 Thread Marco
Hello python list, i want to write a program in python which can communicate with rpcservices. At the first stage it shall talk with portbind on port 111 and figure out the running rpc services. Is there already a implementation for python to do so? Best regards, marco -- http://mail.python.org

import overwrites __name__

2009-05-08 Thread Marco
t len(dir()) print my_name -> __main__ 119 x 117 unhandled NameError "name 'my_name' is not defined" The module x is from me, and I am not aware of doing anything cruel there. What evil thing can be done in its sub module that can result in that strange thing? br Marco

Re: import overwrites __name__

2009-05-08 Thread Marco
Terry Reedy wrote: > Marco wrote: >> Hi, >> >> There happened something that I do not understand. Actually I don't even >> know how it can be possible. >> >> I import a module and then the name space of the importing module seems >> do be overw

Re: import overwrites __name__

2009-05-08 Thread Marco
Marco wrote: > Hi, > > There happened something that I do not understand. Actually I don't even > know how it can be possible. > > I import a module and then the name space of the importing module seems do > be overwritten. > > my_name = __name__ > print

Re: import overwrites __name__

2009-05-08 Thread Marco
t py_compile py_compile.compile(__file__) Still I appreciate if someone could explain me why. br Marco -- http://mail.python.org/mailman/listinfo/python-list

Inconsistency on getting arguments

2013-06-25 Thread Marco Perniciaro
c ['C:\\Users\\mapr\\example.py'] C:\Users\mapr>python example.py a b c ['example.py', 'a', 'b', 'c'] Can someone please explain? Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginners question

2012-08-30 Thread Marco Nawijn
a C struct (a class with only attributes and no methods). A small additional remark. Besides being a real dict or list (by means of inheritance), custom class can also implement the interface (__getitem__ etc.). If you want to know if an object implements this interface you could use the types defined in the 'abc' and 'collections' standard modules. So instead of checking if a type is a dict like this: >>> isinstance(s, dict) you could also check if it implements the dict interface: >>> isinstance(s, collections.MutableMapping) # or similar Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: class object's attribute is also the instance's attribute?

2012-08-30 Thread Marco Nawijn
d' If you want attributes to be local to the instance, you have to define them in the __init__ section of the class like this: class A(object): def __init__(self): d = 'my attribute' >>> aobj = A() >>> bobj = A() >>> aobj.d 'my attribute' >>> bobj.d 'my attribute' >>> aobj.d = 'oops...attribute changed' >>> aobj.d 'oops...attribute changed' >>> bobj.d 'my attribute' Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginners question

2012-08-30 Thread Marco Nawijn
On Thursday, August 30, 2012 3:15:03 PM UTC+2, Ulrich Eckhardt wrote: > Am 30.08.2012 13:54, schrieb boltar2003@boltar.world: > > s = os.stat(".") > > print s > > > posix.stat_result(st_mode=16877, st_ino=2278764L, st_dev=2053L, st_nlink=2, > > st_u > > > id=1000, st_gid=100, st_size

Re: class object's attribute is also the instance's attribute?

2012-08-30 Thread Marco Nawijn
On Thursday, August 30, 2012 3:25:52 PM UTC+2, Hans Mulder wrote: > On 30/08/12 14:34:51, Marco Nawijn wrote: > > > > > Note that if you change 'd' it will change for all instances! > > > > That depends on how you change it. > > > > &

Re: class object's attribute is also the instance's attribute?

2012-08-30 Thread Marco Nawijn
On Thursday, August 30, 2012 4:30:59 PM UTC+2, Dave Angel wrote: > On 08/30/2012 10:11 AM, Marco Nawijn wrote: > > > On Thursday, August 30, 2012 3:25:52 PM UTC+2, Hans Mulder wrote: > > >> > > >> > > > Learned my lesson today. Don't assume

Re: Looking for an IPC solution

2012-08-31 Thread Marco Nawijn
romq (www.zeromq.org)? It does not provide a messaging system, but you could use things like simple strings (json) or more complicated things like Protobuf. Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: python CAD libraries?

2012-09-11 Thread Marco Nawijn
note that in my opinion, Blender cannot be considered as a CAD environment. Ofcourse it is very powerful, but I think it is more targeted towards animation and visually pleasing applications, not mechanical engineering. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: pythonOCC examples doesn't work?

2012-09-11 Thread Marco Nawijn
to post the question to the PythonOCC mailinglist. They are quite responsive. One last suggestion. OCC itself comes with a small utility called DRAWEXE. It is a tcl/tk program that can be used to play around with a lot of the functionality provided by OCC. Good luck! Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the tidy/elegant way to protect this against null/empty parameters?

2012-10-16 Thread Marco Nawijn
On Monday, October 15, 2012 1:33:02 PM UTC+2, (unknown) wrote: > I want to fix an error in some code I have installed, however I don't > > really want to just bodge it. > > > > The function producing the error is:- > > > > def get_text(self, idx): # override ! > >

Re: Accessing variables in __init__.py

2012-10-16 Thread Marco Nawijn
On Tuesday, October 16, 2012 10:48:17 AM UTC+2, Gaudha wrote: > my_package/ > > __init__.py > > my_module1.py > > my_module2.py > > variables.py > > > > I want to define common variables in __init__.py and use the namespace in > my_module1.py or my_module2.py. Defining it is not a p

Re: Providing a Python wrapper to a C++ type.

2012-10-16 Thread Marco Nawijn
d I selected BOOST Python, because I was only interested in the Python wrapping (SWIG could generate many other wrappers as well). Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to create kernel log messages via Python?

2012-10-16 Thread Marco Nawijn
as accurate. > > > > So does anyone know of a way to do this? Unfortunately, I've tried > > some searching but google doesn't like the term klog, and most of the > > hits involved injecting code or other things that are not related at > > all. > > &g

Re: Which book is the best?

2012-10-16 Thread Marco Nawijn
this) is definitely an efficient way of exploring the Python world, I also liked alot the Python Essential Reference (4th edition). Since you already understand how to program, the Python essential reference quickly guides you through Python language and the standard library. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy - 2D matrix/array - initialization like in Matlab...

2012-10-16 Thread Marco Nawijn
h! > > >> > > > What it prints should give you a hint: > > > > > > >>> Dx = numpy.matrix([[test11, test12, test13], [test21, test22, > > > -0.5], [0, -0.5, 1.5]]) > > > >>> Dx > > > matrix([[ 1

Re: Python on Windows

2012-10-16 Thread Marco Nawijn
e path to feedparser.py directly in the script that uses it. Something like the following: import sys sys.path.append("path to feedparser.py") import feedparser Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Providing a Python wrapper to a C++ type.

2012-10-16 Thread Marco Nawijn
On Tuesday, October 16, 2012 1:39:44 PM UTC+2, Stefan Behnel wrote: > Marco Nawijn, 16.10.2012 12:17: > > > On Tuesday, October 16, 2012 10:11:52 AM UTC+2, aaron.l...@gmail.com wrote: > > >> I have a C++ module where I have a defined, working type. How would I > &

Re: Printing a text over an image

2012-11-15 Thread Marco Nawijn
ing etc.). Working with MS/Word through the win32 bindings is really simple. I have done this a while ago for some automatic report generation. The basic routine is to start recording your actions with the MS/Word macro recorder, do the things you want to do, stop recording, look at the VB code and guess the equivalent Python code. This is not as bad as it sounds. It normally is really straightforward. I am on Linux at the moment, so I cannot present any code examples. Feel free to try and post some example code if you get stuck. Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner Tutorials

2013-01-18 Thread marco . kretz
Am Freitag, 18. Januar 2013 15:47:52 UTC+1 schrieb Rik: > Hi, I've developed a website for beginners to Python. I'd appreciate any > comments or criticism. It's still under development, and should be finished > in the next few months. Oh, and it's free to use. > > > > www.usingpython.com Very

Re: dynamically creating classes from text

2012-01-24 Thread Marco Nawijn
7;A' >> aobj.a 10 The methods might be a little more difficult to attach to the class, but I don't fully understand your problem. In particular, where does the implementation of your methods come from? Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread Marco Buttu
numeric(), '\U00012456'.isnumeric() (True, False) It seems to me that they are not: py> c = '\U00012456' py> import unicodedata py> unicodedata.numeric(c) Traceback (most recent call last): File "", line 1, in ValueError: not a numeric character Exactly, as I wrote above, is that right? -- Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread Marco Buttu
Unicode (ver. 5.0.0) does not assign numeric values to these code points. help(unicodedata) says Python 3.3a refers to Unicode 6.0.0 -- Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread Marco Buttu
On 05/17/2012 09:32 PM, Marco wrote: Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Marco It's ok, I found that they don't have a nu

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread Marco Buttu
On 05/18/2012 05:42 PM, jmfauth wrote: Non official but really practical: http://www.fileformat.info/info/unicode/index.htm Very well ordered, thanks -- Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing array from java to python

2011-06-03 Thread Marco Nawijn
On Jun 2, 11:54 am, loial wrote: > I need to pass some sort of array or hashmap from Java and read the > data in a python script (which will be called by the java class). Is > there any neater way  to do this other than just passing strings? I recently had to deal with the same problem, some bi-d

Re: losing-end-of-row values when manipulating CSV input

2011-07-13 Thread Marco Nawijn
s on how to fix this issue? > > Many thanks in advance, > > Neil Berg > >  csv_test.py > 1KViewDownload > >  csv_sample.csv > < 1KViewDownload Dear Neil, Don't know if this is a double post (previous post seems to be gone), but val = val.rstrip('\\') should fix your problem. Note the double backslash. Kind regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: losing-end-of-row values when manipulating CSV input

2011-07-13 Thread Marco Nawijn
ions on how to fix this issue? > > Many thanks in advance, > > Neil Berg > >  csv_test.py > 1KViewDownload > >  csv_sample.csv > < 1KViewDownload Hello Neil, I just had a quick look at your script. To remove the trailing "\" you can use val = val.rstrip('\\') in your script. Note the double backslash. The script now returns 24 items in the hour_list. Good luck! Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: Tree structure

2011-07-26 Thread Marco Nawijn
nterface you need, like traversing from parent to children and back. In addition, you get querying capabilities like XPATH for free. In python I recommend lxml. Your task than is to fill the tree based on the information in the database. The ORM functionality from sqlalchemy will be of help here. In addition, you somehow have to populate the QT tree with the data from your in-memory XML representation. I have no experience with QT so I cannot help you there. Regards, Marco -- http://mail.python.org/mailman/listinfo/python-list

Re: debugging segfaults in pythen PyQt (QWebview)

2011-03-04 Thread Marco Bizzarri
This applies to debugging a spinning Zope server, but I think you can adapt the suggestions to your core dump: http://www.upfrontsystems.co.za/Members/jean/zope-notes/debug-spinning-zope Regards Marco On Thu, Mar 3, 2011 at 10:40 AM, Gelonida wrote: > Hi, > > I have a QWebview ap

In List Query -> None Case Sensitive?

2011-03-31 Thread Wehe, Marco
if iFile in media: filePath = os.path.join(root, iFile) result.append(filePath) return result for filePath in FindMedia(path): log(filePath) This is the real file name that I can't find: Li

Suggestions on programming in Python an email simple client

2018-02-13 Thread Maroso Marco
Hi, what i'm trying to do is develop my own email client, but a simple one. I just want it to connect to a specific email account and read the subject line of messages coming from a certain email address. I then want it to be able to execute the command i wrote on the subject. It would be nice

Re: Suggestions on programming in Python an email simple client

2018-02-13 Thread Maroso Marco
Il giorno martedì 13 febbraio 2018 21:18:37 UTC+1, Chris Angelico ha scritto: > On Wed, Feb 14, 2018 at 7:05 AM, Maroso Marco wrote: > > Hi, > > > > what i'm trying to do is develop my own email client, but a simple one. > > > > I just want it to connect to

Re: Suggestions on programming in Python an email simple client

2018-02-15 Thread Maroso Marco
Il giorno martedì 13 febbraio 2018 21:06:19 UTC+1, Maroso Marco ha scritto: > Hi, > > what i'm trying to do is develop my own email client, but a simple one. > > I just want it to connect to a specific email account and read the subject > line of messages coming from

How to transform this as a service

2018-02-20 Thread Maroso Marco
Hi everyone, i need this program to run as a service. This program basically check an email account (gmail) and looks if there is mail from a specific email account, then reads the subject line and splits the text found assigning the left part (before the ; ) to the password, and the right part

Re: How to transform this as a service

2018-02-20 Thread Maroso Marco
Il giorno martedì 20 febbraio 2018 23:42:27 UTC+1, Maroso Marco ha scritto: > Hi everyone, i need this program to run as a service. > > This program basically check an email account (gmail) and looks if there is > mail from a specific email account, then reads the subject line and s

Re: Is there are good DRY fix for this painful design pattern?

2018-02-26 Thread marco . nawijn
(self, k) except AttributeError: print('*** error: attribute {} does not exist.'.format(k)) setattr(self, k, v) d = Demo() print(d.a) d.foo(a=3.14) print(d.a) d.foo(q='this will raise') So, use the inspect module to detect the va

Re: Suggestion for Linux Distro (from PSA: Linux vulnerability)

2022-04-18 Thread Marco Sulla
On Sat, 16 Apr 2022 at 17:14, Peter J. Holzer wrote: > > On 2022-04-16 16:49:17 +0200, Marco Sulla wrote: > > Furthermore, you didn't answer my simple question: why does the > > security update package contain metadata about Debian patches, if the > > Ubuntu secur

tail

2022-04-23 Thread Marco Sulla
What about introducing a method for text streams that reads the lines from the bottom? Java has also a ReversedLinesFileReader with Apache Commons IO. -- https://mail.python.org/mailman/listinfo/python-list

Re: Receive a signal when waking or suspending?

2022-04-23 Thread Marco Sulla
I don't know in Python, but maybe you can create a script that writes on a named pipe and read it from Python? https://askubuntu.com/questions/226278/run-script-on-wakeup -- https://mail.python.org/mailman/listinfo/python-list

Re: tail

2022-04-23 Thread Marco Sulla
On Sat, 23 Apr 2022 at 20:59, Chris Angelico wrote: > > On Sun, 24 Apr 2022 at 04:37, Marco Sulla > wrote: > > > > What about introducing a method for text streams that reads the lines > > from the bottom? Java has also a ReversedLinesFileReader with Apac

Re: tail

2022-04-23 Thread Marco Sulla
n". When it find it, it stops and do a readline(): def tail(filepath): """ @author Marco Sulla @date May 31, 2016 """ try: filepath.is_file fp = str(filepath) except AttributeError: fp = filepath with open(fp, "

Re: tail

2022-04-24 Thread Marco Sulla
On Sat, 23 Apr 2022 at 23:18, Chris Angelico wrote: > Ah. Well, then, THAT is why it's inefficient: you're seeking back one > single byte at a time, then reading forwards. That is NOT going to > play nicely with file systems or buffers. > > Compare reading line by line over the file with readline

Re: tail

2022-04-24 Thread Marco Sulla
On Sun, 24 Apr 2022 at 00:19, Cameron Simpson wrote: > An approach I think you both may have missed: mmap the file and use > mmap.rfind(b'\n') to locate line delimiters. > https://docs.python.org/3/library/mmap.html#mmap.mmap.rfind > Ah, I played very little with mmap, I didn't know about this.

Re: tail

2022-04-24 Thread Marco Sulla
on code! > If I understand Marco correctly, what he want is to read the lines from > bottom to top, i.e. tac instead of tail, despite his subject. > I use tail very frequently too, but tac is something I almost never use. > Well, the inverse reader is only a secondary suggestion

Re: tail

2022-05-01 Thread Marco Sulla
Something like this is OK? import os def tail(f): chunk_size = 100 size = os.stat(f.fileno()).st_size positions = iter(range(size, -1, -chunk_size)) next(positions) chunk_line_pos = -1 pos = 0 for pos in positions: f.seek(pos) chars = f.read(chunk_si

  1   2   3   4   5   6   7   8   >