Syntax Highlighting in a tkinter Text widget

2014-10-06 Thread Nicholas Cannon
Hey guys Im working on an open source text editor(https://github.com/nicodasiko/Text-Config-2) and I would like to add syntax highlighting(mainly for python code). I have built the editor in python and the text input is a Text tkinter widget. I know how to add tags and highlight things but Im

Re: Syntax Highlighting in a tkinter Text widget

2014-10-07 Thread Nicholas Cannon
Sweet thanks for the help many I am defiantly going to use these. -- https://mail.python.org/mailman/listinfo/python-list

Re: Switch statement

2013-03-10 Thread Nicholas Cole
On Sun, Mar 10, 2013 at 8:42 PM, Mitya Sirenef wrote: > On 03/10/2013 10:16 AM, Joseph L. Casale wrote: > >> I have a switch statement composed using a dict: >> > > > > > > switch = { > > 'a': func_a, > > 'b': func_b, > > 'c': func_c > > } > > switch.get(var, default)() > > > > > > As a result of

How do I bind to scrollbar?

2005-12-13 Thread Nicholas Shewmaker
(I apologize if this posts twice. My AVG is being fussy.) From what I've read, MouseWheel is a very tricky event. I have replaced my Python tcl84.dll and tk84.dll files with those in the ActiveTcl distribution to fix the crashes caused by the event. Then, I managed to see that my test script

Class constant for extension

2006-12-19 Thread Yue . Nicholas
Hi, I have written a small prototype Python extension for a C-library. I have the methods all sorted out and it is working fine. In the C-library, they are various constants of types like string, integer, float and matrix. I'd like to expose them as READONLY values. Is the use of PyMemb

Tkinter question

2005-06-14 Thread Nicholas . Vaidyanathan
Title: Tkinter question I'm sure there must be a way to do this, but I can't figure it out for the life of me… I'm writing a program where I would like to use a button's text field as part of an if statement. I set up my button like this:  i = [ "7", "8","9", "/", "4", "5", "6", "*", "1", "2

Tkinter Question

2005-06-15 Thread Nicholas . Vaidyanathan
Title: Tkinter Question Thanks for all the help guys… I'm a bit confused as to the inner workings of the Tkinter system (I'm both a Python and a GUI n00b). I was hoping that by slapping the x on button python was doing some cool dynamic variable creation (i.e. creating 9 variables with 1 loop

Help implementing an idea

2005-06-17 Thread Nicholas . Vaidyanathan
Well, I'm a total python n00b, but I was playing around with exception handling yesterday, and was stricken by how incredibly easy it is to use the op system to create nice scripts... I did the following: import sys lines = sys.stdin.readlines() lines.sort() for stuff in lines: print stuff ,

using the sysloghandler class

2007-04-18 Thread Nicholas Milkovits
Hello all, I have a small script which attempts to write to the user.log syslog import logging, logging.handlers logger = logging.getLogger('bender') handler = logging.handlers.SysLogHandler(('localhost', logging.handlers.SYSLOG_UDP_PORT), logging.handlers.SysLogHandler.LOG_USER) formatter = log

RotatingFileHandler bugs/errors and a general logging question.

2007-05-08 Thread nicholas . petrella
I am currently trying to use the python logging system as a core enterprise level logging solution for our development and production environments. The rotating file handler seems to be what I am looking for as I want the ability to have control over the number and size of log files that are writt

Re: RotatingFileHandler bugs/errors and a general logging question.

2007-05-10 Thread nicholas . petrella
On May 9, 12:37 am, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On May 9, 12:52 am, [EMAIL PROTECTED] wrote:> The infrastructure in which I > am work needs the ability to have log > > files written to from multiple instances of the same script and > > potentially from hundreds or more different machi

Re: Image.open( "C:\test.jpg") is this wrong ?

2007-08-27 Thread Nicholas Amorim
Ah "My problem is that I don't know what my active directory is so I am putting an absolute path name in quotes." import os os.getcwd() # it returns your current directory -- http://mail.python.org/mailman/listinfo/python-list

Re: classes and functions

2007-03-02 Thread Nicholas Parsons
Hi Claire, That is the beauty of using Python. You have a choice of using classes and traditional OOP techniques or sticking to top level functions. For short, small scripts it would probably be overkill to use classes. Yet the programmer still has classes in his tool chest if he/she is

Newbie Test

2007-03-02 Thread Nicholas Parsons
Greetings, This is just a test to see if I can post to this mailing list. Can someone from the list please respond to this email so I know it worked? Thanks in advance! --Nick -- http://mail.python.org/mailman/listinfo/python-list

pop method question

2007-03-03 Thread Nicholas Parsons
Howdy Folks, I was just playing around in IDLE at the interactive prompt and typed in dir({}) for the fun of it. I was quite surprised to see a pop method defined there. I mean is that a misnomer or what? From the literature, pop is supposed to be an operation defined for a stack data s

Re: pop method question

2007-03-03 Thread Nicholas Parsons
On Mar 3, 2007, at 3:49 PM, Paul Rubin wrote: > Nicholas Parsons <[EMAIL PROTECTED]> writes: >> I was just playing around in IDLE at the interactive prompt and typed >> in dir({}) for the fun of it. I was quite surprised to see a pop >> method defined there. I mean

Re: pop method question

2007-03-03 Thread Nicholas Parsons
some ambiguity with the dangling if statement. So I guess you can't win for trying :). Just call me a purist and think of me as someone who likes consistency. Python is here to stay and no language is perfect... --Nick On Mar 3, 2007, at 7:32 PM, Raymond Hettinger wrote: > [Nichola

Re: pop method question

2007-03-04 Thread Nicholas Parsons
Hi Jordan, That is true what you say about pop() behavior with stack-like objects. But the definition of pop() for a stack-like structure is stronger than that. A stack is a LIFO data structure. Therefore the pop() operation is defined to not only mutate the receiver and return the item

Re: pop method question

2007-03-04 Thread Nicholas Parsons
On Mar 4, 2007, at 4:38 AM, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Nicholas > Parsons wrote: > >> Just from my computer science background when I see pop(), I think >> of a >> stack data structure. > > Then question your p

Re: Project organization and import

2007-03-04 Thread Nicholas Parsons
1a) Module/class collision. I like to use the primary class in a file as the name of the file. However this can lead to namespace collisions between the module name and the class name. Also it means that I'm going to be stuck with the odious and wasteful syntax foo.foo everywhere, or forced to

Type allocation in extensions

2007-03-27 Thread Nicholas Milkovits
Hi everyone, I've been reading through the documentation on extending and embedding python and the C API and I have a question about how allocation occurs of one type from another type. For example lets so I make to C module foo.c and bar.c and each has a python type. If I want to define a method

Re: Cross platform way of finding number of processors on a machine?

2007-10-04 Thread Nicholas Bastin
On 10/4/07, John <[EMAIL PROTECTED]> wrote: > > Is there a way to find the number of processors on a machine (on linux/ > windows/macos/cygwin) using python code (using the same code/cross > platform code)? There's no single call that will give you the same info on every platform, but you can obvi

Re: Python 3.0 migration plans?

2007-10-04 Thread Nicholas Bastin
On 9/27/07, Steve Holden <[EMAIL PROTECTED]> wrote: > I wondered if a straw poll could get some idea of readers' thoughts > about when they will be migrating to 3.0 on, so I used the new widget on > Blogger to add a poll for that. > > I'd appreciate if if you would go to > >http://holdenweb.blo

Re: Howto Launch a windows application ?

2007-10-04 Thread Nicholas Bastin
On 10/3/07, stef mientki <[EMAIL PROTECTED]> wrote: > hello, > > I'm trying to launch a windows application, > but as many others on this list, I've some trouble. > I read some other threads about this topic, > but sorry, I still don't understand all this (never heard of pipes). > > When I use a ba

Re: Real time plot

2007-10-04 Thread Nicholas Bastin
On 10/4/07, Jean-Francois Canac <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] > > I would draw dots on a suitably sized Tkinter canvas, after drawing a > > schematic > > of the race track (laborious). > > > > 20 per second will be no problem, provided the machine is half decent. > > > > What is th

Re: Cross platform way of finding number of processors on a machine?

2007-10-07 Thread Nicholas Bastin
On 10/6/07, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: > John <[EMAIL PROTECTED]> wrote: > > Is there a way to find the number of processors on a machine (on linux/ > > windows/macos/cygwin) using python code (using the same code/cross > > platform code)? > > >From processing

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-07 Thread Nicholas Bastin
On 05 Oct 2007 16:23:50 GMT, Stargaming <[EMAIL PROTECTED]> wrote: > On Fri, 05 Oct 2007 08:37:05 -0700, timw.google wrote: > >> I can't ssh w/o supplying a password. That's the way the security is > >> set up here. > >> > >> How do I use python to do this, or do I just have to write a zsh > >> scr

Re: Problem using subprocess.Popen on windows

2007-10-07 Thread Nicholas Bastin
On 10/7/07, jorma kala <[EMAIL PROTECTED]> wrote: > from subprocess import * > > p1 = Popen(["dir"], stdout=PIPE) > output = p1.communicate()[0] > > > But I get a WindowsError : [Error 2] File Not Found Tim answered your actual question, but why are you doing this in the first place? The Py

Re: pytz has so many timezones!

2007-10-08 Thread Nicholas Bastin
On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > What do you mean by "the military" and why do you think they're > > authoritative on the topic of timezones? > > Because they publish maps? I'm not sure what this has to do with it. > > but as far as I know they don't define timezones.

Re: pytz has so many timezones!

2007-10-09 Thread Nicholas Bastin
On 10/9/07, Sanjay <[EMAIL PROTECTED]> wrote: > > It's not clear at all from the OPs post exactly what functionality he > > is trying to derive from the timezone. Since timezones (obviously) > > contain more information than just the GMT offset (otherwise we > > wouldn't even have them), he may ver

Re: pytz has so many timezones!

2007-10-09 Thread Nicholas Bastin
On 10/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 8, 8:27?pm, "Nicholas Bastin" <[EMAIL PROTECTED]> wrote: > > On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Because they publish maps? > > > > I'm not

Re: Mixing Python and C classes in a module

2007-10-09 Thread Nicholas Bastin
On 10/9/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is it possible to mix classes defined in both Python and C in the same > > module? Ideally I would like to be able to do: > > > > from some.module import MyPythonCl

Re: C++ version of the C Python API?

2007-10-21 Thread Nicholas Bastin
On 10/21/07, Carl Banks <[EMAIL PROTECTED]> wrote: > Now, a C++ API for CPython would necessarily be built on top of the C > API, which carries some limitations relative to the OOP abilities of C++ > itself. It wouldn't have to be, although it'd be much more of a maintenance nightmare if it poked

Re: C++ version of the C Python API?

2007-10-21 Thread Nicholas Bastin
On 10/21/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > On 10/21/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > No, I literally meant that the Python C API is object-oriented. > > You don't need an object-oriented language to write object-oriented > > code. > > I disagree with this statement.

Re: Python on Leopard issues

2007-11-08 Thread Nicholas Bastin
On Nov 8, 2007 4:59 PM, Nicholas Bastin <[EMAIL PROTECTED]> wrote: > Also, Apple distributes the standard library in a zip file, so you > won't find all the packages just lying around. They should all be > stored in /Library/Frameworks/Python.framework/Versions/2.5/lib/python

Re: Python on Leopard issues

2007-11-08 Thread Nicholas Bastin
On Nov 8, 2007 4:13 PM, Chris <[EMAIL PROTECTED]> wrote: > Are others having fundamental issues on OSX 10.5 with python 2.5.1? I was > excited that Python 2.5 was included, but this excitement was very short > lived. Almost nothing works. Upon startup I get this message: > > 'import site' failed; u

Problem with Tkinter's scale function.

2009-02-09 Thread Nicholas Feinberg
Not the widget, the function in Canvas. So far as I can tell, integer values for scale work fine; you can scale something to a factor of 2, 3, 17, etc. Float values for scale - such as you might use if you were, say, trying to scale a rectangle to half its current size - also work, insofar as the t

Making extension modules play nice with help()?

2009-02-17 Thread Nicholas Bastin
I've always provided doc strings through PyMethodDef in the past, without paying much attention to what happens in help() - they print fine when you just use the doc string. However, in help, you end up with methods that have an indeterminate signature. We generally make doc strings that look lik

Where can we find top-notch python developers?

2006-03-18 Thread Nicholas Reville
a clear understanding of language concepts is important. Email: jobs[at]pculture.org Here it is online: http://www.getdemocracy.com/jobs/ Any suggestions would be really appreciated and sorry if this is off- topic! Thanks, nicholas -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython versus Tkinter.

2011-01-23 Thread Nicholas Devenish
Hi Adam, I'm still learning my way around wxPython and gui programming, been mostly linux and CLI since Visual Basic 5, and only recently started learning it. On 23/01/2011 18:09, Adam Skutt wrote: 1. There's a bug related to loading of your resources. 2. There's a bug related to when file I

Re: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish
On 25/01/2011 14:11, Littlefield, Tyler wrote: My preaching done with, I'd like to urge everyone to put this in a bit of perspective; essentially, what I don't want is someone walking away with Octavian's attitude as a stariotype for us all. I can't speak for everyone (I don't have that presump

Re: numpy/matlab compatibility

2011-01-25 Thread Nicholas Devenish
On 25/01/2011 20:13, Matt Funk wrote: 1) a = rand(10,1) 2) Y = a 3) mask = Y> 100; 4) Y(mask) = 100; 5) a = a+Y Basically i am getting stuck on line 4). I was wondering if it is possible or not with python? (The above is working matlab code) I don't understand this matlab code completely (I w

Re: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish
On 25/01/2011 19:24, Octavian Rasnita wrote: Can you tell why? Because you probably don't care about those who can't use the programs made with Tkinter or because you consider the discrimination something normal, right? And you said that it is not a good thing. Good thing for whom? For the bli

Re: WxPython versus Tkinter.

2011-01-25 Thread Nicholas Devenish
On 25/01/2011 19:16, CM wrote: On Jan 25, 10:13 am, Nicholas Devenish wrote: I don't know--you sound too reasonable to extrapolate from this goofy thread to a huge toolkit project that has been around for years and is used in project such as Audacity (that's the wxWidgets version,

Re: WxPython versus Tkinter

2011-01-25 Thread Nicholas Devenish
On 26/01/2011 00:40, Ian wrote: Are you referring to ticket #14081? I expect the reason this hasn't been addressed is because nobody has submitted a patch or suggested an improved wording. If you were to make a suggestion, I doubt that anybody would be hostile to the idea of improving the tutor

Re: WxPython versus Tkinter.

2011-01-26 Thread Nicholas Devenish
On 26/01/2011 18:19, rantingrick wrote: SUMMARY: We create an abstraction API atop "Robin's WxPython". We include only the API in the stdlib at this time and we keep Tkinter in maintenance. Then over the next few years we start a fresh wxPython project that will be acceptable for the stdlib. Some

Re: WxPython versus Tkinter.

2011-01-27 Thread Nicholas Devenish
On 28/01/2011 00:54, rantingrick AKA "Brian" wrote: Yes the minor details have been evolving over the course of this and another thread. We have been floating new ideas all along the way in an effort to get the best result. In the very beginning because we all know that wxPython IS HUGE i offered

Re: Easy function, please help.

2011-02-09 Thread Nicholas Devenish
On 09/02/2011 14:27, RJB wrote: What operator should I use if I want integer division? Ada and Pascal used "div" if I recall rightly. The operator for integer division is // -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create a dict based on such a file?

2011-02-14 Thread Nicholas Devenish
On 14/02/2011 19:25, Dan Stromberg wrote: pyparsing should be able to make pretty short work of exactly the format you want. FWIW, the creator of the many .ini format(s), Microsoft, no longer recommends using .ini files. I don't know what Microsoft uses now, but it seemed their immediate succ

Re: Problems of Symbol Congestion in Computer Languages

2011-02-19 Thread Nicholas Devenish
On 19/02/2011 07:41, Westley Martínez wrote: Simply remove 'dvorak-' to get qwerty. It allows you to use the right Alt key as AltGr. For example: AltGr+' i = í AltGr+c = ç AltGr+s = ß I don't work on Windows or Mac enough to have figured out how to do on those platforms, but I'm sure there's a s

Re: Problems of Symbol Congestion in Computer Languages

2011-02-19 Thread Nicholas Devenish
On 18/02/2011 10:26, Steven D'Aprano wrote: Agreed. I'd like Python to support proper mathematical symbols like ∞ for float('inf'), ≠ for not-equal, ≤ for greater-than-or-equal, and ≥ for less-than-or-equal. This would be joyful! At least with the subset of operations that already exist/exis

weakref.proxy behaviour in python 3.0

2010-08-21 Thread Nicholas Cole
() pobject = weakref.proxy(realobject) l = [pobject,] print(realobject in l) # On python 2.6 this prints False, on Python 3 True. Is this an expected change? Best wishes, Nicholas -- http://mail.python.org/mailman/listinfo/python-list

Re: weakref.proxy behaviour in python 3.0

2010-08-21 Thread Nicholas Cole
(the_real_object) b = weakref.proxy(the_real_object) this_list = [ a, ] l.remove(a) # Obviously works on both - just here for clarity. l.remove(the_real_object) # Fails on python 2.6 l.remove(b) # gives an empty list on python 2.6 and python 3. Very best wishes, Nicholas -- http://mail.python.org/mailman/listinfo/python-list

Python 2.7 module path problems on OS X

2010-09-05 Thread Nicholas Cole
/Versions/2.7/lib/python2.7/site-packages' Whereas on 2.6 on my system the default is the more extensive: '/Users/nicholas/Library/Python/2.6/site-packages/docutils-0.5-py2.6.egg', '/Users/nicholas/Library/Python/2.6/site-packages/py2app-0.4.3-py2.6.egg', '/User

Re: Python 2.7 module path problems on OS X

2010-09-05 Thread Nicholas Cole
on installed from python.org, but perhaps that recollection is wrong. At any rate, it doesn't work with python 2.7. Best wishes, Nicholas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7 module path problems on OS X

2010-09-06 Thread Nicholas Cole
On Sun, Sep 5, 2010 at 8:57 PM, Ned Deily wrote: > In article > , >  Nicholas Cole wrote: > >> On Sun, Sep 5, 2010 at 10:20 AM, Ned Deily wrote: >> > I'm not sure why you think it is broken.  The Apple 2.6 and the >> > python.org 2.7 have differ

Image Module

2005-04-12 Thread Nicholas S. Graham
I want to convert a field of 4:2:2 digital video data into a viewable format (.jpg or something) using the Image module. Any suggestions?? NG -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO with timezone

2008-01-28 Thread Nicholas F. Fabry
Hello, nik. On Jan 28, 2008, at 21:03, nik wrote: > Hi, > > How does one express the time in ISO format with the timezone > designator? > > what I want is -MM-DDThh:mm:ss.sTZD > >> From the documentation I see: from datetime import tzinfo, timedelta, datetime class TZ(tzinfo): > ...

Re: ISO with timezone

2008-01-29 Thread Nicholas F. Fabry
tzinfo object attached), you can do it simply by feeding .now the tzinfo object you want attached, as below: >>> print datetime.now(TZ()).isoformat('T') 2008-01-29T23:43:16.809049-05:00 See PSL, Sect. 5.1.4 Dates and Times are a bit ugly in Python. Don't be discoura

Improving datetime

2008-03-19 Thread Nicholas F. Fabry
This is a query for information as to how to proceed. I am not a professional programmer, but I use Python a great deal to help me in my main job, which involves designing schedules for a global airline. As such, I use datetime (and dateutil) extensively, and after much use, I have come t

Re: Improving datetime

2008-03-19 Thread Nicholas F. Fabry
On Mar 19, 2008, at 16:30, Christian Heimes wrote: > Nicholas F. Fabry schrieb: >> This is a query for information as to how to proceed. I am not a >> professional programmer, but I use Python a great deal to help me >> in my main job, which involves designing s

Re: Improving datetime

2008-03-19 Thread Nicholas F. Fabry
On Mar 19, 2008, at 18:32, Steven D'Aprano wrote: On Wed, 19 Mar 2008 17:40:39 -0400, Nicholas F. Fabry wrote: To summarize my proposal VERY briefly: - Make aware datetime objects display in local time, but calculate/ compare in UTC. Your proposal is ambi

Re: Improving datetime

2008-03-21 Thread Nicholas F. Fabry
On Mar 21, 2008, at 13:36, Christian Heimes wrote: > Colin J. Williams schrieb: >> You might consider adding the Julian date >> (http://en.wikipedia.org/wiki/Julian_date). >> >> I had a crack at this a while ago but didn't seem to get quire the >> right >> result, using the ACM algorithm. I se

Re: More elegant way to try running a function X times?

2008-11-19 Thread Nicholas Ferenc Fabry
On Nov 19, 2008, at 09:09, Gilles Ganault wrote: Hello As a newbie, it's pretty likely that there's a smarter way to do this, so I'd like to check with the experts: I need to try calling a function 5 times. If successful, move on; If not, print an error message, and exit the program: = s

<    1   2