Re: Python C API: How to debug reference leak?

2016-09-28 Thread dieter
dl l writes: > Thanks for reply. Is there any function in C to get the reference objects > of a object? I want to debug where are referencing the object. Depending on your understanding of "reference objects", this would be "gc.get_referents" or "gc.get_referrers". Of course, those are not "C"

Re: Python C API: How to debug reference leak?

2016-09-28 Thread dieter
dl l writes: > When I debug in C++, I see the reference count of a PyObject is 1. I don't > know where is referencing this object. How can I find out where is > referencing this object? Likely, it is the reference, you are holding: typically, whenever you can access a Python object, this object

Re: Is there a way to change the closure of a python function?

2016-09-28 Thread dieter
Peng Yu writes: > Hi, In many other functional language, one can change the closure of a > function. Is it possible in python? I do not think so: the corresponding attributes/types ("__closure__", "cell") are explicitely designed to be read only. However, I never missed closure changebility. Sho

Re: Why searching in a set is much faster than in a list ?

2016-09-28 Thread dieter
"ast" writes: > ... > I noticed that searching in a set is faster than searching in a list. A "set" is actually similar to a degenerated "dict". It is using hashing to quickly access its content which could give you (amortized asymptotically) contant runtime. With a list, you iterate over its ele

Re: SOAP XML webserver in Python/Django

2016-09-29 Thread dieter
ivan77 writes: > I currently have a need to setup a webserver on one of our internal servers > that is going to send and receive XML SOAP responses to an external company > through a VPN. > > It seems like something that I could use python (maybe even Django) for. > However, even though I ha

Re: [py 2.7] JSON and UTF-8

2016-09-29 Thread dieter
Gilmeh Serda writes: > Is there something that can be done when writing JSON using its dump/ > dumps feature so, e.g. Cyrillic text will show up correctly in a text > editor afterwards? > ... > The 'template.json' contains this: > > { > "test": "øæßþåнайтеĦŒŒ®®®" > } > > What the json module

Re: Assignment versus binding

2016-10-04 Thread dieter
Steve D'Aprano writes: > On Mon, 3 Oct 2016 04:15 pm, Jussi Piitulainen wrote: >> Steve D'Aprano writes: >>> Why shouldn't people say that binding and assignment are the same >>> thing in Python? What's the difference? >> >> Outside Python, (lambda x : f(x)) is said to "bind" x. It's different >>

Re: Assignment versus binding

2016-10-05 Thread dieter
Rustom Mody writes: > On Tuesday, October 4, 2016 at 12:47:58 PM UTC+5:30, dieter wrote: > ... >> On the other hand, one can model Python variables as bindings >> where language constructs (assignments) allow to change the binding. >> >> Thus, at an appropriate lev

Re: 'str' object has no attribute 'intersection' and unhashable set

2016-10-05 Thread dieter
meInvent bbird writes: ... not looking at the details ... "'str' object has not attribute 'intersection'": apparently, something is really a string (an 'str') while you expect it to be a set. "unhashable set": maybe, you try to put a set into another set (or a dict; or somewhere else where hasha

Re: 'str' object has no attribute 'intersection' and unhashable set

2016-10-06 Thread dieter
meInvent bbird writes: > ... > is there any algorithm tutorials or books or external library that > can have a better result for finding repeated lines as group in grouping > application I do not yet understand your problem (and still am not ready to look at your code). When I need grouping for

Re: segfault using shutil.make_archive

2016-10-06 Thread dieter
Tim writes: > I need to zip up a directory that's about 400mb. > I'm using shutil.make_archive and I'm getting this response: > > Segmentation fault: 11 (core dumped) > > The code is straightforward (and works on other, smaller dirs): > > shutil.make_archive(os.path.join(zip_dir, zname), '

Re: define variables in the txt file using python

2016-10-07 Thread dieter
Xristos Xristoou writes: > i have one .txt file and i want to create python script with sys.argv or > argparse or other package to define some variables in the txt file and i take > some result. > > txt file maybe like this : > > input number 1= %var1% > input number 2= %var2% > result = %vresul

Re: Signals and Threads in Python 3.5 or so

2016-10-10 Thread dieter
Dan Stromberg writes: > I have a program http://stromberg.dnsalias.org/~dstromberg/looper/ > that I use and maintain. > > It's like GNU parallel or similar - yet another "run n processes, m at > a time" implementation. Interestingly, I've only used/tested it on > Linux, but it's under a Microsoft

Re: how to send a json of yield list

2016-10-13 Thread dieter
meInvent bbird writes: > after google a several solutions, > First method i searched has memory error > sock.send(json.dumps(StreamArray())) > Traceback (most recent call last): > File "pusher.py", line 43, in > sock.send(json.dumps(StreamArray())) > ... > MemoryError "MemoryError" means

Re: how to use pycallgraph in ubuntu and window?

2016-10-14 Thread dieter
meInvent bbird writes: > i install in ubunbu 14 > > pip install graphviz > pip install pycallgraph > > martin@ubuntu:~/Downloads$ pycallgraph graphviz -- ./pusher.py > Traceback (most recent call last): > ... > pycallgraph.exceptions.PyCallGraphException: The command "dot" is required to > be in

Re: Internet Data Handling » mailbox

2016-10-22 Thread dieter
Adam Jensen writes: > ... > https://docs.python.org/2.7/library/mailbox.html#examples > > import mailbox > for message in mailbox.mbox('~/mbox'): > subject = message['subject'] # Could possibly be None. > if subject and 'python' in subject.lower(): > print subject > > What is

Re: lxml and xpath(?)

2016-11-02 Thread dieter
Doug OLeary writes: > ... > Any hints/tips/suggestions greatly appreciated especially with complete noob > tutorials for xpath. You can certainly do it with "XPath" (look for the "following-sibling" axis). You can also use Python (with "lxml"). If you have an element "e", then "e.getnext()" giv

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-06 Thread dieter
"Mr. Wrobel" writes: > ... > However the same skeptics told my that, ok we believe that it is true, > however the code execution is much slower than any other compiled > language. However, in many cases "code execution speed" is not the primary concern. In my experience, "development speed" is fa

Re: Reporting a Bug

2016-11-12 Thread dieter
Vidyalakshmi Rao writes: > ... > *Issue: Spyder hangs in instances while iterating over a list containing > rows with nothing in it.* > > > for eachinfo in range(len(textlist)): #remove non-ASCII characters from > the textlist > textlist[eachinfo] = re.sub(r'[^\x00-\x7F]+','', textlist

Re: exit ThreadPoolExecutor immediately

2016-11-15 Thread dieter
Atul Johri writes: > I am looking for a way to stop a ThreadPoolExecutor immediately under the > assumption that I don't care about what's currently running or pending. > > ``` > limit = 2 > executor = ThreadPoolExecutor(10) > posts = itertools.islice(mygen(executor=executor, **kwargs), 0, limit)

Re: __debug__ http://stackoverflow.com/questions/15305688/conditional-debug-statement-not-executed-though-debug-is-true

2016-11-16 Thread dieter
Veek M writes: > Trying to make sense of that article. My understanding of debug was > simple: > 1. __debug__ is always True, unless -O or -OO > 2. 'if' is optimized out when True and the expr is inlined. > > So what does he mean by: > > 1. 'If you rebind __debug__, it can cause symptoms' > 2. '

Re: Can signal.alarm be safely cleared in python?

2016-11-18 Thread dieter
Pedro Franco de Carvalho writes: > Assume a python program sets a handler function for the > `signal.SIGALRM` signal, and then schedules an alarm in T seconds with > `signal.alarm(T)`. > > Assume the program later cancels any scheduled alarm with `signal.alarm(0)`. I do not think so. You might h

Re: Question about working with html entities in python 2 to use them as filenames

2016-11-23 Thread dieter
Steven Truppe writes: > type= title = Wizo - Anderster Full Album - YouTube > type= title = Wizo - Bleib Tapfer / für'n Arsch Full > Album - YouTube > Traceback (most recent call last): > File "./music-fetcher.py", line 39, in > title = HTMLParser.HTMLParser().unescape(title) > File

Re: K-means Python code analyse

2016-11-23 Thread dieter
Alex writes: > Can please anyone explaine me what do each of these code lines and how > k-means algorithm works? How about searching "wikipedia"? (--> "https://en.wikipedia.org/wiki/K-means_clustering";). -- https://mail.python.org/mailman/listinfo/python-list

Re: Options for stdin and stdout when using pdb debugger

2016-11-24 Thread dieter
Robert Snoeberger writes: > I would like to use pdb in an application where it isn't possible to use > sys.stdin for input. I've read in the documentation for pdb.Pdb that a file > object can be used instead of sys.stdin. Unfortunately, I'm not clear about > my options for the file object. L

Re: Name mangling vs qualified access to class attributes

2016-12-14 Thread dieter
paoli...@gmail.com writes: > The official Python tutorial at > > https://docs.python.org/3/tutorial/classes.html#private-variables > > says that "name mangling is helpful for letting subclasses override methods > without breaking intraclass method calls" and makes an interesting example: > > clas

Re: timers in threaded application

2017-01-13 Thread dieter
Skip Montanaro writes: > ... > I still need timers, and for the moment I'm stuck with this package's event > loop. What options do I have? If the activities are really run in separate threads (such that an event processing can take arbitrary time without much affecting the processing of other eve

Re: timers in threaded application

2017-01-14 Thread dieter
Skip Montanaro writes: > On Fri, Jan 13, 2017 at 3:23 AM, dieter wrote: > >> If what you want to timeout are not I/O operations, you can have a >> look at "threading.Timer". It uses a separate thread, lets it wait >> a specified time and then starts a specif

Re: Running Virtualenv with a custom distlib?

2017-01-14 Thread dieter
haraldnordg...@gmail.com writes: > I want to do some development on `distlib`, and in the process run the code > via `virtualenv` which has distlib as a dependency. > > That is, not run the process inside a virtualenv, but run virtualenv's code > using a custom dependency. What are the steps I n

Re: Announcement: TLSv1.2 will become mandatory in the future for Python.org Sites

2017-01-14 Thread dieter
oliver writes: > When I run this per email from my work laptop, > > python3 -c "import urllib.request,json; > print(json.loads(urllib.request.urlopen(' > https://www.howsmyssl.com/a/check').read())['tls_version'])" > > I get the following traceback: > ... > File "c:\Python35\lib\ssl.py", line 633

Re: ipython2 does not work anymore

2017-01-20 Thread dieter
Cecil Westerhof writes: > ... >> If you do mean 'pathlib', it was introduced in Python 3.4. > > It is about python2. I can remember to have seen announcements for enhanced "path" modules in this list. Your previously posted traceback shows that the problem comes from the package "pickleshare" whi

Re: python corrupted double-linked list error

2017-01-20 Thread dieter
Xristos Xristoou writes: > i am a python 2.7 and ubuntu 16.04 user. While analysing a problem upgrading to Ubuntu 16.04 (unrelated to Python) I found messages reporting about a problem with Python an Ubuntu 16.04[.0] (leading to memory corruption - something you are seeing). The proposed solutio

Re: Problems with python3.6 on one system, but OK on another

2017-01-23 Thread dieter
Cecil Westerhof writes: > I build python3.6 on two systems. On one system everything is OK: > Python 3.6.0 (default, Jan 21 2017, 11:19:56) > [GCC 4.9.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > > > But on another I get: > Could not find platform depend

Re: Is it possible to get the Physical memory address of a variable in python?

2017-01-24 Thread dieter
Sourabh Kalal writes: > how we can access the value from using id.. > like x=10 > id(x) > 3235346364 > > how i can read value 10 using id 3235346364 You should not do this (read the value instead by looking at "x") -- unless you are debugging at "C" level. For "C" level debugging, there is a set

Re: Why doesn't module finalization delete names as expected?

2017-02-02 Thread dieter
Philippe Proulx writes: > ... > It feels like `bread` is never deleted in the module initialization > situation, but I don't know why: the only reference to the Bread Python > object is this `bread` name in the module... what could prevent this > object's __del__() method to be called? It works wh

Re: Which part of the loop is it going through in this class frame?

2018-03-07 Thread dieter
C W writes: > I am new to OOP. I'm a bit confused about the following code. > > class Clock(object): > def __init__(self, time): > self.time = time > def print_time(self): > time = '6:30' > print(self.time) > > clock = Clock('5:30') > clock.print_time() > 5:30 > > I

Re: Module Issue

2018-03-08 Thread dieter
Abdur-Rahmaan Janhangeer writes: > i have a project at > > https://github.com/Abdur-rahmaanJ/honeybot > > see https://github.com/Abdur-rahmaanJ/honeybot/tree/master/honeybot > > my question is : > > how to include a util file / module that can be imported in both > core_plugins and > user_plugins?

Re: socket: Did I find a bug?

2018-03-08 Thread dieter
Antoon Pardon writes: > This is on a debian 9 box python 2.7.13 > > My interpretation is that a timeout exception is thrown and that the > args attribute of such an exception is an empty tuple which then causes > an IndexError in line 482 of module /usr/lib/python2.7/socket.py. Does > that soundpl

Re: Unnoticed traceback in a thread

2018-03-08 Thread dieter
Skip Montanaro writes: > I have a program which is almost always running in a single thread. It > uses a daemon thread (via threading.Timer) to periodically checkpoint > some state. The program runs for days at a time. > > Over the past couple days, two instances of the subthread croaked with > t

Re: Question regarding objects in __call__() methods

2018-03-25 Thread dieter
Arshpreet Singh writes: > ... > As debugging the code I got at line 10. I am sending a request to particular > API and returning a request_object . further deep down it generates the > "response_object" as from my requirements that should be JSON object but I am > only getting Python-Object in

Re: A question related to the PYTHONPATH

2018-03-25 Thread dieter
adrien oyono writes: > I have recently read the documentation about how imports work on python, > and I was wondering why, when you execute a python file, the current > directory is not added by default to the PYTHONPATH ? Maybe, to avoid surprises? You can invoke a script from different positio

Re: A question related to the PYTHONPATH

2018-03-26 Thread dieter
oyono writes: > ... > I was thinking, maybe it could have been done this way to enforce not running > module files that are supposed to be bundled into packages as "independant" > python scripts...Therefore, running "python script.py" should be reserved to > effectively independant python scrip

Re: please test the new PyPI (now in beta)

2018-03-27 Thread dieter
Tim Golden writes: > ... > In either case, talking about it > here seems fruitless. Someone asked for feedback here. At least he should look for it here. -- https://mail.python.org/mailman/listinfo/python-list

Re: condition.acquire vs lock.acquire

2018-03-27 Thread dieter
jayshankar nair via Python-list writes: > Is condition.acquire(threading.Condition()) similar to > lock.acquire(threading.Lock). Does both of get access to the lock. Can i use > condition.wait,notify with lock.acquire or i have to use condition.wait, > notify with condition.acquire. > cond.acqu

Re: Distributing Python virtual environments

2018-03-29 Thread dieter
Malcolm Greene writes: > We're using virtual environments with Python 3.6. Since all our pip > installed modules are in our environment's local site-packages folder, > is the distribution of a virtual environment as simple as recursively > zipping the environment's root folder and distributing th

Re: permission denied when installing tensorflow on centos 7

2018-04-30 Thread dieter
joseph pareti writes: > here are details on my attempt: > ... > [joepareti54@xxx tensorflow_tmpdir]$ pip3 install --upgrade virtualenv >> > step3.txt 2>&1 > [joepareti54@xxx tensorflow_tmpdir]$ cat step3.txt > Collecting virtualenv > Downloading > https://files.pythonhosted.org/packages/ed/ea/e2

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-03 Thread dieter
Chris Angelico writes: > ... > Somewhere, you have a mismatch of versions. Make sure you're using the > same Python version for everything. You have some Python 2.7 messing > up your 3.5. I have had similar problems. In my case, an active "PYTHONPATH" envvar was responsible -- "unset"ting this en

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-05 Thread dieter
joseph pareti writes: > thank you for the advice: depending on the value of PYTHONPATH (version > 2.7, 3.5, or unset), tensorflow stops with 3 different error traps "PYTHONPATH" usually is used when you have private Python modules not installed at the standard place. Nowadays, you can use a so ca

Re: ImportError: cannot import name _remove_dead_weakref

2018-05-06 Thread dieter
joseph pareti writes: > thanks for the hint, virtualenv looks like an interesting option, however > in my case I need to rely on several components that are already installed > in the VM in Azure, including tensorflow, etc. > If I use virtualenv, do I need to start from scratch? "virtualenv" has

Re: spurious BadDrawable error when running test_tk

2018-05-14 Thread dieter
Matthias Kievernagel writes: > I changed some detail in the tkinter library, > so I'm running the tk test like this: > > ./python -m test -u gui -v test_tk > > Approximately every 2 or 3 runs I get a BadDrawable error > from the X server, most of the time at the end after > the last test finished

Re: Request for comments: use-cases for delayed evaluation

2018-05-17 Thread dieter
Steven D'Aprano writes: > Suppose Python had a mechanism to delay the evaluation of expressions > until needed. What would you use it for? Delayed evaluation is some form of "lazy evaluation": evaluate an expression (only) at the time, it is needed (maybe for the first time). The avocates of "

Re: Package DLL or SO in wheel

2018-05-17 Thread dieter
Chris Nyland writes: > We have several internal modules we have developed that are used mostly to > read different types of data files. Most of the time the different data > file formats come with some sort of DLL or SO files that gives a standard > interface to read the files. Our design pattern

Re: decorat{or,ion}

2018-05-18 Thread dieter
Mike McClain writes: > Let's say I want something that does most or all of foo's > functionality plus a little more and maybe tweek some of foo's > output, so I write a wrapper around foo and call it bar. > If inside bar are the call to foo, as well as methods baz(), > buz() and bug() that mak

Re: decorat{or,ion}

2018-05-21 Thread dieter
Mike McClain writes: > ... > Thanks for the response, this is still a foreign language to me and I > need all > the help I can get. I'm reading the docs, doing the tutorial again but > still have > more questions than answers. > If I understand what you said, 'taint neces

Re: Python 3.6 causes error, python 3.5 does not.

2018-05-21 Thread dieter
Jim writes: > ... > The problem is it runs fine if I use python 3.5. If I use python 3.6 > it opens the calc file then pops up a dialog saying > "std::bad_alloc". This looks like a C++ error message -- maybe from "calc". It also looks quite severe (some memory allocation problem). Therefore, it

Re: Spam levels.

2018-05-22 Thread dieter
"Peter J. Holzer" writes: > ... > I didn't read on Gmane. I read on my usenet server. But the broken > messages were all coming from Gmane. I am reading with an NNTP client connected to the Gmane NNTP server and and threading works - with very rare exceptions. The exeptions are so rare, that they

Re: Getting Unicode decode error using lxml.iterparse

2018-05-22 Thread dieter
digi...@gmail.com writes: > I'm trying to read my iTunes library in Python using iterparse. My current > stub is: > ... > My input file (reduced to home in on the error) is: > > snip - > > > > > > 15078 > > NamePart 2. The Deat

Re: convert a string to a variable

2018-05-24 Thread dieter
bruceg113...@gmail.com writes: > I am trying to convert a string to a variable. > > I got cases 1 & 2 to work, but not cases 3 & 4. > > The print statement in cases 3 & 4 reports the following: > builtins.AttributeError: type object 'animal' has no attribute 'tiger' > > I am stuck on crea

Re: cProfile, timed call tree

2018-05-25 Thread dieter
Nico Schlömer writes: > From what I understand about the Python profilers, the type of information > you get from a stats object is > > * How much time was spent in function X, > * what the callers and callees of function X are, and > * and bunch of meta info about function X. > > With the

Re: cProfile, timed call tree

2018-05-29 Thread dieter
"Peter J. Holzer" writes: > On 2018-05-26 07:38:09 +0200, dieter wrote: >> But, in general, you are right: you cannot reconstruct complete >> call trees. The reason is quite simple: maintaining information >> for the complete caller ancestry (rather than j

Re: What is the "Unpacking Arguments List" rule?

2018-06-12 Thread dieter
Jach Fong writes: > ... > 4.7.4. Unpacking Argument Lists > The reverse situation occurs when the arguments are already in a list or > tuple but need to be unpacked for a function call requiring separate > positional arguments. > ... args = [3, 6] list(range(*args)) > """ > > I can't

Re: Splitting up large python module impact on performance?

2018-06-12 Thread dieter
Bill Deegan writes: > I'm doing some refactoring on a fairly large python codebase. > Some of the files are > 4000 lines long and contain many classes. I am typically working with systems consisting of hundreds of modules (Zope/Plone). Such large systems have a significant impact on startup time

Re: python lmfit.minimizer not working

2018-06-13 Thread dieter
Priya Singh writes: > Dear All, > > I am trying to fit a spectrum using a power law model. I am using > lmfit.minimizer. You are asking a question about a specific module ("lmfit") not part of the Python standard library. You might get better help from a different audience (one closer to "lmfit

Re: How to find an object existing?

2018-06-13 Thread dieter
huey.y.ji...@gmail.com writes: > root = Tkinter.Tk() > button = Tkinter.Button(root, text="Find me") > button.pack() > > I created a button, Python object. I recall I can check this object existing > by using winfo, such as winfo.exists(button). However, I forgot which > super class contains t

Re: XSD data mapper lib

2018-06-17 Thread dieter
Nagy László Zsolt writes: > I wonder what kind of XSD <-> Python class mapper should I use for my > project. I am using "PyXB" for this kind of tasks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Writing an assembler in Python

2018-06-19 Thread dieter
iansuder...@gmail.com writes: > What does the code look like to insert assembler into python and how does > that code send information back to python. Python is a "high level" language: it tries hard to hide many "low level" details such as addresses and memory management. Thus, it is quite far

Re: I lost nearly all my modules installing 3.7

2018-06-29 Thread dieter
Elliott Roper writes: > ... > install scipy wrote an error message longer than War and Peace that finished > with:- > > error: library dfftpack has Fortran sources but no Fortran compiler found An error message of the t

Re: I lost nearly all my modules installing 3.7

2018-07-01 Thread dieter
Elliott Roper writes: > ... > I should have mentioned that none of this went wrong in 3.6. All I'm after > are packages I can install with pip3. I really don't need to go down all the > twisty passages installing Fortran "pip[*]" is a tool to install Python packages. But some Python packages ar

Re: logging module

2018-07-01 Thread dieter
Sharan Basappa writes: > I am trying to use logging module and somehow I cannot make it work. > > A simple code that I am trying is below. The commented code line 5,6 are > other options I have tried but don't work > > #importing module > import logging > > #Create and configure logger > #loggi

Re: Python 3.7 configuration issue

2018-07-03 Thread dieter
Robin Becker writes: > On a Ubuntu trusty system I ran > ./configure --prefix=/home/rptlab/PYTHON > make && make install > and get an error related to the ctypes module not being importable. > > I needed to do > > sudo apt-get install libffi-dev > ./configure --prefix=/home/rptlab/PYTHON --with-s

Re: Python 3.7 configuration issue

2018-07-04 Thread dieter
Robin Becker writes: > ... > I don't disagree with the above. I think the issue is that the > configure process did not say anything about this. If ctypes is > required and cannot be built then ./configure .. should probably > tell me; if that's not possible then the make step should do so and

Re: logging from time critical tasks -- QueueListener().stop() takes the whole CPU

2018-07-15 Thread dieter
Gerlando Falauto writes: > ... > Why is the main thread taking up so much CPU? > I believe at this point listener.stop() should only be waiting for the helper > thread to terminate, which I reckon would be implemented by waiting on a > semaphore or something (i.e. iowait i.e. 0% CPU). Maybe, yo

Re: test for absence of infinite loop

2018-07-17 Thread dieter
Robin Becker writes: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do something like call an external proc

Re: functions vs methods

2018-07-21 Thread dieter
Sharan Basappa writes: > Is there a difference between functions and methods in Python. Somewhat simplified: a method is a function with the method's associated object implicitly passed as first argument. For a Python defined method "m", you can get the corresponding function via "m.__func__" (

Re: import in code

2018-07-21 Thread dieter
Abdur-Rahmaan Janhangeer writes: > i have found some reputable books that include import within code > > with ... > import x > > if ... > import y > > def ... > import z > > according to me they should be placed at the top. but an advantage of it is > optimisation where you only load

Re: `import somemodule` does not check all paths in `sys.path`

2018-07-29 Thread dieter
stefand...@gmail.com writes: > ... > The "story" is: In homeassistant (short HA) some modules are installed at > runtime during first start ("bootstrapping"), and for some reason loading the > modules fails directly after installing the modules. Subsequent starts work > fine. > > The modules tha

Re: asyncio: Warning message when waiting for an Event set by AbstractLoop.add_reader

2018-08-02 Thread dieter
Léo El Amri via Python-list writes: > ... > WARNING:asyncio:Executing took 1.000 seconds > ... > But there is still this warning... At your place, I would look at the code responsible for the warning. I assume that it is produced because the waiting time is rather high -- but this is just a gue

Re: right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-13 Thread dieter
iMath writes: > ... > It seems possible in Python to use `zipimport` to directly use the zip > archive of the module without extraction, I wonder what is the right way to > use `zipimport`. Your problem may come from the following restriction (cited from the Python 2 documentation of `zipimport

Re: right way to use zipimport, zipimport.ZipImportError: not a Zip file

2018-08-14 Thread dieter
iMath writes: > ... > I think someone gives the true reason caused the exception here > https://stackoverflow.com/a/51821910/1485853 > > Thanks to his explanation , I extracted the zip archive and then add the > extracted to a zip archive using Bandizip, this time > `zipimport.zipimporter(r'C:

Re: lxml namespace as an attribute

2018-08-15 Thread dieter
Skip Montanaro writes: > Much of XML makes no sense to me. Namespaces are one thing. If I'm > parsing a document where namespaces are defined at the top level, then > adding namespaces=root.nsmap works when calling the xpath method. I > more-or-less get that. > > What I don't understand is how I'm

Re: Python Information Form

2018-08-19 Thread dieter
Suman Mupparapu writes: > Working on a creating a small information form ..and encountering issues > when trying to edit the details using Python Flask and MYSQL DB. > > Placed the code below for your reference. Please help to fix this issue. > Let me know if you need any other details from my end

Re: Connection refused when tryign to run bottle/flask web framweworks

2018-08-19 Thread dieter
Νίκος writes: > i just installed bottle and flask web frameworks in my CentOS environment but > i canno get it working even with the simpleste xample. The coonection is > refused always. "connection refused" is an indication that there is no (running) server at the connection port. Unlike simp

Re: Connection refused when tryign to run bottle/flask web framweworks

2018-08-20 Thread dieter
Νίκος writes: > ... > The weird thing is that in my vps command line my hello app is in state of > listening > > [root@superhost public_html]# python3 app.py > Bottle v0.12.13 server starting up (using WSGIRefServer())... > Listening on http://localhost:8080/ > Hit Ctrl-C to quit. > > So, i wond

Re: Python 3.6 Logging time is not listed

2018-08-20 Thread dieter
Keep Secret writes: > On Monday, 13 August 2018 19:42:57 UTC+2, Léo El Amri wrote: >> On 13/08/2018 19:23, MRAB wrote: >> > Here you're configuring the logger, setting the name of the logfile and >> > the logging level, but not specifying the format, so it uses the default >> > format: >> > >> >

Re: problem with json.dumps / complexjson.loads in python 3.4 virtualenv

2018-09-04 Thread dieter
"M. Fioretti" writes: > I have an error in a python application that I installed. I already > opened an issue about it on the application page at github, but I > would also greatly appreciate any help to (at least) better debug the > problem, because I urgently need to use that program. > > Detail

Re: Error installing libraries

2018-09-04 Thread dieter
Gilmeh Serda writes: > On Mon, 03 Sep 2018 12:40:49 +0530, ojas gupta wrote: > >> error: Microsoft Visual C++ 14.0 is required. > > Wonder why it doesn't work? At least, the error message is clear: the process needs "Microsoft Visual C++ 14.0". It is installed on your computer? -- https://mail

Re: OpenSSL error

2018-09-06 Thread dieter
Peng Yu writes: > ... > from OpenSSL import rand, crypto, SSL > File > "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/SSL.py", > line 118, in > SSL_ST_INIT = _lib.SSL_ST_INIT > AttributeError: 'module' object has no attribute 'SSL_ST_INIT' That

Re: on rasberry pi 3 python 2.7 , trying to run code on geckodriver with selenium and getting error

2018-09-10 Thread dieter
alon.naj...@gmail.com writes: > on rasberry pi 3 python 2.7 , trying to run code on geckodriver with selenium > and getting an error the Firefox browser is opened automatically :) it just > don't work I'm not getting the stock value on the print BTW it works on my PC > with ChromeDriver - > > T

Re: logging module - how to include method's class name when using %(funcName)

2018-09-10 Thread dieter
Malcolm Greene writes: > I'm using the Python logging module and looking for a way to include a > method's class name when using %(funcName). Is this possible? If it does not happen automatically, the standard logging components will not let you do it (the name "funcName" is rather explicit; you

Re: Sending file to the user gives UnicodeEncodeError in Flask framework

2018-09-12 Thread dieter
> On Wed, 12 Sep 2018 06:57:36 -0700, Νίκος Βέργος wrote: >> I want to send the user a file when he clicks the appropriate button and >> I'm suing the following. >> >> # Prepare selected file for download... >> send_file( '/home/nikos/wsgi/static/files/' + filename ) >> >> But no matter

Re: python 3.7 - I try to close the thread without closing the GUI is it possible?

2018-09-14 Thread dieter
alon.naj...@gmail.com writes: > python 3.7 - I try to close the thread without closing the GUI is it > possible? I assume that with "close a thread" you mean "terminate a thread". It is difficult to terminate a thread from the outside, because on many platforms, there is no reliable way to term

Re: giving error during installation (ez_setup.py given error could not create ssl/tls secure channel)

2018-09-17 Thread dieter
Syed Shujaat writes: > can you please help regarding this problem. ez_setup.py given error could not > create ssl/tls secure channel Apparently, "ez_setup.py" tries to upgrade a transport communication channel with SSL (= "Secure Socket Layer") or TLS (= "Transport Layer Security") and fails. U

Re: How to achieve pyc only deployment for module in python3.6

2018-10-01 Thread dieter
Chandana Pattanayak writes: > I have a requirement to provide basic code protection for a module in our > product suite. With python 3.6 the .pyc files are created under pycache , > so if i remove the py file the module is not found anymore. One approach could be to define and register your own

Re: How to achieve pyc only deployment for module in python3.6

2018-10-01 Thread dieter
dieter writes: > Chandana Pattanayak writes: >> I have a requirement to provide basic code protection for a module in our >> product suite. With python 3.6 the .pyc files are created under pycache , >> so if i remove the py file the module is not found anymore. >

Re: ESR "Waning of Python" post

2018-10-11 Thread dieter
Ben Finney writes: > ... > Is it your position that the described behaviour is not a problem? Do > you hold that position because you think multi-core machines are not a > sector that Python needs to be good at? Or that the described behaviour > doesn't occur? Or something else? Every system you

Re: Single DB connection during class's lifetime. Metaclass, singleton and __new__() examples and references.

2018-10-12 Thread dieter
Ryan Johnson writes: > I am working on using mysql.connector in a class and have found an example of > how to create a single connection that spans the lifetime of all instances of > the class: > > https://softwareengineering.stackexchange.com/a/358061/317228 > > however, I do not understand a

Re: ESR "Waning of Python" post

2018-10-12 Thread dieter
Marko Rauhamaa writes: > dieter : > ... >> I work in the domain of web applications. And I made there a nasty >> experience with garbage collection: occasionally, the web application >> stopped to respond for about a minute. A (quite difficult) analysis >> reveale

Re: ESR "Waning of Python" post

2018-10-14 Thread dieter
Marko Rauhamaa writes: > dieter : > ... >> Definitely. The application concerned was a long running web application; >> caching was an important feature to speed up its typical use cases. > > As an optimization technique, I suggest turning the cache into a "binary &

Re: ESR "Waning of Python" post

2018-10-15 Thread dieter
Marko Rauhamaa writes: > dieter : >> Marko Rauhamaa writes: >>> Keeping the number of long-term objects low is key. >> >> Right, if I need near realtime behaviour and must live >> with [C]Python's garbage collector. > > Or any other GC ever in

Re: Email parsing and unicode/utf8

2018-10-15 Thread dieter
Thomas Jollans writes: > I just stumbled over some curious behaviour of the stdlib email parsing > APIs which accept strings rather than bytes. It appears that you can't > parse an 8-bit UTF-8 message you have as a str without first encoding it. The primary purpose of an email parser is likely th

<    1   2   3   4   5   6   7   8   9   10   >