On Oct 13, 7:45 am, Igor Mikushkin igor.mikush...@gmail.com 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
On Oct 13, 8:02 am, Matimus mccre...@gmail.com wrote:
On Oct 13, 7:45 am, Igor Mikushkin igor.mikush...@gmail.com 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
On Aug 28, 7:58 am, gb345 gb...@invalid.com 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
On Aug 20, 10:21 am, Tim Arnold tim.arn...@sas.com 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
On May 28, 11:17 am, Igor Katson descent...@gmail.com 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
On May 5, 9:25 am, Nick nic...@gmail.com wrote:
On May 5, 5:19 pm, Tim Golden m...@timgolden.me.uk 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
On Apr 8, 2:15 pm, PK superp...@gmail.com 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
On Feb 20, 8:12 am, ssd c...@d.com 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 lionel.ke...@gmail.com wrote:
On Feb 20, 3:52 pm, Chris Rebert c...@rebertia.com wrote:
On Fri, Feb 20, 2009 at 3:33 PM, Lionel lionel.ke...@gmail.com wrote:
Hello all:
I've crafted several classes and exceptions which I've stored in a
file called
On Feb 19, 8:06 pm, W. eWatson notval...@sbcglobal.net 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
On Feb 13, 8:06 am, Kurioz zpetel...@gmaljo.com 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
On Feb 4, 8:08 am, Gilles Ganault nos...@nospam.com 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
On Feb 3, 8:58 am, Djames Suhanko djames.suha...@gmail.com 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)
#
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. 'getopt'
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
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 method = +
On Jan 15, 1:39 pm, Per Freem perfr...@yahoo.com 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
On Jan 14, 8:50 am, r rt8...@gmail.com wrote:
On Jan 14, 10:44 am, Steve Holden st...@holdenweb.com 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
On Jan 6, 5:31 am, Casey casey...@gmail.com 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:
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 the
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 status (and thus potentially
breaking a 10+ years of existing
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 = {}
for region
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 class
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 the RE
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 method of
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 things
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
mistakenly pass
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 same
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, 34, 40, 44,
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 tt ff 2
b'. How to match text between the
g
On 31 ÏËÔ, 20:53, Matimus [EMAIL PROTECTED] wrote:
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
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 really know
the python
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
while
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 fine. I was
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 viewer a
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
libs in
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 still isn't
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 react
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 on
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), script, exec)
This fails when inspect can't get hold of the source of my_class,
for instance when my_class is in a pyc file.
Is there
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 origional
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
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
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 a
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 namespace.
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 able to
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 sets, and the fact that
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(foo):
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 periodically pull
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 bothered me. The main
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 possible in
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_zealand wrote:
In message
[EMAIL PROTECTED],
Matimus wrote:
That isn't
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.
Why should that be confusing? The most common tab-stop
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 foo():
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 when a
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 to
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 interactively entered
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?
depends on
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
--
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 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 runs?
You
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 original
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
replace
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 python
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 claling
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 the
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. I was writing a
class and wanted to return a list
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 list2 that are
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 something
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 (1) though).
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 an
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: %s,
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, 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 tell
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
the cursor dragging an image passes over it. I seem
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, it is
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.rb)
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 python app being able to get a returned value
from the ruby script
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 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 commas, I
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 can be a comma-less substring, or a
quoted string, or a substring which
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
similar
On Jun 17, 12:45 pm, Terrence Brannon [EMAIL PROTECTED] wrote:
Hello, I have written a program to draw a vescica piscis http://
en.wikipedia.org/wiki/Vesica_piscis
from turtle import *
def main():
setup(width=400, height=400)
r = 50
color(black)
circle(r)
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 are a
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 udnerstand why the second
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 determining
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 is using Pythons internal parser to parse the passed
in string
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 to subject
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 do the
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
--
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:
unsigned
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?
You
1 - 100 of 279 matches
Mail list logo