Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote: > > >> On 18 Feb 2019, at 08:49, Thomas Jollans wrote: >> >> Anaconda also has its moments, and has some packages that PyPI doesn't >> (for my use case, this is primarily PyQt5). > > Odd I use PyQt5 from PyPI

Re: What's up with Activestate Python?

2019-02-18 Thread Thomas Jollans
On 18/02/2019 10.21, Barry Scott wrote: > > >> On 18 Feb 2019, at 08:49, Thomas Jollans wrote: >> >> Anaconda also has its moments, and has some packages that PyPI doesn't >> (for my use case, this is primarily PyQt5). > > Odd I use PyQt5 from PyPI

Re: Feature suggestions: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-19 Thread Thomas Jollans
On 19/02/2019 05.15, mnl.p...@gmail.com wrote: > This becomes more ugly if multiple withs get nested. > This is what contextlib.ExitStack is for. -- https://mail.python.org/mailman/listinfo/python-list

Re: revisiting the "What am I running on?" question

2019-02-20 Thread Thomas Jollans
change it to "win-ia32", which > would parallel the 64-bit ABI name "win-amd64". I'm fairly sure "win32" was used on W9x as well. In any case it *was* correct at the time, as early versions of Python also ran on DOS and Windows 3.1. "windows

Re: Feature suggestion: "Using declarations" i.e. context managers ("with" blocks) tied to scope/lifetime of the variable rather than to nesting

2019-02-21 Thread Thomas Jollans
On 21/02/2019 19:35, mnl.p...@gmail.com wrote: > (I sent this a few days ago but got bounced without a reason—don’t see it > posted, so I’m trying one more time.) No, it got through. And it's in the archive: https://mail.python.org/pipermail/python-list/2019-February/739548.html -- https://mail

Re: Quirk difference between classes and functions

2019-02-26 Thread Thomas Jollans
On 25/02/2019 21.15, Chris Angelico wrote: > On Tue, Feb 26, 2019 at 6:58 AM DL Neil > wrote: >> >> On 26/02/19 5:25 AM, ast wrote: >>> I noticed a quirk difference between classes and functions >>> >>> x=0 >>> >>> class Test: >>> x = x+1 >>> print(x) >>> x = x+1 >>>

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
ython interpreter can't delete a local before having executed any statement that could *possibly* access it. If the inspect module's stack frame inspection machinery is supported, then any function call might access any local... (though I don't think a compliant Python implementation neces

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
mo! try: fun() except SystemExit: print("Oh no you don't!") Collect this: def fun(): f = os.open("lock", os.O_RDONLY) flock.flock(f, fcntl.LOCK_EX) do_stuff() os.kill(os.getpid(), 9) ;-) ⸺ Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Lifetime of a local reference

2019-02-27 Thread Thomas Jollans
llection or omit it altogether — it is a matter of > implementation quality how garbage collection is implemented, *as long > as no objects are collected that are still reachable*." (emphasis mine) > > In the original example (without del), f is reachable everywhere in the > function aft

Re: Version numbers in Standard Library

2019-03-03 Thread Thomas Jollans
On 01/03/2019 16:35, Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] via Python-list wrote: > Dear Python List, > > A question. I help maintain a Python stack for users in my division here > at NASA and one user asked about updating the re module to 2.4. I > believe because he re

Re: Totally Legit Signing Key?

2019-03-04 Thread Thomas Jollans
least knows this, seeing as he apparently cloned his own old (compromised) key: pub rsa1024 2014-06-16 [SCEA] [revoked: 2016-08-16] 2C7E264D238159CB07A3C350192720F7EA5BBD71 uid [ revoked] Barry A. Warsaw What I imagine happened here is that whoever exported the pubkeys.txt file di

Re: Configuring the REPL's tab completion

2019-03-11 Thread Thomas Jollans
on messing with tab completion? There's not a lot of info in > the rlcompleter module docs. I had a quick look at the code - rlcompleter sets itself as the completer <https://github.com/python/cpython/blob/master/Lib/rlcompleter.py#L200> using readline.set_completer <https://docs.python.org/3.6/library/readline.html#readline.set_completer> I imagine you could write your own completer, and call set_completer again after rlcompleter has been imported. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Convert Windows paths to Linux style paths

2019-03-12 Thread Thomas Jollans
On 12/03/2019 15.51, Malcolm Greene wrote: > Looking for best practice technique for converting Windows style paths to > Linux paths. Is there an os function or pathlib method that I'm missing or is > it some combination of replacing Windows path separators with Linux path > separators plus some

Re: uWISGI with Qt for Python

2019-03-14 Thread Thomas Jollans
h reasonable-sized 2d images. I expect that's your best option. Despite what the description says, it does PyQt5 as well as PyQt4. Best, - Thomas -- https://mail.python.org/mailman/listinfo/python-list

asyncio KeyboardInterrupt in select

2019-03-27 Thread Thomas Grainger
elect+fd_event_list+%3D+self._epoll.poll(timeout,+max_ev)+KeyboardInterrupt&filter=0 Thomas Grainger -- https://mail.python.org/mailman/listinfo/python-list

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
On 29/03/2019 11.10, Tony van der Hoff wrote: > and running it in a browser (tried both chrome and Firefox), How? > it fails as before: blank web page. No traceback? There must be a traceback somewhere. In a log file perhaps. -- https://mail.python.org/mailman/listinfo/python-list

Re: Jinja and non-ASCII characters (was Re: Prepare accented characters for HTML)

2019-03-29 Thread Thomas Jollans
gt; 3.5.3 (default, Sep 27 2018, 17:25:39) >>> [GCC 6.3.0 20170516] >>> >>> However, with a slight modification: >>> >>> #!/usr/bin/env python3 >>> >>> import sys >>> from jinja2 import Template >>> print ("Content-type: te

Re: A request for examples of successful abstracts to scientific python conferences

2019-04-03 Thread Thomas Jollans
On 03/04/2019 18:18, Manolo Martínez wrote: > Dear all, > > I am thinking of submitting an abstract to EuroSciPy 2019, but (although > I am an academic), I am not familiar with the conventions, do's and > don'ts of submissions to CS conferences, and this one in particular. > Would any kind reader

Re: Most "pythonic" syntax to use for an API client library

2019-04-29 Thread Thomas Jollans
On 29/04/2019 09.18, Peter Otten wrote: > Jonathan Leroy - Inikup via Python-list wrote: > >> Hi all, >> >> I'm writing a client library for a REST API. The API endpoints looks like >> this: /customers >> /customers/1 >> /customers/1/update >> /customers/1/delete >> >> Which of the following synta

Re: Most "pythonic" syntax to use for an API client library

2019-04-30 Thread Thomas Jollans
On 30/04/2019 09.52, Peter Otten wrote: > Thomas Jollans wrote: > >> On 29/04/2019 09.18, Peter Otten wrote: >>> Jonathan Leroy - Inikup via Python-list wrote: >>> alice.name = "Bob" # __setattr__ >>> >>> del customers[42] # __de

Re: EmailMessage and RFC 2047

2019-04-30 Thread Thomas Jollans
Parser(email.message.EmailMessage) >>> p.parsestr(msg)['Subject'] '=?utf-8?q?=C3=89lys=C3=A9e?=' >>> p = email.parser.Parser(email.message.EmailMessage, policy=email.policy.default) >>> p.parsestr(msg)['Subject'] 'Élysée' >>>

Re: PYTHON equivalents of BITAND and BITSHIFT of MATLAB

2019-05-01 Thread Thomas Jollans
On 02/05/2019 06:47, blmadha...@gmail.com wrote: > Hello Brian, > > Thanks for your suggestion. Which is correct for MATLAB command: typeBits = > FCF << -9? > > typeBits = FCF >> 9 > > or > > typeBits = FCF >> -9 > > I mean to ask if it should be -9 or +9? Why don't you just, you know, try

Re: Building a statically linked Python, and pip

2019-05-08 Thread Thomas Jollans
On 08/05/2019 03:18, Simon Michnowicz via Python-list wrote: > Dear Group, > I need to build a statically linked Python that has pip. What a curious thing to need. > I built a version following the instructions at > https://wiki.python.org/moin/BuildStatically > but pip was not present in the bin

Re: Using a Variable Inside the String

2019-05-10 Thread Thomas Jollans
On 07/05/2019 18.43, Rob Gaddi wrote: > This over here is my friend Bob.  What's 31 + 18 + Bob? That's Numberwang! -- https://mail.python.org/mailman/listinfo/python-list

Re: Why Python has no equivalent of JDBC of Java?

2019-05-20 Thread Thomas Jollans
iciently compatible, you can easily swap in one database for another. > > One example over all: Oracle. If you want to access an Oracle DB from > Python, you have to: If Oracle wants to be a pain in the arse, that's Oracle's doing. The open source databases aren't like th

Re: Questions about the IO modules and C-api

2019-06-02 Thread Thomas Jollans
rather than calling something in C directly, that would be in order to allow BufferedWriter to be used with different types of IO classes, not just files. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: How control a GUI for an unrelated application from a Python script?

2019-06-14 Thread Thomas Jollans
On 14/06/2019 01.49, Christian Seberino wrote: > I have a third party GUI that manages some hardware. > > I want to control the hardware from a Python script. Forget about the GUI, see if you can control your device without it. See how well the device is documented. Maybe there's an API? If not f

Re: python 2 to 3 conversion

2019-06-17 Thread Thomas Jollans
On 17/06/2019 15.14, Igor Korot wrote: > Hi, > Is there a place where there is a full list of incompatibilities between > python 2 and python 3 is available and how to fix them? ‘What’s new in Python 3.0’ is a good starting point https://docs.python.org/3/whatsnew/3.0.html It doesn’t list all st

Re: pip vs python -m pip?

2019-06-21 Thread Thomas Jollans
alled side-by-side, there can be a danger that you call the wrong 'pip' by accident. I don't think this should be a concern in a virtual environment though Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Plumbing behind super()

2019-06-28 Thread Thomas Jollans
On 28/06/2019 02:13, adam.pre...@gmail.com wrote: I'm trying to mimick Python 3.6 as a .NET science project and have started to get into subclassing. The super() not-a-keyword-honestly-guys has tripped me up. I have to admit that I've professionally been doing a ton Python 2.7, so I'm not good

Re: Do I need a parser?

2019-06-29 Thread Thomas Jollans
On 29/06/2019 14:39, josé mariano wrote: Dear all, I'm sure that this subject has been addressed many times before on this forum, but my poor knowledge of English and of computer jargon and concepts results on not being able to find the answer i'm looking for when I search the forum. So here

Re: Handle foreign character web input

2019-06-29 Thread Thomas Jollans
On 28/06/2019 22:25, Tobiah wrote: A guy comes in and enters his last name as RÖnngren. With a capital Ö in the middle? That's unusual. So what did the browser really give me; is it encoded in some way, like latin-1?  Does it depend on whether the name was cut and pasted from a Word doc. etc?

Re: Plumbing behind super()

2019-06-29 Thread Thomas Jollans
On 30/06/2019 01:15, adam.pre...@gmail.com wrote: Whoops. Now I need to figure out how the interpreter knows that change_a is a method and knows what self to feed it. I'm assuming that's in the cell variables similar to what super()'s doing as explained here. I haven't implemented cell variab

Re: Do I need a parser?

2019-07-02 Thread Thomas Jollans
On 01/07/2019 17:23, josé mariano wrote: > Dear All, > > Thank you very much for your valuable input. > Thanks Alan for your kind words. I'm not Spanish, I'm Portuguese, but I know > what you mean. > Thomas, I was able to track down the author but he is not willing t

Re: Multiprocessing and memory management

2019-07-04 Thread Thomas Jollans
On 03/07/2019 18.37, Israel Brewster wrote: > I have a script that benefits greatly from multiprocessing (it’s generating a > bunch of images from data). Of course, as expected each process uses a chunk > of memory, and the more processes there are, the more memory used. The amount > used per pr

Re: Matplotlib import image as float32

2019-07-05 Thread Thomas Jollans
image as an integer array. This uses the imageio module under the hood. OpenCV uses int8's for everything IIRC, but using that only makes sense if you also want its image processing functionality -- Thomas > > Thank you, > > Markos > >> import numpy as np >

Re: super or not super?

2019-07-12 Thread Thomas Jollans
On 12/07/2019 16.12, Paulo da Silva wrote: > Hi all! > > Is there any difference between using the base class name or super to > call __init__ from base class? There is, when multiple inheritance is involved. super() can call different 'branches' of the inheritance tree if necessary. Let me demo

Re: Accumulate , Range and Zeros

2019-07-13 Thread Thomas Jollans
On 13/07/2019 11:54, Abdur-Rahmaan Janhangeer wrote: > Greetings, > > Given this snippet > > from itertools import * > import operator > > > x = [1, 2, 3] # [0, 1, 2, 3, ..., 10] > > y = accumulate(x, operator.mul) > > print(list(y)) > > why does x = list(range(5)) produces only zeros? What

Re: Counting Python threads vs C/C++ threads

2019-07-17 Thread Thomas Jollans
On 17/07/2019 09.58, Barry Scott wrote: > >> On 16 Jul 2019, at 20:48, Dan Stromberg wrote: >> >> >> >> A question arises though: Does threading.active_count() only show Python >> threads created with the threading module? What about threads created with >> the thread module? > Only pythons t

Re: Namespaces: memory vs 'pollution'

2019-07-22 Thread Thomas Jollans
can find them, I think using 2–4 letter abbreviations, even without any decoration, is a fine approach. -- Thomas > - considered adding a single under(-line) suffix, eg "em_" (on the > basis of "made you think"). No, don't make me think (too much)! > - so, perh

Re: Namespaces: memory vs 'pollution'

2019-07-23 Thread Thomas Jollans
On 23/07/2019 04.27, DL Neil wrote: > On 23/07/19 11:00 AM, Ethan Furman wrote: >> On 07/20/2019 05:02 PM, DL Neil wrote: >> >>> Upon closer inspection, I realised it didn't just fail; it failed >>> badly! Some silly, little, boy had imported the PythonEnvironment >>> class but failed to ALSO impor

Re: Python 3.7 - Reading text from Terminal window

2019-07-26 Thread Thomas Jollans
On 26/07/2019 06.33, nir.za...@gmail.com wrote: > Hi, > > I want it to wait for a specific text on the terminal window that it opens > (putty.exe), how can i do it? > > from pywinauto.application import Application > from pynput.keyboard import Key, Controller > > print('Configuring') > > app

Re: Definite or indefinite article for non-singletons?

2019-07-28 Thread Thomas Jollans
On 28/07/2019 17:13, MRAB wrote: > [snip] > > It's strange that "all the things" (meaning "all of the things") is OK, > but otherwise it's "one of the things", "some of the things", etc. Is it? It's the same in French, Dutch and German. Can't tell if it just makes sense or if it's Common Average

Re: .python_history file

2019-07-29 Thread Thomas Jollans
at adds magic comments to ~/.pyhistory as you suggest. If you want this functionality, there's no need for it to be part of Python itself. FWIW, IPython, as far as I can tell, already saves some timestamp information in its history file. -- Thomas > > or like python Functionality: &g

Re: how to generate a standard email form by default OS mail client?

2019-07-30 Thread Thomas Jollans
On 30/07/2019 10.06, dmitre...@gmail.com wrote: > Hello, > > is Python capable of generating a email form (from standard data - address, > topic, string message) with raising it by a default OS email client, e.g. > Thunderbird? User would like to have a possibility to review/modify email > conte

Re: For the code to generate `zen of python'.

2019-08-07 Thread Thomas Jollans
On 07/08/2019 15.11, Hongyi Zhao wrote: > Hi here, > > I noticed that the `zen of python' is generated by the following code: > > d = {} > for c in (65, 97): > for i in range(26): > d[chr(i+c)] = chr((i+13) % 26 + c) > > print("".join([d.get(c, c) for c in s])) > > > But the above code

Re: numpy results in segmentation fault

2019-09-12 Thread Thomas Jollans
On 12/09/2019 15.53, Pradeep Patra wrote: > Hi , > > I was trying to solve the hackerrank and was using python 3.7.x. > https://www.hackerrank.com/challenges/np-concatenate/problem > > While running the code sometimes I get success result and sometimes it > fails with "Segmentation Fault" at Hacker

Fwd: numpy results in segmentation fault

2019-09-16 Thread Thomas Jollans
Please reply on-list. (both of you) Forwarded Message Subject:Re: numpy results in segmentation fault Date: Mon, 16 Sep 2019 17:04:57 +0530 From: Test Bot To: Pradeep Patra CC: Thomas Jollans Firstly, in response to this " I tried to install

Remote Work Wanted - Junior Python Developer

2019-09-22 Thread Shane Thomas
Hi, I would like to start working remotely programming in Python. I have an IT Degree and English is my first Language. I currently live in New Zealand, thus the remote work is the only option. I have 15+ years experience as a Delphi Developer, mainly working with business database application

Re: Generate simple image on a standalone Raspberrry Pi

2019-09-27 Thread Thomas Jollans
On 27/09/2019 14.43, Roy Hann wrote: > I am designing a mobile application to run on a Raspberry Pi 3 model B. > It will not have any Internet access. I need to generate a static image > consisting of a simple arc representing (say) a speedometer or a > pressure gauge. The image will need to be reg

Re: Convert a scientific notation to decimal number, and still keeping the data format as float64

2019-10-18 Thread Thomas Jollans
On 18/10/2019 10:35, doganad...@gmail.com wrote: Here is my question: I am using the numpy.std formula to calculate the standart deviation. However, the result comes as a number in scientific notation. Therefore I am asking, How to convert a scientific notation to decimal number, and still ke

Re: return a ctypes object to C

2019-10-31 Thread Thomas Jollans
e ctypes at all? You can create custom Python types in C to wrap your C pointers. Alternatively: if you're using ctypes anyway, why use the Python C API at all? You can create C function pointers from Python functions with ctypes. If you're mixing two different ways of interfacing Python and C, the result will ALWAYS be messy. Better to stick to one. Personally, I prefer cffi or cython depending on the situation, as I find them clearer and easier to use than ctypes. Using the Python C API directly is usually the hardest to understand and the easiest to get wrong. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Makefiles in Python projects

2019-11-09 Thread Thomas Jollans
cripts for platform-independent tasks rather than makefiles and shell scripts. -- Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Makefiles in Python projects

2019-11-09 Thread Thomas Jollans
On 09/11/2019 21:30, Chris Angelico wrote: On Sun, Nov 10, 2019 at 2:10 AM Thomas Jollans wrote: On 07/11/2019 20:20, Vitaly Potyarkin wrote: What do you think of using Makefiles for automating common chores in Python projects? Like linting, type checking and testing? I've come up w

Re: Using Makefiles in Python projects

2019-11-11 Thread Thomas Jollans
On 11/11/2019 14:23, Rhodri James wrote: On 09/11/2019 23:50, Thomas Jollans wrote: On 09/11/2019 21:30, Chris Angelico wrote: On Sun, Nov 10, 2019 at 2:10 AM Thomas Jollans wrote: On 07/11/2019 20:20, Vitaly Potyarkin wrote: What do you think of using Makefiles for automating common chores

Re: How to specific multiple dtypes in numpy.ndarray?

2019-12-19 Thread Thomas Jollans
On 19/12/2019 11.52, lampahome wrote: > I meet performance is low when I use struct.unpack to unpack binary data. > > So I tried to use numpy.ndarray > But meet error when I want to unpack multiple dtypes > > Can anyone teach me~ > > Code like below: > # python3 > import struct > import numpy as np

Re: Saying bye bye to Python 2

2020-01-11 Thread Thomas Jollans
On 11/01/2020 00:16, tommy yama wrote: As many know, python 2 was retired. 🐍 This means imminent migration to 3 will be a must ? Upgrading to Python 3 has been a "bloody well should" for many, many years now. Though in a shock announcement a few weeks ago the end of Python 2 was delayed AG

Re: how to plot the FFT of a list of values

2020-12-07 Thread Thomas Jollans
usually on a logscale. So: import pylab Don't use pylab. https://matplotlib.org/api/index.html#module-pylab Use matplotlib.pyplot directly instead. "plt" is a popular shorthand: from matplotlib import pyplot as plt #... plt.semilogy(...) # or plt.plot, etc. - Thomas imp

Re: Letter replacer - suggestions?

2020-12-08 Thread Thomas Jollans
s you keep in mind that changing the thing you're looping over can be dangerous in other cases. Hope this helps Thomas -- https://mail.python.org/mailman/listinfo/python-list

Re: Open PDF

2005-09-23 Thread Thomas Heller
process handle which you could wait for os so. With ctypes you can easily experiment with this kind of stuff. Another interesting feature, imo, is the 'verb' that you can pass to these functions. With this, you could for example specify 'print' to print the file instead of just openi

Re: How to decompile an exe file compiled by py2exe?

2005-09-24 Thread Thomas Jollans
Leo Jay wrote: > Dear All, > > I lost my source code because of my incaution. > so anyone can tell me how to decompile the exe file compiled by py2exe? > > Thanks. > > -- > Best Regards, > Leo Jay If you find a program that de-compiles exe to python, it will most likely use very ugly, c-like p

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
Bugs <[EMAIL PROTECTED]> writes: > Any luck on finding anyone to take over py2exe development Thomas? > It's a GREAT project and would be a shame to see it fall into > obsolescence. No, nobody stepped up (yet). Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting tired with py2exe

2005-09-26 Thread Thomas Heller
> Thomas Heller wrote: >> Bugs <[EMAIL PROTECTED]> writes: >> >>>Any luck on finding anyone to take over py2exe development Thomas? >>>It's a GREAT project and would be a shame to see it fall into >>>obsolescence. >> No, nobody stepped up

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Thomas Jollans
Christophe wrote: > Kilian A. Foth a écrit : > >> I just found this amazing video puzzle game written with the pygame >> library, which promises to be infinite fun - but I can't get it to >> decode any video file I own, except the game's own example .mpg. All I >> have is lots and lots of useless

Re: Set up Windows environment with python

2005-09-29 Thread Thomas Heller
ing > values. > > Desktop wallpaper changes work, but they aren't permanent... rebooting > restores the previous desktop wallpaper. > > Does anyone have any experience with this sort of system preperation > scripting? >From looking at the MSDN docs, it seems you have

Re: PyWin SendMessage

2005-09-29 Thread Thomas Heller
After packCopyData(...) returns, the arrays are destroyed, which will probably void their contents. You must keep them alive until you don't need the COPYDATASTRUCT instance any longer. For this kind of stuff, ctypes may be easier to use than pywin32. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: PyWin SendMessage

2005-09-29 Thread Thomas Heller
"g.franzkowiak" <[EMAIL PROTECTED]> writes: > Thomas Heller schrieb: >> "g.franzkowiak" <[EMAIL PROTECTED]> writes: >> >> >>>Hello everybody, >>> >>>I've tryed to use an interp

'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread thomas Armstrong
Hi Using Python 2.3.4 + Feedparser 3.3 (a library to parse XML documents) I'm trying to parse a UTF-8 document with special characters like acute-accent vowels: ... --- But I get this error message: --- UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in posit

Re: 'ascii' codec can't encode character u'\u2013'

2005-09-30 Thread thomas Armstrong
Hi. Thank you both for your answers. Finally I changed my MySQL table to UTF-8 and changed the structure of the query (with '%s'). It works. Thank you very much. 2005/9/30, deelan <[EMAIL PROTECTED]>: > thomas Armstrong wrote: > (...) > > when try

How to prevent logging warning?

2005-10-05 Thread Thomas Heller
ing is configured, and no warning messages are printed. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent logging warning?

2005-10-05 Thread Thomas Heller
> Thomas Heller wrote: >> I'm about to add some logging calls to a library I have. How can I >> prevent that the script that uses the library prints >> 'No handlers could be found for logger "comtypes.client"' when the >> script runs? >

Re: Python, Mysql, insert NULL

2005-10-05 Thread Thomas Bartkus
to "Null" when passed to MySQL. I don't quite understand this and don't really care. If I have a Python variable that has a value None, and I want to transmit this to MySQL as Null - I would: if somevar == None: StrToConcatenateIntoSqlStatement = "Null" e

Re: Python, Mysql, insert NULL

2005-10-06 Thread Thomas Bartkus
sert a Null. But - I really do appreciate your concern :-) Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe has a new maintainer

2005-10-06 Thread Thomas Heller
"Jimmy Retzlaff" <[EMAIL PROTECTED]> writes: > I am taking over the maintenance and support of py2exe from Thomas > Heller. As he announced a few weeks ago he is looking to focus on other > things. py2exe has been very useful to me over the years and I look > forwar

Re: How to prevent logging warning?

2005-10-06 Thread Thomas Heller
"Vinay Sajip" <[EMAIL PROTECTED]> writes: > Thomas Heller wrote: > >> I get the behaviour that I want when I add a 'NULL' handler in the >> library, but is this really how logging is intended to be used? >> > > The reason for the one-o

Re: Absolultely confused...

2005-10-06 Thread Thomas Heller
or BuildValue to create > objects of my own type. > > I know I haven't provided a lot of information, but does anyone have any > ideas or where I should start looking? Can it be that you have TWO instances of the pylf.core.vector3d object? Debugging should reveal it... Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Absolultely confused...

2005-10-06 Thread Thomas Heller
and all the extension > modules I've done in the past) a static structure declared and assigned > to all at once, only once. > > Am I misunderstanding the point? :) > > /me ducks > > On Thu, 2005-10-06 at 16:26 +0200, Thomas Heller wrote: >> Jeremy Moles

Re: Python reliability

2005-10-10 Thread Thomas Bartkus
;Embedded Linux". And I wouldn't be surprised if some dedicated microcontrollers aren't showing up with Python capability. In any case, it would seem you need more control than a Python interpreter would receive when running under Linux. Good Luck. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess and non-blocking IO (again)

2005-10-11 Thread Thomas Bellman
7;t use that OS, and thus can't test it. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "Beware of bugs in the above code; I have! bellman @ lysator.liu.se only proved it correct, not tried it." ! Make Love -- Nicht Wahr! -- http://mail.python.org/mailman/listinfo/python-list

Re: Moving to Win XP as a Python developer

2005-10-14 Thread Thomas Heller
he "Target" line. I have an elisp function bound to a key in XEmacs that starts cmd in the directory where the current buffer is. IMO this is very convenient. To access explorer from that command prompt (in the rare cases that I need it) I use 'start .'. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Moving to Win XP as a Python developer

2005-10-14 Thread Thomas Heller
Trent Mick <[EMAIL PROTECTED]> writes: > [Thomas Heller wrote] >> I have an elisp function bound to a key in XEmacs that starts cmd in the >> directory where the current buffer is. IMO this is very convenient. To >> access explorer from that command prompt (in the r

Re: Dealing with Excel

2005-10-18 Thread Thomas Bartkus
n ADODB.Recordset object with query results. Once you have your recordset stuffed with query results you can pass it to the Excel "CopyFromRecordset" function: Worksheets("Whatever").Cells(1,1).CopyFromRecordset {recordset object} and wham! - You have it

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Thomas Bellman
o the function. Thus, this gives you the behaviour you want: try: os.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese") except os.error, e: if e.errno != errno.EEXIST: raise -- Thomas Bellman, Lysator Computer Club, Linköping University,

Re: Python Doc Error: os.makedirs

2005-10-19 Thread Thomas Bellman
s.makedirs("/tmp/trh/spam/norwegian/blue/parrot/cheese") except os.error, e: if ( e.errno != errno.EEXIST or not os.path.isdir("/tmp/trh/spam/norwegian/blue/parrot/cheese")): raise -- Thomas Bellman, Lysator Computer Club, Linköping Uni

__getattr__, __setattr__

2005-10-20 Thread Thomas Heller
ject.__getattr__ Traceback (most recent call last): File "", line 1, in ? AttributeError: type object 'object' has no attribute '__getattr__' >>> Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: __getattr__, __setattr__

2005-10-20 Thread Thomas Heller
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > for new style classes __getattribute__ is defined, see eg. > http://www.python.org/2.2.3/descrintro.html Steve Holden <[EMAIL PROTECTED]> writes: > >>> object.__getattribute__ > > > Rin

Re: p2exe using wine/cxoffice

2005-10-26 Thread Thomas Heller
ays say. > > Actually, I think it's many unix/linux users who are ignorant of just > how nice, stable and productive Windows can be as a desktop environment. > > ... and I really mean that. ;-). I was waiting for someone to say that. +1. Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs Linux

2005-10-26 Thread Thomas Heller
rom my Python installation. > (Sorry guys; I realise this is more stuff for comp.os.linux or > comp.commandlineshells.bash or whatever it's called. But if > someone *did* know the answer, I'd be really happy!) ;-) Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows vs Linux [was: p2exe using wine/cxoffice]

2005-10-26 Thread Thomas Heller
the running programs that it's resized, so only new > lines will take advantage of the new width. Now, why they didn't > let you do the same thing by grabbing the border and pulling, I > don't know! FYI, if you don't know this already: You also can resize the console with

Re: process and spinning slash

2005-10-30 Thread Thomas Bellman
e child process was started using subprocess.Popen, you should usually use the poll() methods on the Popen object to check if the process has terminated. -- Thomas Bellman, Lysator Computer Club, Linköping University, Sweden "You are in a twisty little passage of ! bellman @ lysator

String Identity Test

2005-11-01 Thread Thomas Moore
Hi: I am confused at string identity test: Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> a="test" >>> b="test" >>> a is b True >>> About identity, I think a is not b, but "a is b" returns

Re: String Identity Test

2005-11-02 Thread Thomas Moore
Hi: > Were you planning to write code that relied on id(x) being different > for different but identical strings x or do you just try to understand > what's going on? > Just try to understand what's going on. Thanks All. -- http://mail.python.org/mailman/listinfo/python-list

Py2Exe produced "binary" shows terminal screen on execution

2005-11-02 Thread Thomas W
I've produced a "binary" version of a python-script using Py2Exe and when run on WinXP it shows a terminal window for a brief moment then the window disappears. How can I avoid this? I want the script to run without being visible at all. Thanks in advance, Thomas -- http://

Re: Python and MySQL

2005-11-02 Thread Thomas Bartkus
ate directory. There is nothing secret here. But As others have already pointed out, after you go to this trouble, your hosting provider will still suck! I'm sure you can you can get lot's of suggestions for a suitable replacement. Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and MySQL

2005-11-02 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > Well, I'm looking at the source for the ever popular MySQLdb library. It > > appears to be nothing but straight up Python source code. I see no reason > >

Re: Learning multiple languages (question for general discussion)

2005-11-03 Thread Thomas Guettler
You can learn both languages by reading the python solutions in pleac, an try to translate them to C#. Please submit the code to the project. HTH, Thomas -- Thomas Güttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and MySQL

2005-11-03 Thread Thomas Bartkus
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > "Steve Holden" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > >>I have a _mysql.c as a part of my distrbution

Re: How can I package a python script and modules into a single script?

2005-11-03 Thread Thomas Heller
and prone to leave around trash if someone > does a 'kill -9'. However, this might be an > acceptable compromise. I'm sure that I've seen a > tool around like this, but I can't find it anymore. Wasn't this named 'squeeze'? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and MySQL

2005-11-03 Thread Thomas Bartkus
"Magnus Lycka" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thomas Bartkus wrote: > > But heck! Now I'm looking at the /usr/lib/python2.3/site-packages on a > > Mandrake Linux box. No [_mysql.] pyd here! Fewer files overall and while

Launching a curses script with screen -dm

2005-11-04 Thread Rob Thomas
this error: _curses.error: start_color() returned ERR Is it because a TERM variable isn't set properly? I'm running screen with -T xterm, which should take care of that... Any insight would be appreciated :) -Rob Thomas -- http://mail.python.org/mailman/listinfo/python-list

<    8   9   10   11   12   13   14   15   16   17   >