Re: authentication with python-ldap

2013-05-25 Thread Dieter Maurer
Jorge Alberto Diaz Orozco wrote at 2013-5-25 14:00 -0400: >I have been doing the same thing and I tried to use java for testing the >credentials and they are correct. It works perfectly with java. >I really don´t know what we´re doing wrong. Neither do I. But the error message definitely origina

Re: Strange threading behaviour

2012-06-21 Thread Dieter Maurer
Rotwang writes: > Hi all, I'm using Python 2.7.2 on Windows 7 and a module I've written > is acting strangely. I can reproduce the behaviour in question with > the following: > > --- begin bugtest.py --- > > import threading, Tkinter, os, pickle > > class savethread(threading.Thread): > def _

Re: A question on os.path.join in POSIX systems

2012-06-22 Thread Dieter Maurer
Kushal Das writes: > There is a comment on posixpath.join saying "Ignore the previous parts > if a part is absolute." It means: "join(something, abspath) == abspath" whenever "abspath" is an absolute path. > Is this defined in the POSIX spec ? If yes, then can someone please > point me to a li

Re: Can't understand python C apis

2012-06-23 Thread Dieter Maurer
gmspro writes: > I'm trying to understand the source code of python and how it works > internally. > But i can't understand the python C apis. Usually, you try to understand the Python C api in order to write extensions for Pyth

Re: Is there any way to decode String using unknown codec?

2012-06-28 Thread Dieter Maurer
howmuchisto...@gmail.com writes: > I'm a Korean and when I use modules like sys, os, &c, > sometimes the interpreter show me broken strings like > '\x13\xb3\x12\xc8'. > It mustbe the Korean "alphabet" but I can't decode it to the rightway. > I tried to decode it using codecs like cp949,mbcs,utf-8

Re: Using a CMS for small site?

2012-07-05 Thread Dieter Maurer
Gilles writes: > The site is just... > - a few web pages that include text (in four languages) and pictures > displayed in a Flash slide show > - a calendar to show availability > - a form to send e-mail with anti-SPAM support > - (ASAP) online payment > > Out of curiosity, are there CMS/framewor

Re: adding a simulation mode

2012-07-05 Thread Dieter Maurer
andrea crotti writes: > I'm writing a program which has to interact with many external > resources, at least: > - mysql database > - perforce > - shared mounts > - files on disk > > And the logic is quite complex, because there are many possible paths to > follow depending on some other parameter

Re: Question about weakref

2012-07-05 Thread Dieter Maurer
Frank Millman writes: > I have a situation where I thought using weakrefs would save me a bit > of effort. Instead of the low level "weakref", you might use a "WeakKeyDictionary". -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about weakref

2012-07-05 Thread Dieter Maurer
Frank Millman writes: > On 05/07/2012 10:46, Dieter Maurer wrote: >> Instead of the low level "weakref", you might use a "WeakKeyDictionary". >> > > Thanks, Dieter. I could do that. > > In fact, a WeakSet suits my purposes better. I tested it with my

Re: adding a simulation mode

2012-07-12 Thread Dieter Maurer
andrea crotti wrote at 2012-7-12 14:20 +0100: >One thing that I don't quite understand is why some calls even if I >catch the exception still makes the whole program quit. >For example this > >try: >copytree('sjkdf', 'dsflkj') >Popen(['notfouhd'], shell=True) >except Excepti

Re: howto do a robust simple cross platform beep

2012-07-14 Thread Dieter Maurer
Steven D'Aprano writes: >> How do others handle simple beeps? >> >> I just want to use them as alert, when certain events occur within a >> very long running non GUI application. > > Why? Do you hate your users? I, too, would find it useful -- for me (although I do not hate myself). Surely, you

Re: [OT] Simulation Results Managment

2012-07-14 Thread Dieter Maurer
moo...@yahoo.co.uk writes: > ... > Does pickle have any advantages over json/yaml? It can store and retrieve almost any Python object with almost no effort. Up to you whether you see it as an advantage to be able to store objects rather than (almost) pure data with a rather limited type set. Of

Re: A thread import problem

2012-07-19 Thread Dieter Maurer
Bruce Sherwood writes: > I'm trying to do something rather tricky, in which a program imports a > module that starts a thread that exec's a (possibly altered) copy of > the source in the original program, and the module doesn't return. > This has to do with an attempt to run VPython in the Mac Co

Re: properly catch SIGTERM

2012-07-19 Thread Dieter Maurer
Eric Frederich writes: > ... > This seems to work okay but just now I got this while hitting ctrl-c > It seems to have caught the signal at or in the middle of a call to > sys.stdout.flush() > --- Caught SIGTERM; Attempting to quit gracefully --- > Traceback (most recent call last): >   File "/hom

Re: A thread import problem

2012-07-21 Thread Dieter Maurer
Bruce Sherwood writes: > ... > from visual import box, rate > b = box() > while True: > rate(100) # no more than 100 iterations per second > b.pos.x += .01 > > This works because a GUI environment is invoked by the visual module > in a secondary thread (written mainly in C++, connected to

Re: A thread import problem

2012-07-21 Thread Dieter Maurer
Bruce Sherwood writes: > Thanks much for this suggestion. I'm not sure I've correctly > understood the operation "start_new_thread(lambda: __import__( module>), ())". By "your module" do you mean the user program which > imported the module that will execute start_new_thread? By "your_module", I

Re: A thread import problem

2012-07-21 Thread Dieter Maurer
Bruce Sherwood writes: > ... > The failure of this test case suggests that one cannot do imports > inside secondary threads started in imported modules, something I keep > tripping over. But I hope you'll be able to tell me that I'm doing > something wrong! As you know multiple threads can be dan

Re: Sudden doubling of nearly all messages

2012-07-21 Thread Dieter Maurer
Dave Angel writes: > Has anybody else noticed the sudden double-posting of nearly all > messages in the python mailing list? I am reading this list via "gmane" and do not see any double postings. -- http://mail.python.org/mailman/listinfo/python-list

Re: A thread import problem

2012-07-23 Thread Dieter Maurer
Bruce Sherwood writes: > ... > There's nothing wrong with the current VPython architecture, which > does use good style, but there are two absolute, conflicting > requirements that I have to meet. > > (1) The simple program API I've shown must be preserved, because there > exist a large number of

Re: Daemon loses __file__ reference after a while.

2012-07-24 Thread Dieter Maurer
"ivdn...@gmail.com" writes: > I have a daemon process that runs for a considerable amount of time (weeks on > end) without any problems. At some point I start getting the exception: > > Exception info: Traceback (most recent call last): > File "scheduler.py", line 376, in applyrule > resul

Re: simplified Python parsing question

2012-07-30 Thread Dieter Maurer
"Eric S. Johansson" writes: > When you are sitting on or in a name, you look to the left or look to > the right what would you see that would tell you that you have gone > past the end of that name. For example > > a = b + c > > if you are sitting on a, the boundaries are beginning of line and =,

Re: PyPI question, or, maybe I'm just stupid

2012-07-30 Thread Dieter Maurer
Chris Gonnerman writes: > I've been making some minor updates to the PollyReports module I > announced a while back, and I've noticed that when I upload it to > PyPI, my changelog (CHANGES.txt) doesn't appear to be integrated into > the site at all. Do I have to put the changes into the README,

Re: [Python] Re: PyPI question, or, maybe I'm just stupid

2012-07-30 Thread Dieter Maurer
Chris Gonnerman writes: > On 07/30/2012 04:20 AM, Dieter Maurer wrote: > ... >> I find it very stupid to see several window scrolls of changes for >> a package but to learn how to install the package, I have to download its >> source... > Not sure I get this. The

Re: conditional running of code portion

2012-08-06 Thread Dieter Maurer
Serhiy Storchaka writes: > On 05.08.12 09:30, Steven D'Aprano wrote: >> If you are working in a tight loop, you can do this: >> >> if VERBOSE_FLAG: >> for item in loop: >> print(DEBUG_INFORMATION) >> do_actual_work(item) >> else: >> for item in loop: >> do_act

Re: Beautiful Soup Table Parsing

2012-08-08 Thread Dieter Maurer
Tom Russell writes: > I am parsing out a web page at > http://online.wsj.com/mdc/public/page/2_3021-tradingdiary2.html?mod=mdc_pastcalendar > using BeautifulSoup. > > My problem is that I can parse into the table where the data I want > resides but I cannot seem to figure out how to go about grab

Re: Threads and sockets

2012-08-10 Thread Dieter Maurer
loial writes: > I am writing an application to send data to a printer port(9100) and then > recieve PJL responses back on that port. Because of the way PJL works I have > to do both in the same process(script). > > At the moment I do not start to read responses until the data has been sent > t

Re: Running Python web apps on shared ASO servers?

2012-08-11 Thread Dieter Maurer
Gilles writes: > ... > Support replied this in an old thread: "Just a CGI option. We don't > have enough users to justify adding mod_python support." > http://forums.asmallorange.com/topic/4672-python-support/page__hl__python > http://forums.asmallorange.com/topic/4918-python-fcgi-verses-mod-pyth

Re: python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'

2012-08-15 Thread Dieter Maurer
Dmitry Arsentiev writes: > Has anybody already meet the problem like this? - > AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' > > When I run scrapy, I get > > File "/usr/local/lib/python2.7/site-packages/scrapy/selector/factories.py", > line 14, in > libxml2.HTML_PAR

Re: SSLSocket.getpeercert() doesn't return issuer, serial number, etc

2012-08-15 Thread Dieter Maurer
Gustavo Baratto writes: > SSL.Socket.getpeercert() doesn't return essential information present in the > client certificate (issuer, serial number, not before, etc), and it looks it > is by design: > > > > http://docs.python.org/library/ssl.html#ssl.SSLSocket.getpeercert > > http://hg.python.org/

Re: Can I get logging.FileHandler to close the file on each emit?

2012-08-30 Thread Dieter Maurer
rikardhul...@gmail.com writes: > I use logging.FileHandler (on windows) and I would like to be able to delete > the file while the process is running and have it create the file again on > next log event. > > On windows (not tried linux) this is not possible because the file is locked > by the

Re: Are the property Function really useful?

2012-08-30 Thread Dieter Maurer
writes: > Are the property Function really useful? Someone invested time to implement/document/test it. Thus, there are people who have use cases for it... > Where can i use the property function? You can use it when you have parameterless methods which you want to access as if they were simpl

Re: sockets,threads and interupts

2012-09-04 Thread Dieter Maurer
loial writes: > I have threaded python script that uses sockets to monitor network ports. > > I want to ensure that the socket is closed cleanly in all circumstances. This > includes if the script is killed or interupted in some other way. The operating system should close all sockets automatic

Re: Why derivated exception can not be pickled ?

2012-09-04 Thread Dieter Maurer
Mathieu Courtois writes: > Here is my example : > > > import cPickle > > ParentClass = object # works > ParentClass = Exception # does not > > class MyError(ParentClass): > def __init__(self, arg): > self.arg = arg > > def __getstate__(self): > print '#DBG pass in get

Re: [web] Long-running process: FCGI? SCGI? WSGI?

2012-09-05 Thread Dieter Maurer
Gilles writes: > To write a long-running web application, I'd like to some feedback > about which option to choose. > > Apparently, the choice boilds down to this: > - FastCGI > - SCGI > - WSGI > > It seems like FCGI and SCGI are language-neutral, while WSGI is > Python-specific. > > Besides that

Re: How to implement a combo Web and Desktop app in python.

2012-09-13 Thread Dieter Maurer
Shawn McElroy writes: > ... > So I need to find a way I can implement this in the best way... It is in general very difficult to say reliable things about the "best" way. Because, that depends very much on details. My former employer has created a combo destop/online application based on "Zope"

Re: Decorators not worth the effort

2012-09-13 Thread Dieter Maurer
> On Sep 14, 3:54 am, Jean-Michel Pichavant > wrote: >> I don't like decorators, I think they're not worth the mental effort. Fine. I like them because they can vastly improve reusability and drastically reduce redundancies (which I hate). Improved reusability and reduced redundancies can make a

Re: How to implement a combo Web and Desktop app in python.

2012-09-14 Thread Dieter Maurer
Shawn McElroy writes: > ... > Although you are correct in the aspect of having 'real' OS level integration. > Being able to communicate with other apps as well as contextual menus. > Although, could I not still implement those features from python, into the > host system from python? There are

Re: Decorators not worth the effort

2012-09-15 Thread Dieter Maurer
Dwight Hutto wrote at 2012-9-14 23:42 -0400: > ... >Reduce redundancy, is argumentative. > >To me, a decorator, is no more than a logging function. Correct me if >I'm wrong. Well, it depends on how you are using decorators and how complex your decorators are. If what you are using as decorating fu

Re: Decorators not worth the effort

2012-09-18 Thread Dieter Maurer
Jean-Michel Pichavant writes: > - Original Message - >> Jean-Michel Pichavant wrote: > [snip] >> One minor note, the style of decorator you are using loses the >> docstring >> (at least) of the original function. I would add the >> @functools.wraps(func) >> decorator inside your decorator

Re: python application file format

2012-09-26 Thread Dieter Maurer
Benjamin Jessup writes: > ... > What do people recommend for a file format for a python desktop > application? Data is complex with 100s/1000s of class instances, which > reference each other. > > ... > Use cPickle with a module/class whitelist? (Can't easily port, not > entirely safe, compact en

Re: Private methods

2012-10-10 Thread Dieter Maurer
alex23 writes: > On 10 Oct, 17:03, real-not-anti-spam-addr...@apple-juice.co.uk (D.M. > Procida) wrote: >> It certainly makes it quick to build a class with the attributes I need, >> but it does make tracing logic sometimes a pain in the neck. >> >> I don't know what the alternative is though. >

Re: serialization and versioning

2012-10-12 Thread Dieter Maurer
Neal Becker writes: > I wonder if there is a recommended approach to handle this issue. > > Suppose objects of a class C are serialized using python standard pickling. > Later, suppose class C is changed, perhaps by adding a data member and a new > constructor argument. > > It would see the pi

Re: deque and thread-safety

2012-10-12 Thread Dieter Maurer
Christophe Vandeplas writes: > ... > From the documentation I understand that deques are thread-safe: >> Deques are a generalization of stacks and queues (the name is pronounced >> “deck” >> and is short for “double-ended queue”). Deques support thread-safe, memory >> efficient appends and pops

Re: problems with xml parsing (python 3.3)

2012-10-28 Thread Dieter Maurer
janni...@gmail.com writes: > I am new to Python and have a problem with the behaviour of the xml parser. > Assume we have this xml document: > > > > > Title of the first book. > > > > Title of the second book. > > > > > If I now chec

Re: Applying a paid third party ssl certificate

2012-11-04 Thread Dieter Maurer
ehsmenggro...@gmail.com writes: > I haven't quite figured out how to apply a paid ssl cert, say RapidSSL free > SSL test from Python's recent sponsor sslmatrix.com and what to do with that > to make Python happy. > > This good fellow suggests using the PEM format. I tried and failed. > http://www

Re: Python garbage collector/memory manager behaving strangely

2012-11-14 Thread Dieter Maurer
a...@pythoncraft.com (Aahz) writes: > ... def readlines(f): lines = [] while "f is not empty": line = f.readline() if not line: break if len(line) > 2 and line[-2:] == '|\n': lines.append(lin

Re: Getting "empty" attachment with smtplib

2012-11-14 Thread Dieter Maurer
Tobiah writes: > I just found out that the attachment works fine > when I read the mail from the gmail website. Thunderbird > complains that the attachment is empty. The MIME standard (a set of RFCs) specifies how valid messages with attachments should look like. Fetch the mail (unprocessed if

Re: error importing smtplib

2012-11-16 Thread Dieter Maurer
Eric Frederich writes: > I created some bindings to a 3rd party library. > I have found that when I run Python and import smtplib it works fine. > If I first log into the 3rd party application using my bindings however I > get a bunch of errors. > > What do you think this 3rd party login could be

Re: error importing smtplib

2012-11-17 Thread Dieter Maurer
Eric Frederich writes: > ... > So I'm guessing the problem is that after I log in, the process has a > conflicting libssl.so file loaded. > Then when I try to import smtplib it tries getting things from there and > that is where the errors are coming from. > > The question now is how do I fix

Re: Stack_overflow error

2012-11-20 Thread Dieter Maurer
Aung Thet Naing writes: > I'm having Stack_overflow exception in _ctypes_callproc (callproc.c). The > error actually come from the: > > cleanup: > for (i = 0; i < argcount; ++i) > Py_XDECREF(args[i].keep); > > when args[i].keep->ob_refCnt == 1 Really a stack overflow or a general s

Re: Suitable software stacks for simple python web service

2012-11-21 Thread Dieter Maurer
Kev Dwyer writes: > I have to build a simple web service which will: > > - receive queries from our other servers > - forward the requests to a third party SOAP service > - process the response from the third party > - send the result back to the original requester > > From the point of view

Re: deepcopy questions

2012-11-28 Thread Dieter Maurer
lars van gemerden writes: > ... "deepcopy" dropping some items ... > Any ideas are still more then welcome, "deepcopy" is implemented in Python (rather than "C"). Thus, if necessary, you can debug what it is doing and thereby determine where the items have been dropped. -- http://mail.python.or

Re: os.system and subprocess odd behavior

2012-12-14 Thread Dieter Maurer
py_genetic writes: > Example of the issue for arguments sake: > > Platform Ubuntu server 12.04LTS, python 2.7 > > Say file1.txt has "hello world" in it. ^ Here, you speak of "file1.txt" (note the extension ".txt") > subprocess.Popen("cat < file1 > file2", shell = True) > subprocess

Re: need some help with unexpected signal exception when using input from a thread (Pypy 1.9.0 on osx/linux)

2012-12-15 Thread Dieter Maurer
Irmen de Jong writes: > Using Pypy 1.9.0. Importing readline. Using a background thread to get > input() from > stdin. It then crashes with: > > File "/usr/local/Cellar/pypy/1.9/lib_pypy/pyrepl/unix_console.py", line > 400, in restore > signal.signal(signal.SIGWINCH, self.old_sigwinch) >

Re: problems importing from /usr/lib/pyshared/

2013-01-11 Thread Dieter Maurer
Harold writes: > I recently upgraded my system from ubuntu 11.4 to 12.4 and since run into an > issue when trying to import several packages in python2.7, e.g. > > harold@ubuntu:~$ python -c 'import gtk' > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.7/d

Re: Dependency management in Python?

2013-01-11 Thread Dieter Maurer
Adelbert Chang writes: > In the Scala language there is the Simple Build Tool that lets me specify on > a project-by-project basis which libraries I want to use (provided they are > in a central repository somewhere) and it will download them for me. Better > yet, when a new version comes out

Re: strace of python shows nonsense

2013-01-14 Thread Dieter Maurer
Joep van Delft writes: > ... > What puzzles me, is the amount of errors for open and stat64. The high number of errors comes from Python's import logic: when Python should import a module/package (not yet imported), it looks into each member on "sys.path" for about 6 different potential filename

Re: Using pdb with greenlet?

2012-06-13 Thread Dieter Maurer
Salman Malik writes: > I am sort of a newbie to Python ( have just started to use pdb). > My problem is that I am debugging an application that uses greenlets and when > I encounter something in code that spawns the coroutines or wait for an event, > I lose control over the application (I mean th

Re: validating XML

2012-06-13 Thread Dieter Maurer
andrea crotti writes: > Hello Python friends, I have to validate some xml files against some xsd > schema files, but I can't use any cool library as libxml unfortunately. Why? It seems not very rational to implement a complex task (such as XML-Schema validation) when there are ready solutions ar

Re: validating XML

2012-06-14 Thread Dieter Maurer
andrea crotti writes: > ... > The reason is that it has to work on many platforms and without any c module > installed, the reason of that Searching for a pure Python solution, you might have a look at "PyXB". It has not been designed to validate XML instances against XML-Schema (but to map betw

Re: Hashable object with self references OR how to create a tuple that refers to itself

2012-06-15 Thread Dieter Maurer
"Edward C. Jones" writes: > I am trying to create a collection of hashable objects, where each > object contains references to > other objects in the collection. The references may be circular. > > To simplify, one can define > x= list() > x.append(x) > which satisfies x == [x]. > Can I

Re: Komodo, Python

2012-06-16 Thread Dieter Maurer
"Isaac@AU" writes: > I just started learning python. I have komodo2.5 in my computer. And I > installed python2.7. I tried to write python scripts in komodo. But every > time I run the code, there's always the error: > > Traceback (most recent call last): > File "C:\Program Files\ActiveState

Re: Problem with ImapLib and subject in French

2012-06-18 Thread Dieter Maurer
Valentin Mercier writes: > I'm trying to search some mails with SUBJECT criteria, but the problem is the > encoding, I'm trying to search french terms (impalib and python V2.7) > > I've tried few things, but I think the encoding is the problem, in my mail > header I have something like this: > >

Re: Issue sending data from C++ to Python

2022-05-19 Thread Dieter Maurer
Pablo Martinez Ulloa wrote at 2022-5-18 15:08 +0100: >I have been using your C++ Python API, in order to establish a bridge from >C++ to Python. Do you know `cython`? It can help very much in the implementation of bridges between Python and C/C++. -- https://mail.python.org/mailman/listinfo/pytho

Re: traceback Shows path to my python libraries

2022-06-21 Thread Dieter Maurer
jsch...@sbcglobal.net wrote at 2022-6-20 13:49 -0500: >I coded an application with a 64-bit executable using cython with the embed >option and gcc and I received a traceback showing the path to my python >installation. Is that normal or does that mean the application is going >outside of my execut

Re: Logging into single file from multiple modules in python when TimedRotatingFileHandler is used

2022-06-22 Thread Dieter Maurer
Chethan Kumar S wrote at 2022-6-21 02:04 -0700: > ... >I have a main process which makes use of different other modules. And these >modules also use other modules. I need to log all the logs into single log >file. Due to use of TimedRotatingFileHandler, my log behaves differently after >midnight

Re: argparse modify

2022-06-23 Thread Dieter Maurer
נתי שטרן wrote at 2022-6-23 15:31 +0300: >how to solve this (argparse) > > >traceback: >Traceback (most recent call last): > File "u:\oracle\RTR.py", line 10, in >class sre_constants(): > File "u:\oracle\RTR.py", line 77, in sre_constants >MAXREPEAT = _NamedIntConstant(32,name=str(32)) >

Re: argparse modify

2022-06-23 Thread Dieter Maurer
נתי שטרן wrote at 2022-6-24 08:28 +0300: >I copied code from argparse library and modified it > >בתאריך יום חמישי, 23 ביוני 2022, מאת Dieter Maurer : > >> נתי שטרן wrote at 2022-6-23 15:31 +0300: >> >how to solve this (argparse) >> > >> > >&g

Re: Fwd: timedelta object recursion bug

2022-07-28 Thread Dieter Maurer
Ben Hirsig wrote at 2022-7-28 19:54 +1000: >Hi, I noticed this when using the requests library in the response.elapsed >object (type timedelta). Tested using the standard datetime library alone >with the example displayed on >https://docs.python.org/3/library/datetime.html#examples-of-usage-timedel

Re: Fwd: timedelta object recursion bug

2022-07-28 Thread Dieter Maurer
Please stay on the list (such that others can help, too) Ben Hirsig wrote at 2022-7-29 06:53 +1000: >Thanks for the replies, I'm just trying to understand why this would be >useful? > >E.g. why does max need a min/max/resolution, and why would these attributes >themselves need a min/max/resolution

Re: Register multiple excepthooks?

2022-08-01 Thread Dieter Maurer
Albert-Jan Roskam wrote at 2022-7-31 11:39 +0200: > I have a function init_logging.log_uncaught_errors() that I use for > sys.excepthook. Now I also want to call another function (ffi.dlclose()) > upon abnormal termination. Is it possible to register multiple > excepthooks, like with atexit

Re: Trying to understand nested loops

2022-08-05 Thread Dieter Maurer
ojomooluwatolami...@gmail.com wrote at 2022-8-5 08:34 +0100: >Hello, I’m new to learning python and I stumbled upon a question nested loops. For future, more complex, questions of this kind, you might have a look at the module `pdb` in Python's runtime library. It implements a debugger which allow

RE: Parallel(?) programming with python

2022-08-10 Thread Dieter Maurer
Schachner, Joseph (US) wrote at 2022-8-9 17:04 +: >Why would this application *require* parallel programming? This could be >done in one, single thread program. Call time to get time and save it as >start_time. Keep a count of the number of 6 hour intervals, initialize it to >0. You c

Re: Parallel(?) programming with python

2022-08-11 Thread Dieter Maurer
Dennis Lee Bieber wrote at 2022-8-10 14:19 -0400: >On Wed, 10 Aug 2022 19:33:04 +0200, "Dieter Maurer" > ... >>You could also use the `sched` module from Python's library. > >Time to really read the library reference manual again... > >

Re: setup.py + cython == chicken and the egg problem

2022-08-17 Thread Dieter Maurer
Dan Stromberg wrote at 2022-8-16 14:03 -0700: > ... >I'm attempting to package up a python package that uses Cython. > ... > Installing build dependencies ... error > error: subprocess-exited-with-error > > ×? pip subprocess to install build dependencies did not run successfully. > ?? exit code

Re: Superclass static method name from subclass

2022-11-11 Thread Dieter Maurer
Ian Pilcher wrote at 2022-11-11 10:21 -0600: >Is it possible to access the name of a superclass static method, when >defining a subclass attribute, without specifically naming the super- >class? > >Contrived example: > > class SuperClass(object): > @staticmethod > def foo(): >

Re: Dealing with non-callable classmethod objects

2022-11-11 Thread Dieter Maurer
Ian Pilcher wrote at 2022-11-11 15:29 -0600: > ... >In searching, I've found a few articles that discuss the fact that >classmethod objects aren't callable, but the situation actually seems to >be more complicated. > > >>> type(DuidLLT._parse_l2addr) > > >>> callable(DuidLLT._parse_l2addr) >True >

Re: Importlib behaves differently when importing pyd file

2022-11-16 Thread Dieter Maurer
Jach Feng wrote at 2022-11-15 22:52 -0800: >My working directory d:\Works\Python\ has a package 'fitz' looks like this: > >fitz\ >__init__.py >fitz.py >utils.py >_fitz.pyd > >There is a statement in fitz.py: >return importlib.import_module('fitz._fitz') > >It

Re: pip issue

2022-11-30 Thread Dieter Maurer
Gisle Vanem wrote at 2022-11-30 10:51 +0100: >I have an issue with 'pip v. 22.3.1'. On any >'pip install' command I get warning like this: > c:\> pip3 install asciinema > WARNING: Ignoring invalid distribution -arkupsafe > (f:\gv\python310\lib\site-packages) > WARNING: Ignoring invalid distr

Re: ContextVars in async context

2022-12-21 Thread Dieter Maurer
Marce Coll wrote at 2022-12-20 22:09 +0100: >Hi python people, hope this is the correct place to ask this! > >For a transactional async decorator I'm building I am using contextvars in >order to know when a transaction is open in my current context. > >My understanding is that if given the followi

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Dieter Maurer
Antoon Pardon wrote at 2022-12-27 14:25 +0100: > ... >> But a simple "sys.modules['threading'] = QYZlib.threaders" will work. >> Of course, how *well* this works depends also on how well that module >> manages to masquerade as the threading module, but I'm sure you've >> figured that part out :) >

Re: Python - working with xml/lxml/objectify/schemas, datatypes, and assignments

2023-01-04 Thread Dieter Maurer
aapost wrote at 2023-1-3 22:57 -0500: > ... >Consider the following: > >from lxml import objectify, etree >schema = etree.XMLSchema(file="path_to_my_xsd_schema_file") >parser = objectify.makeparser(schema=schema, encoding="UTF-8") >xml_obj = objectify.parse("path_to_my_xml_file", parser=parser) >xm

Re: hello can I be in your group?

2023-01-07 Thread Dieter Maurer
Keith Thompson wrote at 2023-1-6 17:02 -0800: >September Skeen writes: >> I was wondering if I could be in your group > >This is an unmoderated Usenet newsgroup. In fact, there are several access channels, Usenet newsgroup is one of them. Another channel is the python-list mailing list. You can

Re: Mailing-Lists (pointer)

2023-01-10 Thread Dieter Maurer
Chris Green wrote at 2023-1-10 08:45 +: > ... >Yes, this is important I think. Plus, if possible, if it's decided to >move to a forum format make that accessible by E-Mail. I much prefer a mailing list over an http based service. With mailing lists, all interesting messages arrive in my email

Re: Mailing-Lists (pointer)

2023-01-11 Thread Dieter Maurer
Cameron Simpson wrote at 2023-1-11 08:37 +1100: > ... >There's a Discourse forum over at discuss.python.org. I use it in >"mailing list mode" and do almost all my interactions via email, exactly >as I do for python-list. Posts come to me and land in the same local >mail folder I use for python-list

Re: Python - working with xml/lxml/objectify/schemas, datatypes, and assignments

2023-01-11 Thread Dieter Maurer
aapost wrote at 2023-1-10 22:15 -0500: >On 1/4/23 12:13, aapost wrote: >> On 1/4/23 09:42, Dieter Maurer wrote: >> ... >>> You might have a look at `PyXB`, too. >>> It tries hard to enforce schema restrictions in Python code. >> ... >Unfortunately picking

Re: [Help Request] Embedding Python in a CPP Application Responsibly & Functionally

2023-01-26 Thread Dieter Maurer
John McCardle wrote at 2023-1-25 22:31 -0500: > ... >1) To get the compiled Python to run independently, I have to hack >LD_LIBRARY_PATH to get it to execute. `LD_LIBRARY_PATH=./Python-3.11.1 >./Python-3.11.1/python` . The need to set `LD_LIBRARY_PATH` usually can be avoided via a link time option

Re: asyncio questions

2023-01-26 Thread Dieter Maurer
Frank Millman wrote at 2023-1-26 12:12 +0200: >I have written a simple HTTP server using asyncio. It works, but I don't >always understand how it works, so I was pleased that Python 3.11 >introduced some new high-level concepts that hide the gory details. I >want to refactor my code to use these co

Re: File write, weird behaviour

2023-02-19 Thread Dieter Maurer
Azizbek Khamdamov wrote at 2023-2-19 19:03 +0500: > ... >Example 2 (weird behaviour) > >file = open("D:\Programming\Python\working_with_files\cities.txt", >'r+') ## contains list cities ># the following code DOES NOT add new record TO THE BEGINNING of the >file IF FOLLOWED BY readline() and readlin

Re: semi colonic

2023-02-23 Thread Dieter Maurer
Thomas Passin wrote at 2023-2-22 21:04 -0500: >On 2/22/2023 7:58 PM, avi.e.gr...@gmail.com wrote: > ... >> So can anyone point to places in Python where a semicolon is part of a best >> or even good way to do anything? > >Mostly I use it to run small commands on the command line with python >-c. e

Look free ID genertion (was: Is there a more efficient threading lock?)

2023-03-01 Thread Dieter Maurer
Chris Angelico wrote at 2023-3-1 12:58 +1100: > ... > The >atomicity would be more useful in that context as it would give >lock-free ID generation, which doesn't work in Python. I have seen `itertools.count` for that. This works because its `__next__` is implemented in "C" and therefore will not

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

2023-03-06 Thread Dieter Maurer
aapost wrote at 2023-3-5 09:35 -0500: > ... >If a file is still open, even if all the operations on the file have >ceased for a time, the tail of the written operation data does not get >flushed to the file until close is issued and the file closes cleanly. This is normal: the buffer is flushed if

Re: Problem in using libraries

2023-04-04 Thread Dieter Maurer
Pranav Bhardwaj wrote at 2023-4-3 22:13 +0530: >Why can't I able to use python libraries such as numpy, nudenet, playsound, >pandas, etc in my python 3.11.2. It always through the error "import >'numpy' or any other libraries could not be resolved". The "libraries" you speak of are extensions (i.e

Re: Embedded python is not 100% stable

2023-04-13 Thread Dieter Maurer
Guenther Sohler wrote at 2023-4-13 09:40 +0200: > ... >I have been working on adding embedded python into OpenSCAD ( >www.openscad.org) >for some time already. For that i coded/added an additional Python Type >Object >which means to hold openscad geometric data. > >It works quite well but unfortuna

Re: Using loguru in a library

2023-05-02 Thread Dieter Maurer
Roy Hann wrote at 2023-4-30 15:40 -: >Is there anyone using loguru (loguru 0.5.3 in my case) successfully in a >library? > ... > import mylib > logger.enable('mylib') > >expecting that it would report any log messages above level DEBUG, just >as it does when I don't disable logging. Have you

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Dieter Maurer
Chris Green wrote at 2023-5-6 15:58 +0100: >Chris Green wrote: >> I'm having a real hard time trying to do anything to a string (?) >> returned by mailbox.MaildirMessage.get(). >> >What a twit I am :-) > >Strings are immutable, I have to do:- > >newstring = oldstring.replace("_", " ") The sol

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-10 Thread Dieter Maurer
Horst Koiner wrote at 2023-5-9 11:13 -0700: > ... >For production i run the program with stdout=subprocess.PIPE and i can fetch >than the output later. For just testing if the program works, i run with >stdout=subprocess.STDOUT and I see all program output on the console, but my >program afterwa

Re: "Invalid literal for int() with base 10": is it really a literal?

2023-05-26 Thread Dieter Maurer
Chris Angelico wrote at 2023-5-26 18:29 +1000: > ... >However, if you want to change the wording, I'd be more inclined to >synchronize it with float(): > float("a") >Traceback (most recent call last): > File "", line 1, in >ValueError: could not convert string to float: 'a' +1 -- https://m

Re: SMS API

2021-02-03 Thread Dieter Maurer
ismail nagi wrote at 2021-2-3 08:48 -0800: >I would like to know how an sms api is created. I assume that "sms api" means that your Python application should be able to send SMS messages. In this case, you need a service which interfaces between your device (mobile phone, computer, tablet, ...) an

Re: SMS API

2021-02-03 Thread Dieter Maurer
ismail nagi wrote at 2021-2-3 21:06 +0300: >Yes, its about sending messages. For example, something like >twilio...it's an SMS API, can something like twilio be created using python >and how (just a basic idea)? Thank You. "twilio" provides a web service interface to send messages. You can use Pyt

  1   2   3   4   >