For example, if I were to have the code
randomlist = ["1", "2", "3", "4"]
And I want to count the distance between strings "1" and "4" which is
3, what command can I use to do this?
--
http://mail.python.org/mailman/listinfo/python-list
I'm pretty new to Python, but this has really bugged me. I can't find a
way around it.
The problem is that, when I use raw_input("sajfasjdf") whatever, or
input("dsjfadsjfa"), you can only have numerical values as answers.
Any help would be appreciated. Thanks.
--
http://mail.python.org/mail
Collin wrote:
I'm pretty new to Python, but this has really bugged me. I can't find a
way around it.
The problem is that, when I use raw_input("sajfasjdf") whatever, or
input("dsjfadsjfa"), you can only have numerical values as answers.
Any help would be appr
Gabriel Genellina wrote:
En Mon, 12 May 2008 01:54:28 -0300, Collin <[EMAIL PROTECTED]> escribió:
Collin wrote:
I'm pretty new to Python, but this has really bugged me. I can't find a
way around it.
The problem is that, when I use raw_input("sajfasjdf") whatever, o
Kam-Hung Soh wrote:
On Wed, 14 May 2008 11:02:36 +1000, Collin <[EMAIL PROTECTED]> wrote:
Gabriel Genellina wrote:
En Mon, 12 May 2008 01:54:28 -0300, Collin <[EMAIL PROTECTED]>
escribió:
Collin wrote:
I'm pretty new to Python, but this has really bugged me. I can't
Dave Parker wrote:
I've read that one of the design goals of Python was to create an easy-
to-use English-like language. That's also one of the design goals of
Flaming Thunder at http://www.flamingthunder.com/ , which has proven
easy enough for even elementary school students, even though it is
Dave Parker wrote:
On May 20, 7:05 pm, Collin <[EMAIL PROTECTED]> wrote:
Personally, FT is a bit meh to me. The way you issue your statements I
always think something is wrong, mainly because when I want to define,
say, x, in python I'd go:
x = "whatever"
Instantly no
a7labnt wrote:
برنامج VMware Workstation 6.0
http://www.antya7la.com/vb/t26858.html#post286993
برنامج يعالج فيروسات auto run و folder option
http://www.antya7la.com/vb/t26859.html#post286996
ضع صورتك داخل هذة الساعة
http://www.antya7la.com/vb/t26860.html#post286997
زيد سرعة ال Ftp ؟ 64 % +
George Sakkis wrote:
On Jun 12, 12:29 am, Collin <[EMAIL PROTECTED]> wrote:
a7labnt wrote:
Is this arabic spam?
Why, are you curious how V1agr@ or [EMAIL PROTECTED] are spelled in arabic ?
No, it's just I've never seen something like it. Quite funny, tbh.
--
http://mail.py
Hi all,
I am using python 3.2 on an amd64 Gentoo system. I was trying to
compile an unofficial version of PIL to work in 3.2 that I found here:
http://www.lfd.uci.edu/~gohlke/pythonlibs
Anyway, when I run the setup.py to compile the source, it doesn't pick
up tkinter, zlib, or freetype. Wh
Hi all,
I have a question about python 3.2 distutils on a Gentoo amd64 system.
When I open an ipython session and import distutils.unixcompiler and
then check the shared library extension with
UnixCCompiler.shared)lib_extension, it returns '.so', as I would
expect. When I run a setup.py in
ould be easily fixable).
If this gets a good response, I'll kick it up to python-dev.
Thanks,
Collin Winter
[1] http://mail.python.org/pipermail/python-list/2002-May/103613.html
[2] http://www.python.org/doc/2.4.1/ref/naming.html
--
http://mail.python.org/mailman/listinfo/python-list
On 9/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Collin Winter wrote:
>
> > As it currently stands, the type of the global __builtins__ differs
> > depending on whether you're in the __main__ namespace (__builtins__ is
> > a module) or not (its a dict)
tter issuing a deprecation warning for a
while. My tests indicate that this is possible, with both module.attr
and module['item'] forms available.
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
is indicates that, at the very
least, users should be explicitly told -- up front, in the official
documentation -- that they shouldn't ever touch __builtins__. Maybe
__builtins__ could be removed entirely from Py3.0, thus bringing
reality in to sync with policy.
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
elopment
> process. ;-)
I'm relatively new to the python-dev world, but I intend to do what I
can to eliminate blemishes like __builtins__.
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
dding them directly to the instance doesn't get you a
subscriptable object. This is because the interpreter looks at the
methods defined by the class, rather than the instance's attributes.
Just a word of caution.
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
d in the C
implementation.
+ The test suite has been enhanced to do reference count checking
after each test, making it much easier to track down future errors in
the C implementation.
+ The C implementation now supports Python 2.3, in addition to 2.4 and 2.5
As always, feedback welcome!
Collin Winte
It is not documented which of these tests takes priority: is the
classmethod "a test method within a test case class" or is it a
callable? The same issue applies to staticmethods as well.
Once I get answers to these questions, I can finish off the last few
bits of the test suite and h
Attached is a PEP which I will be proposing soon. If you have any questions,
comments, or suggestions, please email them to me with the subject "Adding
Built-in Class Attributes PEP"
PEP: XXX
Title: Adding Built-in Class Attributes
Version: $Revision$
Last-Modified: $Date$
Author: Col
Hello,Is there a Python equivalent to creating "reference" or "pointer"-type variables as in C++?? I'm trying to create a couple classes that have something like a container-and-iterator relationship; one class acts as a data resource (container-like) and can be queried by multiple control classes
the C
implementation. Also, a number of functions were removed, as I had
unknowingly duplicated a lot of functionality from the itertools
module.
As always, feedback welcome!
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
ied installing the package in all sorts of ways and haven't
been able to reproduce this problem. I'm guessing that somewhere in
your setuptools configuration, however, that there's a config file
passing --multi-version or --install-dir without your knowledge. Do
you get this same message when installing other Python packages?
Thanks,
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
On 10 Feb 2006 19:57:48 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Collin Winter wrote:
> > As always, feedback welcome!
>
> Any specific reason flip only flip the first 2 arguments rather than
> the whole tuple ?
>
> That is, I would like to see:
&g
r.com/code/svnmock/.
As always, feedback welcome!
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone know how to directly handle memory using python?
I want to be able, for example, to copy the actual contents of a memory
address, or set the actual contents of a memory address.
Here is an example of what I would like to be able to do:
num=12
addr=id(num)
contents=(hex(addr)).read(2)
Thanks. I didn't know about ctypes.
--
http://mail.python.org/mailman/listinfo/python-list
One last thing. Does anyone know how to take a python object and measure how
much space it is taking up in memory? I'm thinking probably not, but it's
worth asking.
--
http://mail.python.org/mailman/listinfo/python-list
ing list volume and
documentation size.)
In light of this PEP, PEP 3107's function annotations should be
rejected. All that hippie feel-good crap about "user-defined
annotations" and "open-ended semantics" and "no rules, man" was just
going to get us into trouble. This PEP's more modern conception of
type annotations give the language a power and expressiveness that my
PEP could never hope to match.
This is clearly a move in the right direction. +4 billion.
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
so get two strings: only headers, and the whole message.
find the length of the headers, and chop that off the beginning of the whole
message:
message=whole_message[len(headers):None]
You can omit the word None: it is just there for clarity purposes.
On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL
I don't know what is wrong with your code yet, but first you should clean it
up. Either replace those backslashes with forward slashes, or put r before
the first quote in the path string. This prevents special characters from
being evaluated as such.
Second, you should debug a little. Feel free t
That *shouldn't* be the problem, since files are iterable
On 5 Apr 2007 11:18:50 -0700, anglozaxxon <[EMAIL PROTECTED]> wrote:
On Apr 5, 2:01 pm, [EMAIL PROTECTED] wrote:
> What I am trying to do is compare two files to each other.
>
> If the 2nd file contains the same line the first file conta
As for me, I find this problem annoying, but easy to solve. My solution is:
this=__import__(__name__)
To set global variable spam to 4, I say:
this.spam=4
This always works, and is much more convenient than:
global spam
spam=4
and then worry about local variables also named spam.
On
I only put None there so that the colon would be more visible: in some
browser fonts, [value:] looks the same as [value]
On 4/5/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
En Thu, 05 Apr 2007 15:09:18 -0300, Collin Stocks <[EMAIL PROTECTED]>
escribió:
> message=whole_mess
le more like
classes. I suppose you wouldn't like me to post my own (somewhat buggy)
module that allows you to import modules as new type classes?
On 4/5/07, Steve Holden <[EMAIL PROTECTED]> wrote:
Collin Stocks wrote:
> As for me, I find this problem annoying, but easy to so
I tried it, and when checking it using a proxy, saw that it didn't really
work, at least in the version that I have (urllib v1.17 and urllib2 v2.5).
It just added that header onto the end, therefore making there two
User-Agent headers, each with different values. I might add that my script
IS able
I have no clue what is wrong. If all else fails, use os.system() instead of
os.popen(). Pipes tend not to always work in windows.
--
http://mail.python.org/mailman/listinfo/python-list
functional 0.5.
+ Weakref support has been added to flip and compose objects in the C version.
+ Sundry performance improvements for the C implementation.
As always, feedback welcome!
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
SF #1495358; typeclasses can now actually be used.
As always, feedback welcome!
Collin Winter
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 18, 11:52 am, eric wrote:
> On Dec 18, 8:37 pm, collin.da...@gmail.com wrote:
>
> > I am trying to write a simple application to factor polynomials. I
> > wrote (simple) raw_input lines to collect the a, b, and c values from
> > the user, but I dont know how to implement the quadratic equat
On Dec 18, 1:09 pm, Mark Dickinson wrote:
> On Dec 18, 8:47 pm, Scott David Daniels wrote:
>
> > else: # a single result (discriminant is zero)
> > return (-b / (2 * a),)
>
> Maybe make that (-b / (2. * a)) to avoid getting funny results
> when a and b are integers. (Or do a from _
On Dec 18, 4:41 pm, "James Mills"
wrote:
> On Fri, Dec 19, 2008 at 10:11 AM, Gabriel Genellina
>
> wrote:
> > En Thu, 18 Dec 2008 17:37:35 -0200, escribió:
>
> >> I am trying to write a simple application to factor polynomials. I
> >> wrote (simple) raw_input lines to collect the a, b, and c val
On Dec 18, 5:30 pm, "James Mills"
wrote:
> UPDATE:
>
> jmi...@atomant:~/tmp$ cat polycalc.py
> #!/usr/bin/env python
>
> from math import sqrt
>
> def f(a, b, c):
> if (b**2 - (4 * a * c)) < 0:
> return None, None # Can't solve
> x1 = -b - (sqrt(b**2 - (4 * a * c)) / (2 * a))
>
On Dec 18, 5:10 pm, Steven D'Aprano wrote:
> On Thu, 18 Dec 2008 11:37:35 -0800, collin.day.0 wrote:
> > I am trying to write a simple application to factor polynomials. I wrote
> > (simple) raw_input lines to collect the a, b, and c values from the
> > user, but I dont know how to implement the q
On Dec 18, 11:37 am, collin.da...@gmail.com wrote:
> I am trying to write a simple application to factor polynomials. I
> wrote (simple) raw_input lines to collect the a, b, and c values from
> the user, but I dont know how to implement the quadratic equation
>
> x = (-b +or- (b^2 - 4ac)^1/2) / 2a
On Dec 18, 6:12 pm, Collin D wrote:
> On Dec 18, 11:37 am, collin.da...@gmail.com wrote:
>
> > I am trying to write a simple application to factor polynomials. I
> > wrote (simple) raw_input lines to collect the a, b, and c values from
> > the user, but I dont know how to
On Dec 18, 6:23 pm, "Russ P." wrote:
> On Dec 18, 6:17 pm, Collin D wrote:
>
>
>
>
>
> > On Dec 18, 6:12 pm, Collin D wrote:
>
> > > On Dec 18, 11:37 am, collin.da...@gmail.com wrote:
>
> > > > I am trying to write a simple applicat
On Dec 18, 6:27 pm, Collin D wrote:
> On Dec 18, 6:23 pm, "Russ P." wrote:
>
>
>
>
>
> > On Dec 18, 6:17 pm, Collin D wrote:
>
> > > On Dec 18, 6:12 pm, Collin D wrote:
>
> > > > On Dec 18, 11:37 am, collin.da...@gmail.com wrote:
&g
On Dec 18, 6:41 pm, "Russ P." wrote:
> On Dec 18, 6:31 pm, Collin D wrote:
>
>
>
>
>
> > On Dec 18, 6:27 pm, Collin D wrote:
>
> > > On Dec 18, 6:23 pm, "Russ P." wrote:
>
> > > > On Dec 18, 6:17 pm, Collin D wrote:
>
On Jan 5, 6:25 am, "Djames Suhanko" wrote:
> Hello!
> I'm sorry my terrible english (my native language is portuguese).
> I has a litle program that open another window. When I close de root
> window in quit button, I need clicking 2 times to close. is where the
> problem?
>
> The source:
> 1 #!
On Jan 5, 9:21 am, Roger wrote:
> On Jan 5, 11:52 am, Collin D wrote:
>
>
>
> > On Jan 5, 6:25 am, "Djames Suhanko" wrote:
>
> > > Hello!
> > > I'm sorry my terrible english (my native language is portuguese).
> > > I has
portant for development of python, software
> i am sory anyway hope will be helpful.
Please consult the documentation first:
http://docs.python.org/lib/typesmapping.html . You're looking for the
get() method.
This attribute of PHP is hardly considered a feature, and is not
something
Hey everyone.
I am writing a game in python, and it includes a text console somewhat
like the one in WoW and Runescape. I want to be able to include "/"
commands, like IRC, and was wondering what the best module would be to
parse these.
Thanks a lot,
Collin D
--
http://mail.python.o
Thanks for the replies. Pyparsing looks just like what I need.
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to write a simple application to factor polynomials. I
wrote (simple) raw_input lines to collect the a, b, and c values from
the user, but I dont know how to implement the quadratic equation
x = (-b +or- (b^2 - 4ac)^1/2) / 2a
into python. Any ideas?
--
http://mail.python.org/mailman/l
55 matches
Mail list logo