On Jun 5, 12:58 pm, maehhheeyy <[EMAIL PROTECTED]> wrote:
> I'm not sure what it means but it always highlights the last line with
> nothing on it. My program has 63 lines and it highlights the 64th
> line. This keeps popping up whenever I try to run my program. Can you
> please help me fix this?
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:
>
>
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 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 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, 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 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 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
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 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
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 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 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 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 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, 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 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 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 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 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 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 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, 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, 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 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 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 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 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, 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 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 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 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 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/
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, 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 -
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 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 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 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, 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, 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 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 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 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
> 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 Apr 8, 9:13 am, "Hutch" <[EMAIL PROTECTED]> wrote:
> We now have a float result when two integers are divided in the same mannor
> as 2.4 or 2.5.
> I can handle that and use the Floor division but a simple question.
>
> Why in the world would you round down the last presented digit to a 6
> inst
On Apr 11, 9:24 am, [EMAIL PROTECTED] wrote:
> This question was posed to me today. Given a C/C++ program we can clearly
> embed a Python interpreter in it. Is it possible to fire up multiple
> interpreters in multiple threads? For example:
>
> C++ main
> thread 1
> Py_In
On Apr 11, 2:32 am, Evan <[EMAIL PROTECTED]> wrote:
> Hope this hasn't been posted hundreds of times. I'm new for this.
>
> Before using python for this kind of script, I was using TCL to write
> down a "command line based" interactive program. it likes a "tclsh",
> or "python" command, after that
On Apr 15, 10:23 am, [EMAIL PROTECTED] wrote:
> As a relative new comer to Python, I haven't done a heck of a lot of
> hacking around with it. I had my first run in with Python's quirky (to
> me at least) tendency to assign by reference rather than by value (I'm
> coming from a VBA world so that's
On Apr 16, 9:26 am, [EMAIL PROTECTED] wrote:
> I had posted this before but all the spam whipped it out...
>
> I wanted to know if there's any way to create a method that takes a
> default parameter, and that parameter's default value is the return
> value of another method of the same class. For e
On Apr 18, 8:58 am, Aaron Watters <[EMAIL PROTECTED]> wrote:
> Why is the migration to py3k a concern?
> For example I have libraries which use string%dictionary
> substitution where the dictionary is actually an object
> which emulates a dictionary. The __getitem__ for
> the object can be very ex
On Apr 21, 12:05 pm, <[EMAIL PROTECTED]> wrote:
> I've been trying to figure out a way to combine lists similar to how zip()
> works. The main
> difference though is I want to work with different length lists and combine
> them. I came up with
> the example below, which returns a list like I'm
On Apr 21, 4:16 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Apr 21, 4:42 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Apr 21, 12:05 pm, <[EMAIL PROTECTED]> wrote:
>
> > > I've been trying to figure out a way to combi
On Apr 25, 7:03 am, Kirk Strauser <[EMAIL PROTECTED]> wrote:
> I want to subclass list so that each value in it is calculated at call
> time. I had initially thought I could do that by defining my own
> __getitem__, but 1) apparently that's deprecated (although I can't
> find that; got a link?), a
On Apr 28, 9:33 am, [EMAIL PROTECTED] wrote:
> I'm parsing a simple file and given a line's keyword, would like to call
> the equivalently named function.
>
> There are 3 ways I can think to do this (other than a long if/elif
> construct):
>
> 1. eval()
>
> 2. Convert my functions to methods and us
On Apr 29, 6:46 am, Julien <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm fairly new in Python and I haven't used the regular expressions
> enough to be able to achieve what I want.
> I'd like to select terms in a string, so I can then do a search in my
> database.
>
> query = ' " some words" with an
On Apr 29, 3:39 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Danny Shevitz schrieb:
>
>
>
> > Simple question here:
>
> > I have a multiline string representing the body of a function. I have
> > control
> > over the string, so I can use either of the following:
>
> > str = '''
> > print st
On May 1, 4:37 am, Lance Gamet <[EMAIL PROTECTED]> wrote:
> Hi, python beginner starting a new project here.
>
> This project will store most of its actual data in a shared-database, but
> I have a small amount of user specific data that I need to be stored like
> configuration or preferences for e
On May 1, 10:50 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On May 1, 11:46 pm, Carsten Haese <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yves Dorfsman wrote:
>
> > > In the following script, m1() and m2() work fine. I am assuming m2() is
> > > faster although I haven't checked that (loops through the
On May 2, 9:40 am, [EMAIL PROTECTED] wrote:
> Bad file names, i.e. filenames the OS considers illegal, will cause
> functions in the os.path module to raise an error.
>
> Example:
>
> import os.path
> print os.path.getsize( 'c:/pytest/*.py' )
>
> On Windows XP using Python 2.5.2 I get the following
On May 5, 10:22 am, Francesco Bochicchio <[EMAIL PROTECTED]> wrote:
> On Mon, 05 May 2008 00:35:51 -0700, sandipm wrote:
> > Hi,
> > In my application, I have some configurable information which is used
> > by different processes. currently I have stored configration in a
> > conf.py file as name=
On May 4, 11:35 pm, sandipm <[EMAIL PROTECTED]> wrote:
> Hi,
> In my application, I have some configurable information which is used
> by different processes. currently I have stored configration in a
> conf.py file as name=value pairs, and I am importing conf.py file to
> use this variable. it wo
On May 9, 3:19 pm, globalrev <[EMAIL PROTECTED]> wrote:
> i want to a little stringmanipulationa nd im looking into regexps. i
> couldnt find out how to do:
> s = 'poprorinoncoce'
> re.sub('$o$', '$', s)
> should result in 'prince'
>
> $ is obv the wrng character to use bu what i mean the pattern i
> 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
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
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 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 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 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
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 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
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 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
> 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 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
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 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 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 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 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
201 - 280 of 280 matches
Mail list logo