"Iyer, Prasad C" wrote:
> I have a class in a module which is getting imported in main module.
> How do you differentiate between the 2 class
if you have one class in a module, why do you need to differentiate
between it? assuming that you do in fact have *two* classes with
the same name in two
"Iyer, Prasad C" wrote:
> How would I use it if I declare it as given below in my 3rd class
>
> from import1.py import *
> from import2.py import *
thats a syntax error; I assume you meant
from import1 import *
from import2 import *
which simply doesn't work if you need to access things
> thats a syntax error; I assume you meant
message = message.replace(
"a syntax error",
"almost always an import error (no module named py)"
)
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
> Interestingly I couldn't find this in the FAQ, though it *is* a
> frequently-asked question [note: my not finding it doesn't guarantee
> it's not there].
it's there:
http://www.python.org/doc/faq/general.html#why-are-default-values-shared-between-objects
(maybe "defau
Brandon Keown wrote:
>I have programmed a fractal generator (Julia Set/Mandelbrot Set) in
> python in the past, and have had good success, but it would run so
> slowly because of the overhead involved with the calculation. I
> recently purchased VS .NET 2003 (Win XP, precomp binary of python
Java and Swing wrote:
>I used, myApp = CDLL("C:...") ...as I saw it in one of the ctypes
> samples.
>
> Anyhow, I tried...
>
> myApp = cdll.LoadLibrary("C:\\myapp.dll")
> myApp.AddNumbers(1, 4)
>
> ..I get an error...
>
> AttributeError: function 'AddNumbers' not found
>
> ...myapp certainly has A
Brandon K" wrote:
> Here's the Script it was being used in (forgive it if it seems a bit
> messy, i have been tinkering with variables and such to try different
> ideas and haven't really cleaned it up).
the C compiler does in fact provide you with some clues:
c:\test\c_lib.cpp(22) : warning C47
"Java and Swing" wrote:
>>> from ctypes import *
>>> myapp = cdll.LoadLibrary("c:\\myapp.dll")
>>> dumpbin /exports myapp.pyd
>
> i get, SyntaxError: invalid syntax with it pointing at the first "p" in
> myapp.pyd.
dumpbin is a command-line utillity, usually included in the compiler
toolsuite...
"parul garg" wrote:
> i am new to python.i hav to call function of c++ .so file(shared
> library)on linux.
> any how i am not able to do that.
> i had made one zoo.so file.when i import it this gives the following error...
>
import zoo
> Traceback (most recent call last):
> File "", line 1,
"Java and Swing" wrote:
>i dont have a myapp.pyd ...i have myapp.c, or are u suggesting I dump
> the dll?
if that's what you're trying to import, yes.
> or the swig generated python file?
> the swig generated python file only has .py and .pyc.
huh? if you have a swig-generated python file, why
"Flavio" <[EMAIL PROTECTED]> wrote:
> Can anyone tell me why, if the following code works, I should not do
> this?
because it doesn't work:
#
# Extending Local namespace, now with Local namespace
#
def fun(a=1,b=2,**args):
k="K"
v="V"
print 'locals:',locals()
locals().update(arg
"marduk" wrote:
> Do I have to implement my own garbage collecting is or there some "magical"
> way of doing this within Python?
http://docs.python.org/lib/module-weakref.html
--
http://mail.python.org/mailman/listinfo/python-list
"Tuvas" wrote:
>I am looking for a good tutorial on how to extend python with C code. I
> have an application built in C that I need to be able to use in Python.
http://docs.python.org/ext/ext.html
--
http://mail.python.org/mailman/listinfo/python-list
Class methods"Hughes, Chad O" wrote:
> Is there any way to create a class method?
somewhat ironically, the first google hit for that sentence is a chapter in the
python tutorial that *doesn't* explain how to create class methods...
as others have pointed out, the classmethod wrapper/descriptor i
Steven D'Aprano wrote:
> I suppose someone might be able to come up with code that deliberately
> uses this feature for good use
argument binding is commonly used for optimization, and to give simple
functions persistent storage (e.g. memoization caches).
more importantly, it's the standard pydi
"[EMAIL PROTECTED]" wrote:
> I've got a trouble, and i think that anybody there can help me
>
> I've got a python script which i distribute in somes packages for *nix.
> This script is full of python and need python 2.4 ! And i'd like to
> display a message when the user doesn't have a python2.4 v
"k8" wrote:
> I'm stuck on a Windows machine today and would love to fully play with
> and test a simple python script. I want to be able to type "python
> myscript myarg" somewhere. Is there anything out there to help me?
footnote: if you'd prefer to type "myscript myarg" instead, you might wa
Jeremy Moles wrote:
> So, here is my relevant code:
>
> PyArg_ParseTuple(args, "O!", &PyType_vector3d, &arg1)
>
> And here ismy error message:
>
> argument 1 must be pylf.core.vector3d, not pylf.core.vector3d
try adding
printf("%p %p\n", &PyType_vector3d, arg1->ob_type);
before the parsetup
Ryan Krauss wrote:
> Is there an easy way to convert a shelved object back to a dictionary?
> When I save a dictionary using shelve and then load it in a later
> session, I have an object whose property names are the keys of the
> dictionary used as an input to shelve. For example, instead of
>
"Bell, Kevin" wrote:
> Anyone aware of existing code to turn a date string "8-15-05" into the
> number 20050815?
date = "8-15-05"
import re
m, d, y = map(int, re.match("(\d+)-(\d+)-(\d+)$", date).groups())
number = 2000 + y*1 + m*100 + d
print number
--
http://mail.python.org/mai
Ron Adam wrote:
> Is there a way to conditionally decorate? For example if __debug__ is
> True, but not if it's False? I think I've asked this question before. (?)
the decorator is a callable, so you can simply do, say
from somewhere import debugdecorator
if not __debug__:
deb
Joshua Ginsberg wrote:
> So this part makes total sense to me:
>
> >>> d = {}
> >>> for x in [1,2,3]:
> ... d[x] = lambda y: y*x
> ...
> >>> d[1](3)
> 9
>
> Because x in the lambda definition isn't evaluated until the lambda is
> executed, at which point x is 3.
>
> Is there a way to specifica
Leif K-Brooks wrote:
>>os.access(path,mode)
>>
>> where path may contain linux style wildcards.
>
> os.access(glob.glob(path), mode)
Traceback (most recent call last):
File "", line 1, in ?
TypeError: access() argument 1 must be string, not list
it's not clear from the OP if he wants
"Christophe" wrote:
> It's more of a "Nearly too late" type checking I would say. Not that I
> complain but it would be great if there were also some automatic type
> checking to catch a few errors as soon as possible.
use assert as the soonest possible point. implementing "type gates" is
trivia
[EMAIL PROTECTED] wrote:
> I came accross what i think is a serious bug in the python interpreter.
> Membership testing seems not to work for list of objects when these
> objects have a user-defined __cmp__ method.
it does not work if they have *your* __cmp__ method, no. if you add
a print stat
[EMAIL PROTECTED] wrote:
> Sorry Fredrik but I don't understand. Just comment out the assert and
> you have different results depending on whether an unrelated sort
> function is defined.
>
> This seems weird to me !
not if you look at what it prints.
(if it seems weird to you that 0 equals 0, i
"Christophe" wrote:
> I mean, why not ? Why does the compiler let me do that when you know
> perfectly that that code is incorrect :
> def f():
> return "a" + 5
probably because the following set is rather small:
bugs caused by invalid operations involving only literals, that are not
[EMAIL PROTECTED] wrote:
> Why is it that a membership test needs to call the __cmp__ method?
because the membership test has to check if the tested item is a member
of the sequence. if it doesn't do that, it's hardly qualifies as a membership
test. from the reference manual:
For the list a
[EMAIL PROTECTED] wrote:
> In fact, i want to sort the list based on the 'allocated attribute' and
> at the same time, test membership based on the id attribute.
> __cmp__ logically implies an ordering test
really?
http://dictionary.reference.com/search?q=compare
com·pare
v. com·pare
"mike" wrote:
> Test for the existence of one or more matches of the wildcard
> expression.
why are you reposting variations of your question (in duplicates)
instead of reading the replies? that's not a good way to pass the
turing test.
--
http://mail.python.org/mailman/listinfo/python-lis
Terry Hancock wrote:
> GvR's syntax has the advantage of making grammatical sense in English (i.e.
> reading it as written pretty much makes sense).
as a native Python speaker, I find that argument being remarkably weak. things
I write in Python should make sense in Python, not in some other lan
Michele Simionato wrote:
> I am having a hard time in finding out how to retrieve information
> about the *size* of files I want to download from an FTP site. Should I
> send a QUOTE SIZE command to the ftp server or is there an easier way?
SIZE isn't a standard FTP command, so that only works fo
[EMAIL PROTECTED] wrote:
> No doubt you're right but common sense dictates that membership testing
> would test identity not equality.
what does "common sense" have to say about this case:
>>> L = ("aa", "bb", "cc", "dd")
>>> S = "a" + "a"
>>> L
('aa', 'bb', 'cc', 'dd')
>>> S
'aa'
>>> S in L
# T
"mike" wrote:
> dude, you are the sap that wrote "it's not clear".
followed by three possible solutions to the stated problem, one
of which was marked as "most likely".
> get a life.
oh, sorry for wasting my time. can I *plonk* you now?
--
http://mail.python.org/mailman/listinfo/python-l
Steven D'Aprano wrote:
> It is important that there are no privileged attributes, e.g. in the
> above example, I can set any of x, y, z, r, theta or phi and all the
> others will automatically reflect the changes.
http://users.rcn.com/python/download/Descriptor.htm#properties
--
http://mail
Alex Willmer wrote:
> I'm trying to track down the name of a file format and python module,
> that was featured in the Daily Python URL some time in the last month or
> two.
http://www.netpromi.com/kirbybase.html ?
--
http://mail.python.org/mailman/listinfo/python-list
"Steve" wrote:
> I'm trying to run a Python program on Unix and I'm encountering some
> behavior I don't understand. I'm a Unix newbie, and I'm wondering if
> someone can help.
> If I run it through the Python interpreter, this way:
>
> >> python test.py
>
> it runs fine.
>
> But if I try to ru
[EMAIL PROTECTED] wrote:
> I just threw this together because I find myself needing it now and
> then. Requires PIL and optionally ImageMagick to convert to png, since
> I think PIL is not able yet to convert a bmp to a png.
well, not in one step, but it can load BMP images and save PNG
images.
Terry Hancock wrote:
> By the way, dict.org doesn't think "execresence" is a word,
> although I interpret the neologism as meaning something like
> "execrable utterance":
>
> dict.org said:
> > No definitions found for 'execresence'!
however, 'excrescence' appears to be a perfectly cromulent word
"ktxn1020" wrote:
> The script ran well independently using Python's Integrated
> Development Environment version 2.4.1. When it is called from Borland
> C++ Builder 5 with python for delphi version 3.16, it is complained at
> the line "import os", but not at the line "import nt". How can
> I reso
Mike Meyer wrote:
> I think it's time to form a Committee for the Prevention of Regular
> Expression Abuse.
on the other hand, the RE engine uses a more advanced scanning
algorithm than string find, which means that constant RE:s can in
fact be faster under some circumstances (certain patterns, t
> > if glob.glob(...): ...
>
> As for your possible solutions, if you consider any
> of yours to be "readable", then i have no interest in
> coding with you.
> > if glob.glob(...): ...
>
> I guess, for readability, nothing has come up that
> seems _great_.
> > if glob.glob(...): ...
>
> It works,
"James Hu" wrote:
> I have png file with mode "I", 16 bit,
> And I tried to open it with im=Image.open("output.png"), im.show()
> I got all white image.
> Don't why?
because all of the PNG file are larger than 255 ?
show doesn't support 16-bit images, so it clamps the values down to
an 8-bit ran
(re that earlier thread, I think that everyone that thinks that it's a
good thing that certain Python constructs makes grammatical sense
in english should read the previous post carefully...)
Rob Cowie wrote:
> A string can be thought of as a tuple of characters.
footnote: the correct python ter
"Java and Swing" wrote:
>I need to write an extension for a C function so that I can call it
> from python.
>
> C code (myapp.c)
> ==
> typedef unsigned long MY_LONG;
>
> char *DoStuff(char *input, MY_LONG *x) { ... }
>
> so you pass in a string and an array of MY_LONGS...such as
>
> MY_LONGS
Lasse Vågsæther Karlsen wrote:
> Yeah, but as far as I can see it, this one too fails to recognize
> situations where the function is called twice with essentially the same
> values, except that in one call it uses named arguments:
>
> k1 = fibonacci(100)
> k2 = fibonacci(idx = 100)
>
> this is es
Paul Boddie wrote:
>> There are benchmarks testing the *real performance* of Python.
>>
>> For example: http://www.osnews.com/story.php?news_id=5602
>
> Just the observation that there are 166 comments to that article would
> suggest that the methodology employed was somewhat debatable. (I don't
>
Dave wrote:
> Yes, I would like to know how many internal string operations are done inside
> the Python interpreter.
when you're doing what?
how do you define "internal string operations", btw?
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
> Don't think so matey.
oh, come on. a site run by some random guy in North Carolina has to be
safer, faster and more reliable than a distributed communication system that
has been around since that guy was born...
--
http://mail.python.org/mailman/listinfo/
Michael Goettsche wrote:
> Besides that, it's cheap advertising. Would it have been harder to post the
> direct forum link than to link to his company's website?
company?
--
http://mail.python.org/mailman/listinfo/python-list
>seq = PySequence_Fast(data, "expected a sequence");
>if (!seq)
>return NULL;
here's some more information on the PySequence_Fast API:
http://www.effbot.org/zone/python-capi-sequences.htm
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
> In other words, what is the difference between a "scripting language"
> and a "programming language".
here's one useful way to look at things:
"Unlike mainstream component programming, scripts usually
do not introduce new components but simply "wire" exis
"rtilley" wrote:
> Perhaps this is a dumb question... but here goes. Should a socket client
> and a socket server each have different values for
> socket.setdefaulttimeout() what happens? Does the one with the shortest
> timeout period end first?
the timeout is a local setting, so the each process
[EMAIL PROTECTED] wrote:
> These 3 intermediate variables used to improve readability
> can introduce bugs : you have to check that b, c and d are
> not used anywhere else in the code.
if you have a fear of introducing new local variables, you have problems
that cannot be solved by syntax.
-
"CJ" wrote:
>Well, for some reason, the FOR loop is altering two of my lists. Using
> PRINT magic, I was able to narrow down the lines that were causing it.
> But the question remains: Why is it doing this? I'm sure there's a simple
> answer that I just overlooked in the manual or something.
[EMAIL PROTECTED] wrote:
> I am following this tutorial
>
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?source=dw-linux-pysocks&S_TACT=105AGX59&S_CMP=GR&ca=dgr-lnxw07PythonSockets
> ( free reg. req. )
>
> The article told me to do this:
>
> [camus]$ python
> Python 2.4 (#1, Feb 20 2005
Steven D'Aprano wrote:
> I notice that type(some_closure) and type(ordinary_function) both return
> the same result, . I also notice that both the closure
> and ordinary functions have an attribute "func_closure". Is there a way to
> tell which is a closure and which is not? In my tests, the ordin
Lasse Vågsæther Karlsen wrote:
>
> > "Unlike mainstream component programming, scripts usually
> > do not introduce new components but simply "wire" existing
> > ones. Scripts can be seen as introducing behavior but no
> > new state. /.../ Of course, there is nothing to stop a
> >
"jena" wrote:
> I have code
>
> # BEGIN CODE
> def test():
> def x():
> print a
> a=2 # ***
>
> a=1
> x()
> print a
>
> test()
> # END CODE
>
> This code fails (on statement print a in def x), if I omit line marked
> ***, it works (it prints 1\n1\n). It look like when I assign vari
Steven D'Aprano wrote:
> Yes I did. Did you read my post?
given that the wikipedia page says
"a closure is an abstraction representing a function, plus the
lexical environment (see static scoping) in which the function
was created."
and you're still focussing on type(function), it s
Ron Adam wrote:
> In effect, 'cache' and 'fn' are replaced by the objects they reference
> before the cached_result function is returned.
not really; accesses to "free variables" always go via special cell objects
(rather than direct object references), and the compiler uses special byte
codes fo
Steven D'Aprano wrote:
> > let's take it again, with emphasis on some important words:
> >
> > "a closure is an ABSTRACTION representing a function, PLUS the
> > lexical ENVIRONMENT (see static scoping) in which the function
> > was created."
> >
> >> If you create a closure, using a m
Steven D'Aprano wrote:
> "Each def or lambda expression that is executed will create a closure if
> the body of the function or any contained function has free variables."
>
> Presumably that means that if there are no free variables, no closure
> is created.
you're quoting selectively; the word
Alex Stapleton wrote
> Except it is interpreted.
except that it isn't. Python source code is compiled to byte code, which
is then executed by a virtual machine. if the byte code for a module is up
to date, the Python runtime doesn't even look at the source code.
> What is your point?
that som
Donn Cave wrote:
> | > Except it is interpreted.
> |
> | except that it isn't. Python source code is compiled to byte code, which
> | is then executed by a virtual machine. if the byte code for a module is up
> | to date, the Python runtime doesn't even look at the source code.
>
> Fair to say t
Brian van den Broek wrote:
> But the academic issue "How/Can it be done?" still itches.
class __TwoUnderBase(object):
def __init__(self):
if self.__class__.__name__ == "__TwoUnderBase":
print "From __TwoUnderBase"
else:
print "From subclass",
Timothy Smith wrote:
> i have reproduced the error in this code block
>
> #save values in edit
> self.FinaliseTill.SaveEditControlValue()
> if
> Decimal(self.parent.TillDetails[self.TillSelection.GetStringSelection()]['ChangeTinBalance']))
> == Decimal('0'):
> #box must be checked before continuing
Timothy Smith wrote:
> it is definately a bug in 2.3 when using the decimal module. i can
> reproduce it.
>
> from decimal import Decimal
> a = Decimal('0'
>
> and when you attempt to run it you will get "error"
$ python script.py
File "script.py", line 3
^
SyntaxError: inva
Shi Mu wrote_
> There are four points with coordinates:
> 2,3;4,9;1,6;3,10.
> How to use Python to draw one perpendicular bisector
> between (2,3) and (4,9);
the same was as you'd do it in any other computer language ?
once you know the algorithm, implementing it in Python should be
trivial. ma
Peter Milliken wrote:
> There were Tkinter binaries with it so I installed those as well. When I
> attempt to run the most simplistic of python programs using Tkinter, I get
> an error message stating that Python can't find any tkinter module.
>
> Any ideas what I have done wrong anybody?
what do
Nico Grubert wrote:
> I would like to parse a string in Python.
>
> If the string is e.g. '[url=http://www.whatever.org][/url]' I would like
> to generate this string:
> 'http://www.whatever.org";>http://www.whatever.org'
>
> If the string is e.g. '[url=http://www.whatever.org]My link[/url]' I
> w
"Peres" wrote:
> As a Python beginner, I feel a bit lost among all possible libraries...
> so I wondered whether soemone could help me find my way... I
> just need to generate animated sequences of 2D primitives (dots
> and lines), as fast as possible, checking the computer clock for
> the time el
Michele Simionato wrote:
> the README says "for a usage example, see the sanity.py test
> script" but there is not such a script in the distribution :-(
looks like a distutils glitch... try this one:
# $Id$
# minimal sanity check
import string
TESTS = [
"# examples taken from ftpparse.c",
"beza1e1" <[EMAIL PROTECTED]> wrote:
> I have such a statement as string: "distance = x**2 + y**2"
> x and y are undefined, so it is no executable Python code, but it is
> parseable. Now i'd like traverse through the AST and change Name('x')
> for the value i have elsewhere. And finally let Python
"[EMAIL PROTECTED]" wrote:
> Here's a piece of Python code and it's output. The output that Python
> shows is not as per my expectation. Hope someone can explain to me this
> behaviour:
/snip/
> Why do myobj1.myarr and myobj2.myarr point to the same list? The
> default value to __init__ for th
"beza1e1" wrote:
> Thank you! this "compile/exec in context" is the thing i wanted.
>
> It is not that performant i think.
it's about as fast as it can get, as long as you only call compile when
the expressions change. (the example didn't show it, but the "expr"
code object can of course be reu
Kim Nguyen wrote:
> Fredrik Lundh,I replaced mtime = os.stat(Path +
> file_name)[os.path.stat.ST_MTIME]
> with mtime = nt.stat("q.py") per your suggested, then ran it from IDLE 2.4.2.
> Here is
> the message I got
oh, sorry, that was an example that accidentally sl
Steve Holden wrote:
> Can I ask if you are specifying a source encoding in your file with a
> pragma (?) like
>
> # -*- coding: iso-8859-15 -*-
>
> I've noticed what appear to be spurious syntax errors from time to time
> on such files, and have been attempting to debug the problem for some
> time
Tom Anderson wrote:
> Okay, a crack at a definition: a closure is a function in which some of
> the variable names refer to variables outside the function. And i don't
> mean global variables - i mean somebody else's locals; call them 'remote
> variables'.
in Python, the global variables are some
Ognen Duzlevski wrote:
> I am curious, does this make a difference speed wise (aside
> from loading time)? The python tutorial would seem to imply
> that it does not:
>
> >From Python-Docs-2.4.2/tut/node8.html#SECTION00812
>
> "A program doesn't run any faster when it is read from
Java and Swing wrote:
> So is "module.c" a new C file or do I add it to my existing, myapp.c?
it's a complete module. if you want it to do something other than printing
the arguments, replace the "do stuff" section with your own code. if you
want to call it something else, rename it. if you wa
Alex Martelli wrote:
> (there is no common Python type on which you can both call
> len(...) AND the .next() method, for example -- a combination
> which really makes no sense).
>>> L = [1, 2, 3]
>>> len(L)
3
>>> I = iter(L)
>>> I
>>> len(I)
3
>>> I.next()
1
>>> len(I)
2
>>> I.next()
2
>>> len(I
Andy Leszczynski wrote:
> watch this:
> http://www.turbogears.org.nyud.net:8090/docs/wiki20/20MinuteWiki.mov
>
> or read this:
> http://www.turbogears.org.nyud.net:8090/docs/wiki2 0/page4.html
>
> should not it be:
>
> 2 def save(self, pagename, data, submit, new):
> 3 hub.begin()
> 4 if new == Tr
Andy Leszczynski wrote:
> when I run under Unix I got:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0a 41 41
>
> and under Windows/Cygwin following:
>
> $ python u.py > u.bin
> $ od -t x1 u.bin
> 000 41 41 0d 0a 41 41
> 006
>
> The question is how can I pipe out binary cont
Rune Strand wrote:
> I know it's several ways to isolate the filename. I just want to avoid
> the overhead of importing sys or os to achieve it.
those modules are already imported when Python gets to your code, so
the only "overhead" you're saving is a little typing.
> Currently I have this in
Laszlo Zsolt Nagy wrote:
> The question: is there a good library for Python for extraction links and
> images
> out of (possibly malformed) HTML soucre code?
http://www.crummy.com/software/BeautifulSoup/
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
>> what does 2>&1 mean pls ?
>>
> It's Unix shell-speak for "send the standard error stream to the same
> place as the standard output". Probably a syntax error on Windows ...
> more test.py
import sys
sys.stdout.write("stdout!\n")
sys.stderr.write("stderr!\n")
> python test.
[EMAIL PROTECTED] wrote:
> I don't know if C++ compilers can do such optimizations.
working on a Python to C/C++ translator without knowing what kind
of optimizations a C/C++ compiler can do for you sounds like a great
way to waste your time...
(I would be rather bit surprised if any contemporar
<[EMAIL PROTECTED]> wrote
> I'm having trouble resolving a scope problem. I have a module,
> called from another script, with this structure:
the code you posted gives a syntax error. if I fix that, and add some
boilerplate to call getCcyMappings from inside the parseFile function,
I get:
Trace
Jeremy Moles wrote:
> Probably what you want to do though is just keep the tuple as is and
> iterate over it using the PySequence_* protocol:
>
> http://docs.python.org/api/sequence.html
I did post a complete and tested example a few days ago, which contained
code that showed how to do this. a c
Tom Anderson wrote:
> In both smalltalk and python, every single variable contains a reference
> to an object - there isn't the object/primitive distinction you find in
> less advanced languages like java.
>
> Except that in smalltalk, this isn't true: in ST, every variable *appears*
> to contain
Rune Strand wrote:
>> those modules are already imported when Python gets to your code, so
>> the only "overhead" you're saving is a little typing.
>
> I don't understand this. Could you please elaborate? - if sys or os
> are not imported for any other causes how are they already imported?
becau
Peter Otten wrote:
> Are we talking about the same setdefault()?
>
> setdefault(...)
>D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
note that it might be spelled "setdefault", but it should be pronounced
"get or set".
--
http://mail.python.org/mailman/listinfo/python
Java and Swing wrote:
> and I get this error..
>
> C:\project\myapp.c(549) : error C2040: 'get_long_array' : 'long
> *(struct _object *,int *)' differs in levels of indirection from 'int
> ()'
so what's on line 549 in myapp.c?
what other warnings did you get from the compiler?
do you have other
"Peres" wrote:
> Python is great!... but the erasing of the graphic memory is slow (I used
> surf.fill from Pygame).
define slow.
> Does anyone know how to erase the screen faster, in animated graphics?
if you're doing animation on modern hardware, there's hardly any
reason not to use double bu
"Java and Swing" wrote:
> anyhow, for receiving an object from python..is it
>
> ok = PyArg_ParseTuple(args, "sO", &x, &y);
>
> ...is it "sO" or "s0" is it O (as in the letter) or 0 (as in the
> number)? I would think "O" the letter..but it looks like a zero.
eh? if you're not sure, what ke
Ryan Wilcox wrote:
> I want to be able to pass a variable number of parameters into a Python
> function. Now, I know how to _receive_ variable arguments, but I don't
> know how to _send_ them.
>
> def myFunction(*args):
> print args
>
> myList = [1, 2, 3, 4]
> myFunction(myList)
>
> this funct
Paul Boddie wrote:
> Testing Web applications can be hard, but the traceback tells you
> everything you need to know here.
especially if you make sure to use the cgitb module:
http://docs.python.org/lib/module-cgitb.html
while developing/debugging.
--
http://mail.python.org/mailman/li
Jerzy Karczmarczuk wrote:
> Anybody knows where I can find a concrete and guaranteed answer to the
> following
> extremely basic and simple question?
>
> What is the complexity of appending an element at the end of a list?
amortized O(1)
> Concatenating with another?
O(n)
> The point is that
[EMAIL PROTECTED] wrote:
> Can you tell me how do I go about getting the dbm module and install
> it.??
http://www.google.com/search?q=trustix+python+dbm
--
http://mail.python.org/mailman/listinfo/python-list
101 - 200 of 4900 matches
Mail list logo