On Oct 13, 8:02 am, Matimus wrote:
> On Oct 13, 7:45 am, Igor Mikushkin wrote:
>
> > Hello all!
>
> > I'm a newbie to Python.
> > Could you please say me when it is better to derive from "object" and
> > when not?
>
> > Thanks,
> &g
On Oct 13, 7:45 am, Igor Mikushkin wrote:
> Hello all!
>
> I'm a newbie to Python.
> Could you please say me when it is better to derive from "object" and
> when not?
>
> Thanks,
> Igor
The only reason to derive from 'object' is if there is some sort of
weird side effect of using new style classe
On Aug 28, 7:58 am, gb345 wrote:
> Are there any Python-only modules or packages in the latest releases
> of Python 2.x or Python 3.x that were largely written by Guido van
> Rossum? What's the best way to find this out? I know that some
> modules mention the author(s) in the source code, but th
On Aug 20, 10:21 am, "Tim Arnold" wrote:
> Hi,
> I installed python2.6 to a netapp device. I can use it from my local windows
> machine (XP). But others cannot use it from their pcs.
>
> They get this response
> "The system cannot execute the specified program.".
>
> If they double click on python
On May 28, 11:17 am, Igor Katson wrote:
> I pretty much understand what they do, but what's the case of using
> these modules by example? Is it something like pickle, to store the data
> efficiently in files?
For one it provides a mechanism for reading and writing arbitrary file
formats. For exam
On May 27, 12:58 pm, imageguy wrote:
> I have an object the I would like to use as a base class. Some of the
> methods I would like to override completely, but others I would simply
> like to call the base class method and use the return value in the
> child method. The purpose here is to elimin
On May 5, 9:25 am, Nick wrote:
> On May 5, 5:19 pm, Tim Golden wrote:
>
>
>
> > Nick wrote:
> > > I have a requirement to read a CSV file. Normally, no problem, just
> > > import CSV and slurp the file up.
>
> > > However, in this case I want to filter out lines that have fields set
> > > to part
On Apr 8, 2:15 pm, PK wrote:
> So I'm trying to see whats the cleanest way to do this:
>
> I have a
>
> checklist = [ax, bx, by, cy ..] (a combination of a,b,c with x and y,
> either both on one)
>
> allist = [a,b,c,]
> xlist = [x, y, ..]
>
> now I wanna loop through alist and xlist and see i
On Feb 20, 8:12 am, "ssd" wrote:
> Hi,
>
> In the following code, (in Python 2.5)
> I was expecting to get in "b" variable the values b: [[0, 0], [0, 1],[0,
> 2], [0, 3],[0, 4], [1, 0],[1, 1], [1, 2], .]
> But I get only the last value [4,4], b: b: [[4, 4], [4, 4], [4, 4], ... ]
>
> My code:
On Feb 20, 3:56 pm, Lionel wrote:
> On Feb 20, 3:52 pm, Chris Rebert wrote:
>
>
>
> > On Fri, Feb 20, 2009 at 3:33 PM, Lionel wrote:
> > > Hello all:
>
> > > I've crafted several classes and exceptions which I've stored in a
> > > file called "DataFileType.py". I then invoke them from within oth
On Feb 19, 8:06 pm, "W. eWatson" wrote:
> I'm using IDLE for editing, but execute programs directly. If there are
> execution or "compile" errors, the console closes before I can see what it
> contains. How do I prevent that?
> --
> W. eWatson
>
> (121
On Feb 13, 8:06 am, "Kurioz" wrote:
> Hi,
>
> I got the assignment to solve the knapsack problem in Python. I have to find
> the solution to put items in a sack (I have only one item A, B and C) which
> maxWeight can't be larger than 6 kilograms. Solution of this problem should
> be A and C but t
On Feb 4, 8:08 am, Gilles Ganault wrote:
> Hello
>
> If I wanted to build some social web site such as Facebook, what do
> frameworks like Django or TurboGears provide over writing a site from
> scratch using Python?
>
> Thank you for your feedback.
Why not just look at the frameworks themselves
On Feb 3, 8:58 am, Djames Suhanko wrote:
> Hello, programmers!
> I would like to do a menu bar like kicker or windows menu. is possible?
>
> --
> Djames Suhanko
> LinuxUser 158.760
Maybe you are looking for this?
import Tkinter
rt = Tkinter.Tk()
rt.overrideredirect(True)
# do stuff
Matt
--
> I did all the requisite reading and found that I should use optparse
> instead of getopt. I read the documentation and since the words
> "simple" and "easy" often appeared in the examples and documentation, I
> just knew that it would be a snap to implement.
I don't know where you got that. 'g
The goals are listed here:
http://codespeak.net/pypy/dist/pypy/doc/architecture.html
Speed is mentioned, but as a secondary concern. The main goal seems to
be to create a vehicle into exploring the concept of dynamic languages
themselves. If that seems amorphous then it is because it is a
researc
On Jan 15, 1:39 pm, Per Freem wrote:
> hello
>
> i have an optimization questions about python. i am iterating through
> a file and counting the number of repeated elements. the file has on
> the order
> of tens of millions elements...
>
> i create a dictionary that maps elements of the file that
On Jan 15, 8:23 am, thomas.steffe...@googlemail.com wrote:
> Hello,
>
> I have a Class:
>
> class myClass:
> def __init__(self):
> # do something
> print "name of class = " + self.__class__.__name__
>
> def myMethod(self):
> # do something
> print "name of m
On Jan 14, 8:50 am, r wrote:
> On Jan 14, 10:44 am, Steve Holden wrote:
>
> > Thous it does seem particularly perverse to have the add method not
> > itself return a Point.
>
> Thanks Steve,
> i was going implement exactly this but thought there "might" be a
> better way i did not know about. So
On Jan 6, 5:31 am, Casey wrote:
> In PEP 3104 the nonlocal statement was proposed and accepted for
> implementation in Python 3.0 for access to names in outer scopes. The
> proposed syntax included an optional assignment or augmented
> assignment to the outer name, such as:
>
> nonlocal x += 1
>
On Dec 8, 8:08 pm, Roy Smith <[EMAIL PROTECTED]> wrote:
> I've got a class with a class variable:
>
> class Foo:
> _map = {}
>
> How do I make sure this only gets initialized the *first* time the
> module containing the class is imported? What appears to be happening
> as it stands is each time
On Dec 4, 6:08 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Wed, 03 Dec 2008 17:15:21 -0800, Matimus wrote:
> >> Couldn't we have continued along just fine using a smarter parser
> >> without elevating "as" to reserved
> What I want to understand is why this parser change was necessary in
> order to enable new 2.6/3.0 features. Was this change potentially
> avoidable?
Does it really matter? The change occurred and it isn't going to go
back. What you should be asking yourself is whether the affect it had
on your
On Dec 2, 3:51 am, [EMAIL PROTECTED] wrote:
> I forgot to mention that I did a simple timeit test which doesn't
> show
> significant runtime difference 3.5 sec for dictionary case and 3.48
> for
> list case.
>
> def read_as_dictionary():
> fil = open('myDataFile', 'r')
> forces = {}
> f
On Nov 21, 2:11 pm, Joe Strout <[EMAIL PROTECTED]> wrote:
> I have a function that takes a reference to a class, and then
> instantiates that class (and then does several other things with the
> new instance). This is easy enough:
>
> item = cls(self, **itemArgs)
>
> where "cls" is the cla
On Nov 20, 4:31 pm, Ben <[EMAIL PROTECTED]> wrote:
> I apologize in advance for the newbie question. I'm trying to figure
> out a way to find all of the occurrences of a regular expression in a
> string including the overlapping ones.
>
> For example, given the string 123456789
>
> I'd like to use
On Nov 14, 11:41 am, "Eric S. Johansson" <[EMAIL PROTECTED]> wrote:
> in trying to make programming in Python more accessible to disabled
> programmers
> (specifically mobility impaired speech recognition users), and hitting a bit
> of
> a wall. The wall (for today) is indentation. I need a met
On Nov 13, 9:16 am, Joe Strout <[EMAIL PROTECTED]> wrote:
> One thing I miss as I move from REALbasic to Python is the ability to
> have static storage within a method -- i.e. storage that is persistent
> between calls, but not visible outside the method. I frequently use
> this for such thi
On Nov 12, 7:06 am, Joe Strout <[EMAIL PROTECTED]> wrote:
> Let me preface this by saying that I think I "get" the concept of duck-
> typing.
>
> However, I still want to sprinkle my code with assertions that, for
> example, my parameters are what they're supposed to be -- too often I
> mistake
> Yes but in the other hand
> :http://docs.python.org/library/logging.html#logger-objects
> "Note that Loggers are never instantiated directly, but always through
> the module-level function logging.getLogger(name)."
That is part of the power of the logging module. If you ask for a
logger of the
On Nov 4, 11:20 am, Gilles Ganault <[EMAIL PROTECTED]> wrote:
> Hello
>
> I need to call a URL through a loop that starts at 01 and ends at 99,
> but some of the steps must be ignored:
>
> =
> url = "http://www.acme.com/list?code=";
> p = re.compile("^(\d+)\t(.+)$")
>
> for i=01 to 99 except 04
rst " b < Ó > d " and then " e < f > g " but not "
> b < Ó > d > here starts a new group: < e < f > g "
> On 31 ÏËÔ, 20:53, Matimus <[EMAIL PROTECTED]> wrote:
>
> > On Oct 31, 10:25šam, netimen <[EMAIL PROTECTE
On Oct 31, 10:25 am, netimen <[EMAIL PROTECTED]> wrote:
> I have a text containing brackets (or what is the correct term for
> '>'?). I'd like to match text in the uppermost level of brackets.
>
> So, I have sth like: ' 123 < 1 aaa < t bbb < a ff > > 2 >
> b'. How to match text between the
On Oct 30, 2:10 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 30, 2008 at 8:42 PM, Arnaud Delobelle
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > On Oct 30, 8:07 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote:
> >> Hi all,
>
> >> I guess this is a recurring issue for someone who doesn't re
On Oct 25, 1:42 pm, [EMAIL PROTECTED] wrote:
> Hi. I'm very new to Python, and so this is probably a pretty basic
> question, but I'm lost. I am looking to limit a float value to a
> number between 0 and 100 (the input is a percentage).
>
> I currently have:
>
> integer = int()
> running = True
>
>
On Oct 24, 1:44 pm, Mr.SpOOn <[EMAIL PROTECTED]> wrote:
> Hi,
> in an application I have to use some variables with fixed valuse.
>
> For example, I'm working with musical notes, so I have a global
> dictionary like this:
>
> natural_notes = {'C': 0, 'D': 2, 'E': 4 }
>
> This actually works fin
On Oct 23, 7:58 am, "Werner F. Bruhin" <[EMAIL PROTECTED]> wrote:
> I am starting to use the logging module.
>
> Simple log to file and/or console work very nicely.
>
> Even managed to get TimedRotatingFileHandler to work.
>
> The problem I am trying to solve.
>
> 1. I would like to have a "log vie
On Oct 16, 10:58 am, Henrik <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We are upgrading from Python 2.3 to verion 2.5 and when we recompile
> we get ImportError.
>
> To test we took the spam example from the web documentation and
> compiled it with Py23 and it imports without a problem. Changing the
> li
> So is iterating through dir() to force both the members of dir(), and
> the requested attribute name, to lower case for a comparison, really
> the easiest way?
>
> Thanks again for sticking with me. I hope I didn't add to the
> confusion. What I learn I will of course pass on.
>
> - Rafe
It stil
> Python 2.5 and 2.6 can coexist, so there isn't any need for some
> kind of upgrade procedure. Installing 2.6 will not affect your
> 2.5 installation.
That isn't entirely true. In Windows, python files bound to a
particular version of python in the registry. So, for example, if you
double click o
On Oct 13, 4:08 am, Rafe <[EMAIL PROTECTED]> wrote:
> Just so I don't hijack my own thread, the issue is 'how to wrap an
> object which is not case sensitive'.
>
> The reason I am stuck dealing with this?... The application's API is
> accessed through COM, so I don't know if I can do anything but r
On Oct 10, 5:50 am, Okko Willeboordse <[EMAIL PROTECTED]>
wrote:
> To get the "code object" c of my_class I can do;
>
> c = compile(inspect.getsource(my_class), "
On Oct 8, 8:43 am, Dave <[EMAIL PROTECTED]> wrote:
> With the open source licenses that allow redistribution of modified
> code, how do you keep someone unaffiliated with the Python community
> from creating his or her own version of python, and declaring it to be
> Python 2.6, or maybe Python 2.7
On Oct 2, 1:16 pm, process <[EMAIL PROTECTED]> wrote:
> Let's say I have a class X which has 10 methods.
>
> I want class Y to inherit 5 of them.
>
> Can I do that? Can I do something along the lines of super(Y, exclude
> method 3 4 7 9 10) ?
I think the noral way of doing that is to split the ori
On Sep 30, 4:20 pm, Eric <[EMAIL PROTECTED]> wrote:
> I've been wanting to learn Python for a while now but I can't decide
> on whether to wait for Python 3's final release and learn it or just
> go ahead and learn 2.x. Would it be hard to make the transition being
> a noob?
It shouldn't be a hard
> The book "Code Complete" recommends that you put only one class in a
> source file, which seems a bit extreme for me. It seems that many
> classes are small, so that putting several of them in a file seems
> reasonable. I noticed that the decimal.py module in the standard
> library has several c
On Sep 26, 12:56 pm, Strato <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I think I do something wrong, but I don't see why it doesn't work, so I
> will explain:
>
> I've searched in the list archive and found this thread, that explain
> exactly what I want to have: the options strings returned by
> C
On Sep 22, 2:31 pm, [EMAIL PROTECTED] wrote:
> hi all,
>
> forgive me , but the RTFM and Google search approaches are not
> yielding an answer on this question. I need to know if there's a top
> level python interpreter command that clears all user variables (not
> built-ins) from the global names
On Sep 21, 3:39 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> I have a class which is not intended to be instantiated. Instead of using
> the class to creating an instance and then operate on it, I use the class
> directly, with classmethods. Essentially, the class is used as
I'm assuming you read at least some of the docs. This page makes it
pretty clear:
http://docs.python.org/lib/optparse-default-values.html
Matt
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 10, 1:52 pm, geoffbache <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I recently needed to parse a file that was perfect for ConfigParser
> apart from one thing: the elements in the sections, although
> definitions, could in some cases clash with each other and therefore
> it was important to be
On Sep 8, 12:32 am, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> mathieu a écrit :
>
> > Hi there,
>
> > I am trying to write something very simple to test if a list
> > contains another one:
>
> > a = [1,2,3]
>
> > b = [3,2,1,4]
>
> > but 'a in b' returns False.
>
> Indeed. Lists are not set
On Sep 3, 12:09 pm, Scott <[EMAIL PROTECTED]> wrote:
> Let's say I have an object:
>
> class foo():
> def create_another()
> return foo()
>
> def blah():
> x = self.create_another()
> ... do something with X
>
> Now I create a inherited class of this object:
>
> class bar
On Aug 28, 3:09 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote:
> On Thu, Aug 28, 2008 at 6:51 PM, Fett <[EMAIL PROTECTED]> wrote:
> > I am creating a program that requires some data that must be kept up
> > to date. What I plan is to put this data up on a web-site then have
> > the program periodi
On Aug 28, 3:05 pm, "W. eWatson" <[EMAIL PROTECTED]> wrote:
> I read an Amazon of Python in a Nutshell. The first edition is supposedly
> much like the web site. What web site? The second edition apparently adds
> more to the book than the web site.
O'Reilly seems to just read all of the available
> Do we have python one-liner like perl one-liner 'perl -e'??
The answer is python -c...
but python -h is useful too.
Matt
--
http://mail.python.org/mailman/listinfo/python-list
> Maybe the following syntax would be even more intuitive:
>
> def foo(a: "a info", b: "b info") return "ret info" raise "exc info":
> return "hello world"
>
> I don't know how determined the "->" syntax is already.
That seems much more intuitive and extensible. The "->" syntax has
always
On Aug 9, 9:08 am, Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
> I'm just reading PEP 3107 (function annotations) and wonder why
> exceptions are not mentioned there. I think it would be helpful if one
> could specify which exceptions can be raised by a function, similarly to
> how it is possibl
On Jul 24, 9:32 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> In message
> <[EMAIL PROTECTED]>, Matimus
> wrote:
>
> > On Jul 24, 2:54 am, Lawrence D'Oliveiro <[EMAIL PROTECTED]
> > central.gen.new_zeala
On Jul 24, 2:54 am, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> In message
> <[EMAIL PROTECTED]>,
>
> Matimus wrote:
> > That isn't the standard. With that setup tabs will show up as 4
> > spaces, and still confuse you.
>
On Jul 22, 2:02 pm, ptn <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I have a weird problem. Say I have a .py file with some functions in
> it, like this:
>
> # (...)
> def foo():
> print("bar")
>
> When I open it and add a line to one of the functions,
>
> # (...)
> def
On Jul 22, 4:27 pm, Clay Hobbs <[EMAIL PROTECTED]> wrote:
> I am making a program that (with urllib) that downloads two jpeg files
> and, if they are different, displays the new one. I need to find a way
> to compare two files in Python. How is this done?
>
> -- Ratfink
Do you just want to check
On Jul 22, 9:26 am, Catherine Heathcote
<[EMAIL PROTECTED]> wrote:
> If I create a new class inherited from another with a constructor, what
> happens with the new class's constructer?
> Thanks for your time.
Nothing, unless you call it in your constructor.
class Base(object):
def __init__(self)
On Jul 22, 8:12 am, Frank Millman <[EMAIL PROTECTED]> wrote:
> Hi all
>
> I am familiar enough with the normal use of 'import'. However, I have
> found a use for it which seems effective, but I have not seen it used
> like this before, so I am not sure if there are any downsides.
>
> I know that wh
On Jul 15, 4:28 pm, "Joel Koltner" <[EMAIL PROTECTED]>
wrote:
> "Sion Arrowsmith" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
>
> > What's wrong with sys.argv ?
>
> Mainly that it doesn't exist. :-) The example was slightly contrived -- I'm
> really dealing with commands inter
On Jul 15, 12:44 pm, "Victor Noagbodji" <[EMAIL PROTECTED]>
wrote:
> >>what's the difference between these two statement?
> >one checks if the given object is not None, the other checks if it's a true
> >value:
> >http://docs.python.org/ref/Booleans.html#Booleans
> >>And which one should one use?
On Jul 14, 6:33 pm, "Joel Koltner" <[EMAIL PROTECTED]>
wrote:
> I normally use str.split() for simple splitting of command line arguments, but
> I would like to support, e.g., long file names which-- under windows -- are
> typically provided as simple quoted string. E.g.,
>
> myapp --dosomething -
I think I'm going to create a new issue in Pythons issue database, but
I wanted to run it by the news group first. See if I can get any
useful feed back.
The following session demonstrates the issue:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on
win32
Type "help"
On Jul 14, 8:11 am, greg <[EMAIL PROTECTED]> wrote:
> Is there any way to capture the entire window? specifically
> the scrolled portion of a window that is _not_visible_on_the_screen_.
I don't think there is. That is why it is called a _screen_ capture.
Matt
--
http://mail.python.org/mailman/
On Jul 7, 2:56 pm, korean_dave <[EMAIL PROTECTED]> wrote:
> From command Prompt, i type in a script, "tryme.py".
>
> This, instead, brings up PythonWin editor and Interactive Window.
>
> Path variable is "C:\Python24". (I need Python 2.4 installed, not 2.5)
>
> How do I make it so that the script
On Jul 1, 12:35 pm, Tobiah <[EMAIL PROTECTED]> wrote:
> list.append([1,2]) will add the two element list as the next
> element of the list.
>
> list.extend([1,2]) is equivalent to list = list + [1, 2]
> and the result is that each element of the added list
> becomes it's own new element in the orig
On Jun 30, 9:55 am, [EMAIL PROTECTED] wrote:
> Is there any way to type into a Tkinter frame window?
> I want to use raw_input() within a Tkinter frame.
`raw_input(prompt)` just calls `sys.stdout.write(prompt)` and returns
`sys.stdin.readline()`. So, you can just create file-like objects to
replac
On Jun 26, 8:13 pm, defn noob <[EMAIL PROTECTED]> wrote:
> I installed python30 and so command prompt runs all pythonprograms
> through that which i didnt want so i uninstalled it.
>
> now i cant start any pythonprograms through the commandprompt.
>
> how do I "rebind" python25 to luanch when clali
On Jun 27, 8:22 am, Tim Spens <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've been trying to get an example found
> herehttp://codeidol.com/python/python3/Embedding-Python/Registering-Callb...
> to work. Every thing works fine except when I try to trigger an event from c
> that will call a pyth
On Jun 26, 7:41 am, [EMAIL PROTECTED] wrote:
> Hello. I am a novice programmer and have a question
>
> I have a configuration file(configuration.cfg)
> I read this from reading.py using ConfigParser
> When I use ConfigParser.get() function, it returns a string.
> I want to call a function that has
On Jun 25, 2:37 pm, idiolect <[EMAIL PROTECTED]> wrote:
> Hi all - Sorry to plague you with another newbie question from a
> lurker. Hopefully, this will be simple.
>
> I have a list full of RGB pixel values read from an image. I want to
> test each RGB band value per pixel, and set it to somethi
On Jun 25, 2:55 am, antar2 <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am a beginner in Python and am not able to use a list element for
> regular expression, substitutions.
>
> list1 = [ 'a', 'o' ]
> list2 = ['star', 'day', 'work', 'hello']
>
> Suppose that I want to substitute the vowels from list
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote:
> On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > > I think it would be useful if iterators on sequences had the __index__
> > > method so that they could be used to slice sequences.
On Jun 24, 2:35 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Quote from the docs:
>
> FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
> logging.basicConfig(format=FORMAT)
> d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
> logging.warning("Protocol problem:
On Jun 24, 3:29 pm, schickb <[EMAIL PROTECTED]> wrote:
> I think it would be useful if iterators on sequences had the __index__
> method so that they could be used to slice sequences. I was writing a
> class and wanted to return a list iterator to callers. I then wanted
> to let callers slice from
On Jun 24, 12:26 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Ulrich Eckhardt wrote:
> > What I'm surprised is that this isn't supported:
>
> > "%(1)s %(2)s" % ("zero", "one", "two")
>
> > i.e. specifying the index in a sequence instead of the key into a map (maybe
> > I would use [1] instead of
On Jun 23, 11:52 am, python_newbie <[EMAIL PROTECTED]> wrote:
> I don't know this list is the right place for newbie questions. I try
> to implement insertion sort in pyhton. At first code there is no
> problem. But the second one ( i code it in the same pattern i think )
> doesn't work. Any ideas
On Jun 20, 11:10 am, Matimus <[EMAIL PROTECTED]> wrote:
> On Jun 20, 9:11 am, Peter Pearson <[EMAIL PROTECTED]> wrote:
>
> > Tkinter makes it very easy to drag jpeg images around on a
> > canvas, but I would like to have a "target" change color when
> &g
On Jun 20, 9:11 am, Peter Pearson <[EMAIL PROTECTED]> wrote:
> Tkinter makes it very easy to drag jpeg images around on a
> canvas, but I would like to have a "target" change color when
> the cursor dragging an image passes over it. I seem to be
> blocked by the fact that the callbacks that might
On Jun 19, 4:27 pm, godavemon <[EMAIL PROTECTED]> wrote:
> I need to calculate the Hamming Distance of two integers. The hamming
> distance is the number of bits in two integers that don't match. I
> thought there'd be a function in math or scipy but i haven't been able
> to find one. This is my
On Jun 19, 4:00 pm, Matimus <[EMAIL PROTECTED]> wrote:
> On Jun 18, 8:33 pm, "bruce" <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi...
>
> > can someone point me to where/how i would go about calling a ruby app from a
> > python app, and having the
On Jun 18, 8:33 pm, "bruce" <[EMAIL PROTECTED]> wrote:
> hi...
>
> can someone point me to where/how i would go about calling a ruby app from a
> python app, and having the python app being able to get a returned value
> from the ruby script.
>
> something like
>
> test.py
> a = os.exec(testruby.r
On Jun 19, 2:06 pm, kj <[EMAIL PROTECTED]> wrote:
> I'm a Python noob, and haven't yet figured out my way around the
> Python documentation.
>
> For example, suppose I learn about some great module foo.bar.baz,
> and when I run the python interpreter and type "import foo.bar.baz",
> lo and behold,
On Jun 16, 1:37 am, Armin Ronacher <[EMAIL PROTECTED]>
wrote:
> Abstract
>
>
> This PEP proposes an ordered dictionary as a new data structure for
> the ``collections`` module, called "odict" in this PEP for short. The
> proposed API incorporates the experiences gained from working with
>
On Jun 18, 10:54 am, Matimus <[EMAIL PROTECTED]> wrote:
> On Jun 18, 10:19 am, Robert Dodier <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > I'd like to split a string by commas, but only at the "top level" so
> > to speak. An element
On Jun 18, 10:19 am, Robert Dodier <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'd like to split a string by commas, but only at the "top level" so
> to speak. An element can be a comma-less substring, or a
> quoted string, or a substring which looks like a function call.
> If some element contains com
On Jun 17, 12:45 pm, Terrence Brannon <[EMAIL PROTECTED]> wrote:
> Hello, I have written a program to draw a vescica piscis en.wikipedia.org/wiki/Vesica_piscis>
>
> from turtle import *
>
> def main():
> setup(width=400, height=400)
>
> r = 50
> color("black")
> circle(r)
> col
When and why would I ever use
> "__main__" or the many other "__whatever__" constructs?
You don't generally use those names directly, they are 'magic'. The
__add__ example is a good one. When you do `"hello " + "world"` behind
the scenes python is actually calling "hello ".__add__("world").
There
On Jun 13, 11:38 am, Mike Kent <[EMAIL PROTECTED]> wrote:
> For Python 2.5 and new-style classes, what special method is called
> for mylist[2:4] = seq and for del mylist[2:4] (given that mylist is a
> list, and seq is some sequence)?
>
> I'm trying to subclass list, and I'm having trouble determin
On Jun 13, 8:07 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> cirfu schrieb:
>
> > for i in xrange(0, len(texts)):
> > texts[i] = "yes"
>
> > for i in texts:
> > i = "no"
>
> > why is the first one working but not the second. i mean i see why the
> > firts one works but i dont udn
On Jun 11, 9:16 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 11, 8:15 pm, bvdp <[EMAIL PROTECTED]> wrote:
>
>
>
> > Matimus wrote:
>
> > > The solution I posted should work and is safe. It may not seem very
> > > readable, but it i
On Jun 11, 4:38 pm, bvdp <[EMAIL PROTECTED]> wrote:
> I'm finding my quest for a safe eval() quite frustrating :)
>
> Any comments on this: Just forget about getting python to do this and,
> instead, grab my set of values (from a user supplied text file) and call
> an external program like 'bc' to
On Jun 11, 1:25 pm, bvdp <[EMAIL PROTECTED]> wrote:
> Is there a simple/safe expression evaluator I can use in a python
> program. I just want to pass along a string in the form "1 + 44 / 3" or
> perhaps "1 + (-4.3*5)" and get a numeric result.
>
> I can do this with eval() but I really don't want
On Jun 10, 12:53 pm, maehhheeyy <[EMAIL PROTECTED]> wrote:
> this is stopping my program from running properly. is there something
> wrong in my code when that happens?
yes
Post your code, or at least the full error message if you want more
details.
Matt
--
http://mail.python.org/mailman/listinf
On Jun 9, 2:00 pm, Skye <[EMAIL PROTECTED]> wrote:
> Writing this app in Python, not sure what the "best practice" would
> be.
>
> I want a bitfield global logging level that allows me to turn specific
> debugging modules on and off. If I was doing this in C, I'd just use
> some globals like:
>
>
1 - 100 of 280 matches
Mail list logo