Re: for installation of pygames.

2021-05-07 Thread Russell
mishrasamir2...@gmail.com wrote: >Sir/madam, > >I'm a user of python , so I'm requesting you to give me permission to run >pygames . > >Thankyou > >Samir Mishra > > > > > >Sent from [1]Mail for Windows > > References > >Visible links >1. https://go.microso

Re: Start Python programming

2021-04-30 Thread Russell via Python-list
Gazoo wrote: > > > I'd like to start learning Python programming. What sites/tutorials > could you recommend for beginner, please. > I liked the book found at https://automatetheboringstuff.com/ You can read the whole book online. I think you used to be able to download a copy too. It has lot

Re: [ANN] Free Python tutorial with exercises, cscx.org

2021-04-13 Thread Russell via Python-list
Jach Feng wrote: > Is there any reason a student/beginner learn Python now start from Python2? > > --Jach Only if you want a job porting python2 to python3. Python 2.x is officially End Of Life. -- rust 0x68caecc97f6a90122e51c0692c88d9cb6b58a3dc -- https://mail.python.org/mailman/listinfo/p

Re: all versions of python fail to indent after conditional statement

2021-04-10 Thread Russell via Python-list
I would recommend reading a book that introduces and explains Python rather than just diving in. I'm been enjoying "Introducing Python: Modern Computing in Simple Packages" which can be found at https://amzn.com/1492051365. It started from the beginning and would answer the questions/difficulties y

Re: Ann: New Python curses book

2021-04-10 Thread Russell via Python-list
I believe this is it: https://www.amazon.com/dp/B091CL3DTK/ref=cm_sw_su_dp But for some reason the ASIN is different. William Ray Wing wrote: > I???ve ordered the book (physical volume). It will fulfill a need I???ve had > for some time. Unfortunately, it is only available in the UK store, so

Re: editor recommendations?

2021-03-08 Thread Russell
Cameron Simpson wrote: >>-- Emacs outshines all other editing software in approximately the same >>way that the noonday sun does the stars. It is not just bigger and >>brighter; it simply makes everything else vanish. ??? Neal Stephenson Neal Stephenson's book Cryptonomicon was the reason I be

Re: editor recommendations?

2021-03-07 Thread Russell
Dan Stromberg wrote: > On Tue, Mar 2, 2021 at 8:11 PM Dan Stromberg wrote: > >> >> On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: >> >>> Ethan Furman wrote: >>> > I'm currently using vim, and the primary reason I've stuck with it for >&

Re: editor recommendations?

2021-03-02 Thread Russell
Ethan Furman wrote: > I'm currently using vim, and the primary reason I've stuck with it for so > long is because I can get truly black screens with it. By which I mean that > I have a colorful window title bar, a light-grey menu bar, and then a > light-grey frame around the text-editing windo

Is it possible to connect an awaitable to a Future, basically turning it into a Task?

2018-10-27 Thread Russell Owen
(especially if I have to cancel the wait, as I have to keep the extra task around so I can cancel it). So...just wondering if I missed something. Regards, Russell -- https://mail.python.org/mailman/listinfo/python-list

Re: asyncio await different coroutines on the same socket?

2018-10-05 Thread Russell Owen
On Oct 3, 2018, Ian Kelly wrote (in article): > On Wed, Oct 3, 2018 at 7:47 AM Russell Owen wrote: > > Using asyncio I am looking for a simple way to await multiple events where > > notification comes over the same socket (or other serial stream) in > > arbitrary > >

How to await multiple replies in arbitrary order (one coroutine per reply)?

2018-10-05 Thread Russell Owen
I can end when *I* say it's time to end, and if I'm not quick enough then it will time out gracefully. But maybe there's a simpler way to do this. It doesn't seem like it should be difficult, but I'm stumped. Any advice would be appreciated. -- Russell -- https://mail.python.org/mailman/listinfo/python-list

asyncio await different coroutines on the same socket?

2018-10-03 Thread Russell Owen
with is ugly, using multiple layers of "async def”, keeping a record of Tasks that are waiting and calling "set_result" on those Tasks when finished. Also Task isn’t even documented to have the set_result method (though "future" is) Is there a simple, idiomatic way to do

Re: Anaconda with Python 3.7

2018-09-28 Thread Russell Owen
and are also dealing with issues with dependency management. In any case miniconda is available for 3.7 so it is worth checking to see if it has the packages that you need. (And if it’s just missing a few you can see if pip will install those). -- Russell -- https://mail.python.org/mailman/lis

Re: What's the best way to minimize the need of run time checks?

2016-08-11 Thread Russell Owen
ally. This will not catch everything that a compiler would catch in a compiled language, but it will catch many common errors. -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Error

2016-02-03 Thread Russell McCune via Python-list
i installed it incorrectly or what. What am I doing wrong?? Thank you Russell McCune -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter resize question

2015-07-17 Thread Russell Owen
ght of the child widgets, frames, etc. Or am I incorrect with this? I'm not seeing it. If I try the following script I see that resizing the widget does update frame.winfo_width() and winfo_height. (I also see that the requested width and height are ignored; you can omit those). -- Russe

Argument Presence Checking via Identity or Boolean Operation?

2015-06-04 Thread Russell Brennan
I'm going to x-post this to stackoverflow but... When checking a method's arguments to see whether they were set, is it pythonic to do an identity check: def doThis(arg1, arg2=None): if arg2 is None: arg2 = myClass() Or is it proper form to use a short-circuiting boolean: def doThis(arg1

Re: Quick question, if you please

2015-03-31 Thread Russell Owen
version each time? Thanks for your kind attention, John Kelly I would need more information to help. What operating system are you on? How and where are you installing Python (and what do you mean by "received Python with another install"?). -- Russell -- https://mail.python.o

Re: Best way to calculate fraction part of x?

2015-03-26 Thread Russell Owen
On 3/24/15 6:39 PM, Jason Swails wrote: On Mon, Mar 23, 2015 at 8:38 PM, Emile van Sebille mailto:em...@fenx.com>> wrote: On 3/23/2015 5:52 AM, Steven D'Aprano wrote: Are there any other, possibly better, ways to calculate the fractional part of a number? flo

Re: Picking apart a text line

2015-03-02 Thread Russell Owen
ng up requires some overhead. Simpler alternatives include using SQLite, a simple file-based database system, or numpy structured arrays (arrays with named fields). Python includes a standard library module for sqlite and numpy is easy to install. -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install PIL or PILLOW on OS X Yosemite?

2015-02-19 Thread Russell Owen
aries and tools. If you want to stick with python.org python then a binary PIL installer is available here: <http://www.astro.washington.edu/users/rowen/python/> (I am not aware of any Pillow binaries). -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Re: ctypes.cdll.LoadLibrary() freezes when loading a .so that contains dlopen()

2015-02-13 Thread Russell
On Friday, February 13, 2015 at 7:27:54 PM UTC-6, Ian wrote: > On Fri, Feb 13, 2015 at 8:39 AM, Russell wrote: > > I have a shared library, libfoo.so, that references another .so which isn't > > linked but instead loaded at runtime with > > myso=dlopen("/usr

ctypes.cdll.LoadLibrary() freezes when loading a .so that contains dlopen()

2015-02-13 Thread Russell
I have a shared library, libfoo.so, that references another .so which isn't linked but instead loaded at runtime with myso=dlopen("/usr/local/lib/libbar.so", RTLD_NOW); when I try to load it with ctypes, the call hangs and I have to ctl-c. (build)[dev]$ export LD_LIBRARY_PATH=/usr/local/bin (bu

redirect stderr to syslog?

2014-08-15 Thread Russell E. Owen
We are using the syslog module for logging, and would like to redirect stderr to our log. Is there a practical way to do it? I realize the logging module supports this and has a syslog writer, so that's a fallback. But we were hoping to use the syslog module for performance. -- Ru

Re: Mac python py2app problem

2014-07-17 Thread Russell E. Owen
Disk Image from Folder. Or...open Disk Utility and drop the app onto its dock icon. -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Suggested GUI framework for Mac and unix?

2014-01-06 Thread Russell E. Owen
Tkinter's Canvas widget for this. - Compatible with a sound library for playing sound cues. I presently use pygame for this and have been considering switching to PySDL. - Compatible with Twisted Framework. - Prediction is hard, but indications of a long-term future would be a definite bonus.

Re: Running python's own unit tests?

2013-11-15 Thread Russell E. Owen
e is a nice resource. -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Running python's own unit tests?

2013-11-14 Thread Russell E. Owen
ng a python distribution). Any hints? -- Russell -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is Ruby on Rails more popular than Django?

2013-03-07 Thread Russell E. Owen
uted. Years ago when I had some simple web programming to do I looked at the choices, gave up and used PHP (which I hated, but got the job done). If RoR had been available I would have been much happier using that. In my opinion the plethora of Python web frameworks is a serious detriment to t

Re: Keeping a Tkinter GUI alive during a long running process

2012-12-26 Thread Russell E. Owen
t in lieu of a way to asynchronously read the stdout pipe, I don't know what else to do that's safe. Another option to consider is to use Twisted framework, which has its own support for running tasks. However, if you are not using Twisted already, it's a big addition. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter bug in Entry widgets on OS X

2012-09-13 Thread Russell E. Owen
eys are pressed. The default behavior of the Entry widget is unfortunate. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Beautiful Soup Table Parsing

2012-08-08 Thread Tom Russell
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 grabbing the contents of the cell nex

Re: What's wrong with this code?

2012-07-23 Thread Russell E. Owen
pass around references to the container and read or modify the value(s) stored in it when you need them. Here is a simple example: class Container(object): def __init__(self, value): self.value = value c = Container(5) d = Container(6) x = [c, d] e, f = x c.value = None d.value = "hello" print e.value, f.value None "hello" -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle question: sequencing of operations

2012-05-09 Thread Russell E. Owen
In article , Ian Kelly wrote: > On Tue, May 8, 2012 at 1:19 PM, Russell E. Owen wrote: > > In article , > >  "Russell E. Owen" wrote: > > > >> What is the sequence of calls when unpickling a class with __setstate__? > > I believe it jus

Re: pickle question: sequencing of operations

2012-05-08 Thread Russell E. Owen
In article , "Russell E. Owen" wrote: > What is the sequence of calls when unpickling a class with __setstate__? > > >From experimentation I see that __setstate__ is called and __init__ is > not, but I think I need more info. > > I'm trying to pickle an in

pickle question: sequencing of operations

2012-05-04 Thread Russell E. Owen
objects. What I'd like to do is basically just pickle the constructor parameters and then use those to reconstruct the object on unpickle, but I'm not sure how to go about this. Or an example if anyone has one. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it necessary to call Tk() when writing a GUI app with Tkinter?

2012-03-05 Thread Russell E. Owen
instead? So remove the > self.pack line and add a line to the bottom: > > > root = tk.Tk() > > app = Application(master=root) > > app.pack() # <-- added this line > > app.mainloop() I agree. Application is simply another widget, like Entry or Canvas. its contents sh

Re: Generator problem: parent class not seen

2012-02-01 Thread Russell Owen
On Feb 1, 2012, at 3:35 PM, Arnaud Delobelle wrote: > On Feb 1, 2012 9:01 PM, "Russell E. Owen" wrote: > > > > I have an odd and very intermittent problem in Python script. > > Occasionally it fails with this error: > > > > Traceback (most recent c

Re: Generator problem: parent class not seen

2012-02-01 Thread Russell Owen
On Feb 1, 2012, at 2:34 PM, Chris Rebert wrote: > On Wed, Feb 1, 2012 at 1:00 PM, Russell E. Owen wrote: >> I have an odd and very intermittent problem in Python script. >> Occasionally it fails with this error: >> >> Traceback (most recent call last): >> Fi

Generator problem: parent class not seen

2012-02-01 Thread Russell E. Owen
t of inspect.getclasstree. Any ideas on what might be wrong and how to track it down (and why it would be so intermittent)? -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator question: prefer class, but only function works

2011-11-14 Thread Russell E. Owen
In article , Ian Kelly wrote: > On Thu, Nov 10, 2011 at 2:52 PM, Russell E. Owen wrote: > > I am trying to write a decorator that times an instance method and > > writes the results to a class member variable. For example: > > > > def timeMethod(func): >

Decorator question: prefer class, but only function works

2011-11-10 Thread Russell E. Owen
is a member? I was very disappointed it was not available when timeMethod was called/instantiated. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Google AI challenge: planet war. Lisp won.

2010-12-04 Thread Benjamin L. Russell
t; games <- > pornography > adulteries > sex Yeah, riiight. So it's a crime to have any fun in life, right? Go get a life. -- Benjamin L. Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Scheme as a virtual machine?

2010-11-26 Thread Benjamin L. Russell
dekudekup...@yahoo.com (Benjamin L. Russell) writes: > When I was a student at my college, one of the students once told me a > secret about how a computer program ran by a professor for a course in > introduction to systems programming checked to ensure that the students > who wer

Re: Scheme as a virtual machine?

2010-11-26 Thread Benjamin L. Russell
ment. However, the odds of this happening are less likely in a single thread. The odds of this happening are even less likely for three people in the thread. The odds of this happening are even less likely for three *new* people in the same thread at the same time.... -- Benjamin L. Russell --

Re: Confused about nested scopes and when names get added to namespaces

2010-09-08 Thread Russell Warren
My tests were run in python 2.6.5. -- http://mail.python.org/mailman/listinfo/python-list

Confused about nested scopes and when names get added to namespaces

2010-09-08 Thread Russell Warren
I'm having trouble understanding when variables are added to namespaces. I thought I understood it, but my nested function examples below have me very confused. In each test function below I have an x variable (so "x" is in the namespace of each test function). I also have a nested function in e

Re: * for generic unpacking and not just for arguments?

2009-11-29 Thread Russell Warren
On Nov 29, 11:09 am, Christian Heimes wrote: > The feature is available in Python 3.x: > > >>> a, b, *c = 1, 2, 3, 4, 5 > >>> a, b, c > (1, 2, [3, 4, 5]) > >>> a, *b, c = 1, 2, 3, 4, 5 > >>> a, b, c > > (1, [2, 3, 4], 5) Interesting... especially the recognition of how both ends work with the "a,

* for generic unpacking and not just for arguments?

2009-11-29 Thread Russell Warren
Is there a reason that this is fine: >>> def f(a,b,c): ... return a+b+c ... >>> f(1, *(2,3)) 6 but the code below is not? >>> x = (3, 4) >>> (1, 2, *x) == (1, 2, 3, 4) Traceback (most recent call last): File "", line 1, in invalid syntax: , line 1, pos 8 Why does it only work when unpackin

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
log("ERROR", "Password reset failed.\n{0}{1} generated the following error: {2}".format(p4, cmd, stderr)) except OSError as err: log("ERROR", "Execution failed: {0}".format(err)) Thanks, Rusty On Tue, Sep 15, 2009 at 6:37 PM, Chris Rebert

Re: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
hris Rebert wrote: > On Tue, Sep 15, 2009 at 5:07 PM, Chris Rebert wrote: > > On Tue, Sep 15, 2009 at 4:01 PM, Russell Jackson > > wrote: > > > >> Attempted code in Python 3: (Doesn't work either) > > > >> cmd = ' passwd {0}'

Re: Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
saw in the docs, and the fact that it didn't complain about that part, but I'll try the close(): Thanks, Rusty On Tue, Sep 15, 2009 at 4:24 PM, Rhodri James wrote: > On Wed, 16 Sep 2009 00:01:17 +0100, Russell Jackson < > ru...@rcjacksonconsulting.com> wrote: > > H

Fwd: Converting a script to Python 3 - having trouble.

2009-09-15 Thread Russell Jackson
Hi, I have the following code that works fine in Python 2.x, but I can't seem to get it to work in Python 3 with Popen. Can you please tell me how to get the same functionality out of Python 3? The gist of what I doing is in the setpassword function. I have tried numerous ways to get this to work,

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-17 Thread Russell E. Owen
In article , Ned Deily wrote: > In article , > Russell Owen wrote: > > I installed the Mac binary on my Intel 10.5.6 system and it works, > > except it still uses Apple's system Tcl/Tk 8.4.7 instead of my > > ActiveState 8.4.19 (which is in /Library/Frameworks

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-17 Thread Russell Owen
On Apr 16, 2009, at 11:17 PM, Ronald Oussoren wrote: On 16 Apr, 2009, at 20:58, Russell Owen wrote: I installed the Mac binary on my Intel 10.5.6 system and it works, except it still uses Apple's system Tcl/Tk 8.4.7 instead of my ActiveState 8.4.19 (which is in /Library/Frameworks

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-16 Thread Russell Owen
ve been wanting some of the bug fixes in 8.5 anyway. -- Russell On Apr 16, 2009, at 5:35 AM, Ronald Oussoren wrote: On 15 Apr, 2009, at 22:47, Russell E. Owen wrote: Thank you for 2.6.2. I see the Mac binary installer isn't out yet (at least it is not listed on the downloads page)

Re: RELEASED Python 2.6.2

2009-04-15 Thread Russell E. Owen
on a machine that already has a 3rd party Tcl/Tk installed; the resulting binary is then compatible with both 3rd party versions of Tcl/Tk and also with Apple's ancient built in version. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

2 very interesting python projects - Financial industry

2009-02-18 Thread David Russell
Rate - Negotiable This is an urgent requirement please contact me or send me your cv as soon as possible. Contact: David Russell - Account manager email: david.russ...@fdmgroup.com Tel: +49 (0) 69 756 0050 Web: www.fdmgroup

Re: Tkinter event loop question

2008-08-29 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, gordon <[EMAIL PROTECTED]> wrote: > On Aug 29, 4:45 am, "Russell E. Owen" <[EMAIL PROTECTED]> wrote: > >your Controller object should not create root nor should > > it call mainloop to start the event loop. > >

Re: Tkinter event loop question

2008-08-28 Thread Russell E. Owen
ent loop. Those two actions should be done once by the main script that launches your application. As to where to go from here...it would help to know more about what you are trying to do. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: ActiveState Python v2.5 doesn't come with Tkinter or Tk installed.

2008-08-14 Thread Russell E. Owen
ctiveState puts out a very nice Tcl/Tk installer that includes many useful extra packages. But I've never seen the point to ActiveState's Python installer. When I last tried it, their Python was missing readline and did not add any useful packages to the standard python.org versi

Can't seem to build python against custom tcl/tk

2008-08-13 Thread Russell E. Owen
h path in the text I added to Setup.local) Is there some way to convince configure to use my tcl/tk (that would potentially be simpler than editing Modules/Setup.local). -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Could someone please review patch 799428: fix Tkinter tk_focusNext?

2008-08-01 Thread Russell E. Owen
of getting an object back in less-than-ancient versions of tcl/tk. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter- Possibly a basic question

2008-07-30 Thread Russell Blau
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I hate to do this, but I've thoroughly exhausted google search. Yes, > it's that pesky root window and I have tried withdraw to no avail. I'm > assuming this is because of the methods I'm using. I guess my question > is two-fold. > 1) Ho

Re: like py2exe, but on a mac

2008-07-29 Thread Russell E. Owen
7;s an interesting application, but... I tried it to bundle a script that puts up a standard Tkinter file save dialog box and I found that the dialog box was not in front -- I had to switch applications to get to it. Still, it looks useful for fully faceless applications; unlike py2applet the text to stdout shows up in a log window. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: like py2exe, but on a mac

2008-07-29 Thread Russell E. Owen
stem python. So if your application needs any 3rd party packages then including python with the app will allow it work with more versions of MacOS X. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

"proper"/best way to hack SimpleXmlRpcServer to support datetime?

2008-07-18 Thread Russell Warren
I'm running python 2.5.1 and it seems that SimpleXmlRpcServer is not setup to support the base datetime module in the same way xmlrpclib has been with "use_datetime". I see that someone (Virgil Dupras) has recently submitted a fix to address this, but I don't want to patch my python distro. I wan

Re: Regular expression help

2008-07-18 Thread Russell Blau
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am new to Python, with a background in scientific computing. I'm > trying to write a script that will take a file with lines like > > c afrac=.7 mmom=0 sev=-9.56646 erep=0 etot=-11.020107 emad=-3.597647 > 3pv=0 > > extract the values

Re: 'if name is not None:' v. 'if name:'

2008-07-15 Thread Russell Blau
"Victor Noagbodji" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Well that's exactly why I'm asking. Since None returns False in if > statements. Why do people use if name is not None: instead of simply > writing if not name? > Because '' is a string value that is treated as fal

Re: variable question

2008-07-09 Thread Russell Blau
"Support Desk" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am trying to assign a variable using an if / else statement like so: > If condition1: > Variable = something > If condition2: > Variable = something else > Do stuff with variable. > > But the v

Re: How to find the first space?

2008-06-09 Thread Russell Blau
"Johny" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can I find the first space using regex? > > For example I have text > Text=' This is a sample ' Why do you need to use a regex? text = text.replace(" ", "") Russ -- http://mail.python.org/mailman/listinfo/python-list

Re: re

2008-06-04 Thread Russell Blau
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David C. Ullrich schrieb: >> Say I want to replace 'disc' with 'disk', but only >> when 'disc' is a complete word (don't want to change >> 'discuss' to 'diskuss'.) The following seems almost >> right: >> >> [^a-zA-Z

Re: How do I make a copy of my class object?

2008-05-22 Thread Russell Blau
"Marlin Rowley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a class object which has the usual data members and functions. > I'm trying to make a copy of this class (which includes wx.Bitmap objects) > but deepcopy() doesn't seem to work. How would I do this? Are you try

Re: Pass data from Python to C++

2008-05-15 Thread Russell E. Owen
n I have no idea if it's even possible. (For plain C I would start with ctypes, but that doesn't cover this case. There are many other options including boost and Pyrex, but I've not used those.) -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: simple question about Python list

2008-05-09 Thread Russell Blau
On May 9, 6:25 am, dmitrey <[EMAIL PROTECTED]> wrote: > Ok, I use Python 2.5 but I try my code to remain Python 2.4 and > (preferable) 2.3 compatible. > Are there other solutions? > D. > > On 9 ôÒÁ, 13:17, Paul Hankin <[EMAIL PROTECTED]> wrote: > > > On May 9, 11:04šam, dmitrey <[EMAIL PROTECTED]>

Reusing IDLE file editor

2008-05-09 Thread Russell Blau
I have a need for some simple text-editing capabilities in a Tkinter program, and it occurred to me that IDLE is a Tkinter app that already has what I need in its file editor windows. I thought it would be nice if I could just use one of those windows as a widget in my application, in place of

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Torsten Bronger <[EMAIL PROTECTED]> wrote: > Hallöchen! > > Russell E. Owen writes: > > > [...] > > > > So...to repeat the original question, is there any simpler > > unicode-safe replacement for str(exception)? &

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Russell E. Owen
: > return str(a) > except: > return repr(a) Yes. That is a more flexible alternative to what I've adopted: def exStr(ex): return ",".join([unicode(s) for s in f.args]) the latter gives better output for the case I'm interest

Re: Simple unicode-safe version of str(exception)?

2008-04-29 Thread Russell E. Owen
self.Failed, errStr) (where e is an Exception of some kind) Notice that I'm iterating over the args. But again, this is far messier than: self.setState(self.Failed, str(e) So...to repeat the original question, is there any simpler unicode-safe replacement for str(exception)? -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Simple unicode-safe version of str(exception)?

2008-04-28 Thread Russell E. Owen
e(s) for s in f.args]) self.setState(self.Failed, errStr) Is there a simpler solution that works in Python 2.3-2.5? -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Is crawling the stack "bad"? Why?

2008-02-28 Thread Russell Warren
> OK, if you crawl the stack I will seek you out and hit you with a big > stick. Does that affect your decision-making? How big a stick? :) > Seriously, crawling the stack introduces the potential for disaster in > your program, since there is no guarantee that the calling code will > provide the

Re: Tkinter: Missing the last piece of the puzzle

2008-02-27 Thread Russell E. Owen
event. Hmmm. Set an internal state variables "isChanged" based on the Text callback and only modify the menu if the variable is set. It's trickier to detect "significant" changes vs insigificant ones. Personally I would not bother to go that far. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Is crawling the stack "bad"? Why?

2008-02-25 Thread Russell Warren
convincing argument yet on why crawling the stack is considered bad? I kind of hoped to come out of this with a convincing argument that would stick with me... On Feb 25, 12:30 pm, Ian Clark <[EMAIL PROTECTED]> wrote: > On 2008-02-25, Russell Warren <[EMAIL PROTECTED]> wrote: > > &

Re: Is crawling the stack "bad"? Why?

2008-02-25 Thread Russell Warren
> How about a dictionary indexed by by the thread name. Ok... a functional implementation doing precisely that is at the bottom of this (using thread.get_ident), but making it possible to hand around this info cleanly seems a bit convoluted. Have I made it more complicated than I need to? There

Re: Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
> That is just madness. What specifically makes it madness? Is it because sys._frame is "for internal and specialized purposes only"? :) > The incoming ip address is available to the request handler, see the > SocketServer docs I know... that is exactly where I get the address, just in a mad wa

Re: Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
Argh... the code wrapped... I thought I made it narrow enough. Here is the same code (sorry), but now actually pasteable. --- import SimpleXMLRPCServer, xmlrpclib, threading, sys def GetCallerNameAndArgs(StackDepth = 1): """This function returns a tuple (a,b) where: a = The name of the ca

Is crawling the stack "bad"? Why?

2008-02-24 Thread Russell Warren
I've got a case where I would like to know exactly what IP address a client made an RPC request from. This info needs to be known inside the RPC function. I also want to make sure that the IP address obtained is definitely the correct one for the client being served by the immediate function call

Re: Truncated postings

2008-02-13 Thread Russell E. Owen
I'm not seeing that. But: - I use gmane - Your posting has some weird characters in it (they show up on my screen as sort of box/arrow containing an x) so maybe something about your email format is making the list server upset. -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: pyinstall and matplotlib

2008-02-13 Thread Russell E. Owen
g to use it for Windows as well. But after a lot of experimenting I was never able to get anything even close to functional. Maybe it's better now.) -- Russell from distutils.core import setup import os import sys import matplotlib import py2exe # The following code is necessary for py2exe

Re: Tkinter equiv for setPalette

2008-02-11 Thread Russell E. Owen
ue'); > > Is there an equivalent for Tkinter? How can I set default colors for > background and foreground for the whole application (root window and its > children) Tkinter widgets have a tk_setPalette method so you can do this: root = Tkinter.Tk() root.tk_setPalette(

Re: Problem with Tkinter scrollbar callback

2008-01-25 Thread Russell E. Owen
lls in a table row (effectively), and > it shoots up from 5 to 26 columns almost instantly (that's the > internal max I set). Is the scroll bar's repeatinterval set to a reasonable value? -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with Tkinter scrollbar callback

2008-01-24 Thread Russell E. Owen
> > On Windows, it produces the correct output > > scrollbar: scroll > scrollbar: 1 > scrollbar: units > > but on linux, it produces > > scrollbar: 1 I see the same bad thing on our RedHat Enteprise unix system which has the default tcl/tk 8.4.6. However

Re: When is min(a, b) != min(b, a)?

2008-01-23 Thread Russell E. Owen
f * 0. > > 1E5000 creates a nan because it is *much* bigger than DBL_MAX (around > 1E+308). In fact it is even larger than LDBL_MAX (around 1E+4932). Isn't it safer to use float("inf"), float("-inf") and float("nan") to create the necessary items? -- Russell -- http://mail.python.org/mailman/listinfo/python-list

Python/Tkinter DLL conflicts on Windows

2007-12-26 Thread Russell Blau
I have some Tkinter programs that I run on two different machines. On Machine W, which runs Python 2.5.1 on Windows XP, these programs run fine. On Machine H, which runs Python 2.5.1 on Windows XP, however, the same programs crash regularly. The crashes are not Python exceptions, but rather a

Re: Python; jump to a concrete line

2007-12-20 Thread Russell Blau
"Horacius ReX" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, sorry but after looking for information, I still did not get how, > when reading a text file in python, can one jump to a concrete line > and then read the different data (separated by spaces). In each line > there is

Tkinter weirdness on Windows

2007-12-15 Thread Russell Blau
I have some Tkinter programs that I run on two different machines. On Machine W, which runs Python 2.5.1 on Windows XP, these programs run just fine. On Machine H, which runs Python 2.5.1 on Windows XP, however, the same programs crash regularly. The crashes are not Python exceptions, but rat

Re: Question from a python newbie

2007-12-13 Thread Russell
I suspected it was a ternary type of operator, but was unable to confirm it. And I didn't realize it was new to 2.5. Perfectly clear now. :) Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Question from a python newbie

2007-12-13 Thread Russell
I've been learning Python slowly for a few months, coming from a C/C+ +, C#, Java, PHP background. I ran across a code fragment I'm having trouble wrapping my brain around. I've searched the Language Reference and was not able to find any info regarding the structure of this code fragment: int(t

Re: Using python as primary language

2007-11-13 Thread Russell E. Owen
d) - Lack of a good built-in GUI toolkit (but there are several good alternatives including Qt) > * Charting (Histograms, Line charts, bar charts, pie charts, ...) > I am currently looking into PyQwt, which looks promising. HippoDraw is very good. I am not familiar with PyQwt so I can

Re: Looking for a good Python environment

2007-11-11 Thread Russell Warren
> While we're at it, do any of these debuggers implement a good way to > debug multi-threaded Python programs? Wing now has multi-threaded debugging. I'm a big Wing (pro) fan. To be fair, when I undertook my huge IDE evaluation undertaking it was approx 2 years ago... at the time as far as what

  1   2   3   >