Andrea Griffini <[EMAIL PROTECTED]> writes:
>>In short, you're going to start in the middle.
>
> I've got "bad" news for you. You're always in the
> middle :-D.
That's what I just said.
>>Is it really justified to confuse them all
>>by introducing what are really extraneous details early on?
>
>
What do people think of this?
'prefixed string'.lchop('prefix') == 'ed string'
'string with suffix'.rchop('suffix') == 'string with '
'prefix and suffix.chop('prefix', 'suffix') == ' and '
The names are analogous to strip, rstrip, and lstrip. But the functionality
is basically this:
def lchop(
>> My code is " os.system("NET SEND computer hihi") "
>> i use this funtion on Windows server 2003.
>> it's ok.
>>
>> But the same code running on Windows XP SP2, it shows the command window
>> twice.
>> How do i remove the command window?
>
> Hi,
>
> You can remove the command window which comes
On Mon, Jun 13, 2005 at 06:13:13AM +, Andrea Griffini wrote:
> >Andrea Griffini <[EMAIL PROTECTED]> writes:
> >So you're arguing that a CS major should start by learning electronics
> >fundamentals, how gates work, and how to design hardware(*)? Because
> >that's what the concrete level *really
Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
Your use case is
> I get tired of writing stuff like:
>
> if path.startswith('html/'
> i want to compare the content in excel,but i don't know whick module to use!
> can you help me?
Read "Python programming on Win32" book, use win32api module. According
to Chad's advices about Excel (VBA) constants, you can find following
link usefull as well.
http://fox.wikis.com/wc.dll?Wiki~Exce
# Professional driver on a closed course.
# Don't try this at home.
data = """
rose, 1, 500
lilac, 1, 300
lilly, 1, 400
rose, 0, 100
"""
data = data.replace(', 1, ', ' += ')
data = data.replace(', 0, ', ' -= ')
class DefaultDict(dict):
def __getitem__(self, key):
return self.get(key,
Kalle Anke wrote:
> Those who have read my posts today have probably understood that I'm
> not a "true" Python programmer ... but I want to learn more (I think
> that Python is rather fun).
>
> I've read "Learning Python" pretty thoroughly, I've looked at some of
> the tutorials, some of online
On Mon, 13 Jun 2005 07:05:39 +, Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
>
> The names are analogous to strip, rstrip, and
Xah Lee <[EMAIL PROTECTED]> wrote:
> if i have
> mytext.replace(a,b)
> how to find out many many occurances has been replaced?
If 'a' and 'b' are different length,
- Count the string length, before and after. The difference should
be multiple of difference between length of 'a' and 'b'.
[Andrew Dalke]
<200 lines of thorough analysis>
> To summarize:
> - I don't think it's needed that often
> - I don't think your implementation's behavior (using an
>exception) is what people would expect
> - I don't think it does what you expect
Wow, that was a remarkably thoughtful,
[EMAIL PROTECTED] wrote:
>
> Tuples (which are immutable) also appear to be reused
>
>
foo = ()
bar = ()
foo is bar
>
> True
Not always:
foo = (1,)
bar = (1,)
foo is bar
=> False
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p i
On Sat, 11 Jun 2005 10:30:53 -0700, Lorn wrote:
> I'm trying to figure out a way to create dynamic lists or possibly
> antother solution for the following problem. I have multiple lines in a
> text file (every line is the same format) that are iterated over and
> which need to be compared to previ
Andy wrote:
> What do people think of this?
>
> 'prefixed string'.lchop('prefix') == 'ed string'
> 'string with suffix'.rchop('suffix') == 'string with '
> 'prefix and suffix.chop('prefix', 'suffix') == ' and '
>
> The names are analogous to strip, rstrip, and lstrip. But the functionality
> is
Are there any useful naming conventions for modules, classes and functions?
For instance, should I name functions as verbs and classes as nouns?
eg
class Transformer():
pass
def transform():
do_stuff
What about the module name? transformations.py or transform.py?
What do people do wit
Hi All:
Python 2.4.1 (#2, May 5 2005, 11:32:06)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import hotshot,hotshot.stats
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/lib/python2.4/hotshot/stats.py
Chris Spencer wrote:
> If an XML parser reads in and then writes out a document without having
> altered it, then the new document should be the same as the original.
says who?
> With Elementtree this isn't so. Lundh apparently believes he knows
> better than you and I on how our namespaces shou
Pingveno wrote:
> I'm working on the Python Challenge (make sure to try it:
> http://www.pythonchallenge.com). One of the puzzles requires the use of
> regular expressions, but with multiple matches in the text. I tried to
> use re.findall(), but I only go one result instead of a list of results.
Austin wrote:
>>> My code is " os.system("NET SEND computer hihi") "
>>> i use this funtion on Windows server 2003.
>>> it's ok.
>>>
>>> But the same code running on Windows XP SP2, it shows the command window
>>> twice.
>>> How do i remove the command window?
>>
>> Hi,
>>
>> You can remove the c
My understanding is that there are licence issues (someone please
correct me if I'm wrong). The moral of the story is that there's a
seperate (non-free) package for the profiler:
http://packages.debian.org/testing/python/python2.4-profiler
HTH
Tim
On 6/13/05, kyo guan <[EMAIL PROTECTED]> wrote:
<[EMAIL PROTECTED]> wrote:
> It means in windows we should use 'wb' to write and 'rb' to read ?
> Am I right?
no.
you should use "wb" to write *binary* files, and "rb" to read *binary*
files.
if you're working with *text* files (that is, files that contain lines of text
separated by line separa
Hello
I just start programing in Python.
I've got a qestion, how translate the example code writen in Java to
Python??
public class ConnectionManager {
public ConnectionManager() {
super();
}
public void sendAgent(Agent anAgent, WorkplaceAddress anAddress) {
}
}
bye
--
http
Frank Abel Cancio Bello wrote:
> Can I get how many bytes have a string object independently of its encoding?
strings hold characters, not bytes. an encoding is used to convert a
stream of characters to a stream of bytes. if you need to know the
number of bytes needed to hold an encoded string
[EMAIL PROTECTED] wrote:
> Hello
>
> I just start programing in Python.
> I've got a qestion, how translate the example code writen in Java to
> Python??
>
>
> public class ConnectionManager {
>
> public ConnectionManager() {
> super();
> }
> public void sendAgent(Agent anAgent, Workplac
Hi,
I have the followin situation.
1) I've a machine controled by a computer programn that can
comunicate with TCP/IP ("server")to recive the request of other
program to knwo what the machine should do.
2) The other program ("client") has a GUI (with wxPython), recives
data from the machine an
I'm CC:ing this to D'Arcy J.M. Cain. (See comp.lang.python for prequel
D'Arcy.)
Christopher J. Bottaro wrote:
> Check this out...
>
>
> import pgdb
> import time
>
> print time.ctime()
> db = pgdb.connect(user='test', host='localhost', database='test')
> time.sleep(5)
> db.cursor().execute('ins
Hi all,
I have a C++ library I call from python. The problem is I have c++
exceptions that i want to be translated to python. I want to be able to
do stuff like:
try:
my_cpp_function()
except cpp_exception_1:
do_stuff
except cpp_exception_2:
do_other_stuff
any ideas how can i do the t
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> copx wrote:
>> For some reason Python (on Windows) doesn't use the system's default
>> character set and that's a serious problem for me.
>
> I very much doubt this statement: Python does "use" the system's default
>
Andrea Griffini schrieb:
> On Sat, 11 Jun 2005 21:52:57 -0400, Peter Hansen <[EMAIL PROTECTED]>
> wrote:
>
>
>>I think new CS students have more than enough to learn with their
>>*first* language without having to discover the trials and tribulations
>>of memory management (or those other thing
On Sun, 12 Jun 2005, Roy Smith wrote:
> Andrea Griffini <[EMAIL PROTECTED]> wrote:
>
>> I think that for a programmer skipping the understanding of the
>> implementation is just impossible: if you don't understand how a
>> computer works you're going to write pretty silly programs. Note that
>>
On Sun, 12 Jun 2005, Peter Hansen wrote:
> Andrea Griffini wrote:
>> On Sat, 11 Jun 2005 21:52:57 -0400, Peter Hansen <[EMAIL PROTECTED]>
>> wrote:
>>
>>> I think new CS students have more than enough to learn with their
>>> *first* language without having to discover the trials and
>>> tribulat
On Mon, 13 Jun 2005, Andrea Griffini wrote:
> On Sun, 12 Jun 2005 20:22:28 -0400, Roy Smith <[EMAIL PROTECTED]> wrote:
>
>>> Also concrete->abstract shows a clear path; starting in the middle and
>>> looking both up (to higher abstractions) and down (to the
>>> implementation details) is IMO muc
Roose wrote:
> Why do people keep asking what language to use for certain things in the
> Python newsgroup? Obviously the answer is going to biased.
>
> Not that it's a bad thing because I love Python, but it doesn't make sense
> if you honestly want an objective opinion.
It will, however, have
Andrea Griffini <[EMAIL PROTECTED]> wrote:
> There's no way you will remember what is O(n),
> what O(1) and what is O(log(n)) among containers
> unless you roughly understand how it works.
People were thinking about algorithmic complexity before there was random
access memory. Back in the unit r
kyo guan wrote:
> ImportError: No module named profile
They moved it to non-free because the module's license isn't DFSG
compliant.
--
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
Hi.
I'm in trouble with the md5 module.
Under Linux, it's ok, I get real signatures.
The problem is under Windows XP, with some kind of files.
If I use the md5 module with .txt files, it'ok.
The Problem comes from the .msg files. I get the same signature for
every .msg file I try to hash with
fargo wrote:
> Hi.
>
> I'm in trouble with the md5 module.
>
> Under Linux, it's ok, I get real signatures.
>
> The problem is under Windows XP, with some kind of files.
>
> If I use the md5 module with .txt files, it'ok.
>
> The Problem comes from the .msg files. I get the same signature for
Hello Charles,
I am Ahmed, I read your query regarding image reader
for NIST's ihead standard. You mentioned that NIST has
a sample database of such images for downloading,
could please do me a favour,
(i) forward me the link of NIST where sample data of
ihead image is stored, I can not find it.
> As someone else mentioned, get a copy of the 2nd edition of the Python
> Cookbook. It's full of gold.
Or you can read the recipes online here:
http://aspn.activestate.com/ASPN/Python/Cookbook/
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Are there any useful naming conventions for modules, classes and
> functions?
>
> For instance, should I name functions as verbs and classes as nouns?
>
> eg
> class Transformer():
> pass
>
> def transform():
> do_stuff
>
> What about the module name? transform
Neuruss wrote:
[Me:]
>>As someone else mentioned, get a copy of the 2nd edition of the Python
>>Cookbook. It's full of gold.
>
> Or you can read the recipes online here:
> http://aspn.activestate.com/ASPN/Python/Cookbook/
While most (all?) of the recipes are there, the book is still worth
buyi
Roel Schroeven wrote:
> fargo wrote:
>
>> Hi.
>>
>> I'm in trouble with the md5 module.
>>
>> Under Linux, it's ok, I get real signatures.
>>
>> The problem is under Windows XP, with some kind of files.
>>
>> If I use the md5 module with .txt files, it'ok.
>>
>> The Problem comes from the .msg fil
the good news is that if run the ShellExecute bit twice, I get two
instances of explorer in Task Manager
The bad news is that the line "ioObj = hwnds[1]" tells me either "This
object does not support enumeration" (if I have not used makepy to
generate the classes) or "object has no attribute __get
Le Mon, 13 Jun 2005 07:53:03 -0400, Roy Smith a écrit :
> Python let's you concentrate on the real universal
> fundamentals of data structures, algorithms, and control flow without
> getting bogged down in details.
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
"Steve Jorgensen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 11 Jun 2005 11:51:02 -0500, tom <[EMAIL PROTECTED]> wrote:
>
> ...
> >Let me add an Item #3 -
> >If you have some entrepeneurial savvy and can keep your emotions out of
> >it tou can simply tell them you have de
I would like to know if there is for python's classes an equivalent of
the operator= that can be overidden.
Let's say I have
>>> a=A()
and I want to write
>>> a=5
and I want this to change some internal value of a instead of making a
point to a new object (an int 5)
In other word, I would lik
Sorry about that I had an instance of ie running in the background that
was version 0 didn't see the problem tell this morining when my
computer started to not work. it should be hwnds[1] should be
hwnds[0]. I woud enumerate them like in the code below.
If you have ie as your default browser yo
Xavier Décoret wrote:
> I would like to know if there is for python's classes an equivalent of
> the operator= that can be overidden.
>
> Let's say I have
> >>> a=A()
> and I want to write
> >>> a=5
> and I want this to change some internal value of a instead of making a
> point to a new objec
On Mon, 13 Jun 2005 11:53:25 +0200, Fredrik Lundh wrote:
> <[EMAIL PROTECTED]> wrote:
>
>> It means in windows we should use 'wb' to write and 'rb' to read ?
>> Am I right?
>
> no.
>
> you should use "wb" to write *binary* files, and "rb" to read *binary*
> files.
>
> if you're working with *t
> <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Resurrecting an old thread..
> > It seems that this solution does not return events on objects within
> > frames in webpages eg . if you go to www.andersondirect.com - the page
> > is composed of three frames called as topFrame main
On 13.06.2005, at 15:52, Xavier Décoret wrote:
> I would like to know if there is for python's classes an equivalent of
> the operator= that can be overidden.
>
> Let's say I have
a=A()
> and I want to write
a=5
> and I want this to change some internal value of a instead of making a
>
On Mon, 13 Jun 2005 15:52:14 +0200, Xavier Décoret wrote:
> I would like to know if there is for python's classes an equivalent of
> the operator= that can be overidden.
>
> Let's say I have
> >>> a=A()
> and I want to write
> >>> a=5
> and I want this to change some internal value of a instea
Hello.
I recently installed Python2.4 on both Linux (Redhat FC3) and Windows
XP. The build and installed went fine as far as I could tell. I
Windows, when I bring up IDLE, or pythonwin, I can't bring up a new
Frame widget with Tk().
If I use idle from a DOS window, everything's fine. Python progr
On Mon, Jun 13, 2005 at 03:52:14PM +0200, Xavier Décoret wrote:
> In other word, I would like to be able to use a=5 instead of a.set(5)
If a(5) is acceptable to you in stead of a=5
you can make your instance callable with the __call__ method:
class A(object):
def __init__(self):
self
Hi I am looking for a simple tiff Image reader/writer in python.Can
anyone point me to the right one.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> When you read a Windows text file using "r" mode, what happens to the \r
> immediately before the newline? Do you have to handle it yourself? Or will
> Python cleverly suppress it so you don't have to worry about it?
>
> And when you write a text file under Python using "w
Pyparsing is a pure-Python class library for quickly and easily
constructing recursive-descent parsers. Pyparsing takes a
"building-block" approach to parser construction, as opposed to code
generation methods (such as lex/yacc) or pattern definition strings
(such as regular expressions).
Version
Hi,
After much googling, I still cannot find any tool/module for producing a
(static) call graph of a program. I have got nearly to my aim with
trace.py, though it must actually run the program and the output would
have to be parsed after; and doxygen + pythfilter.py, which should work,
but did n
(sorry if this is a double-post - I tried posting this last night but I
think GoogleGroups ate it)
Pyparsing is a pure-Python class library for quickly and easily
constructing recursive-descent parsers. Pyparsing takes a
"building-block" approach to parser construction, as opposed to code
generat
I am using the % operator to create queries for a db app. It works fine
when exact strings, or numbers are used, but some queries need partial
matching that use the '%' as a wildcards. So for example the resultant
string should be 'WHERE name LIKE %smith%' (would match silversmith,
smithy, an
Hi,
Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine
man :-)
My question is : How can i rwite a script that show my current ip. If i have
more than one network card, the script must then show all used ip.
It's important that this will work on a linux. i Have rwite some piece
William Gill wrote:
> I am using the % operator to create queries for a db app. It works fine
> when exact strings, or numbers are used, but some queries need partial
> matching that use the '%' as a wildcards. So for example the resultant
> string should be 'WHERE name LIKE %smith%' (would ma
> to return 'WHERE name LIKE %smith%'I have tried using escapes,
> character codes for the % sign, and lots of other gyrations with no
> success. The only thing that works is if I modify searchterm first:
>
>searchterm = 'smith'
>searchterm ='%'+'smith'+'%'
>sql += 'WHE
David Van Mosselbeen wrote:
> Hi,
> Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine
> man :-)
>
> My question is : How can i rwite a script that show my current ip. If i have
> more than one network card, the script must then show all used ip.
>
> It's important that this wi
On 13 Jun 2005 07:55:04 -0700,
"PyPK" <[EMAIL PROTECTED]> wrote:
> Hi I am looking for a simple tiff Image reader/writer in python.Can
> anyone point me to the right one.
I don't know what your definition of "simple" is, but check out the
Python Imaging Library (PIL) at effbot.org.
Regards,
Dan
Hi,
This is certainly off topic, but as my problem must have a pythonic answer.
I'm building an utility that makes a catalog of M$ word files in a giant
directory tree. The password protected files must be marked, and I
didn't find how to guess which files are password protected and which
ones
On Mon, 13 Jun 2005 15:12:54 GMT,
William Gill <[EMAIL PROTECTED]> wrote:
> I am using the % operator to create queries for a db app. It works fine
> when exact strings, or numbers are used, but some queries need partial
> matching that use the '%' as a wildcards. So for example the resultant
> s
Hi there,
I've just started my first project with Tkinter.
I've already coded all the data handling classes and have a nice
interface to work with (it happens to be a wrapper around the DOM of a
large(ish) XML document but thats probably not important ;-)
I'm new to Tkinter so I've started in a
Previously, on Jun 13, Qiangning Hong said:
# David Van Mosselbeen wrote:
# > Hi,
# > Im a newbie in Python, and also in Fedora Core 3. (Yes, Linux is fine
# > man :-)
# >
# > My question is : How can i rwite a script that show my current ip. If i have
# > more than one network card, the script
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sorry about that I had an instance of ie running in the background that
> was version 0 didn't see the problem tell this morining when my
> computer started to not work. it should be hwnds[1] should be
> hwnds[0]. I woud enumerate the
Peter Hansen wrote:
> Chinook wrote:
>
>>On Sun, 12 Jun 2005 17:19:06 -0400, Peter Hansen wrote:
>>
>>>Case statements are actually more suitable in many cases even when
>>>performance is not a goal for reasons of *readability*.
>>>
>>>When reading an if statement, you have to scan down through e
Perhaps you can use OpenOffice and it's python UNO Bindings?
I only know about their existence, but perhaps this will be a starting
point: http://udk.openoffice.org/
HTH,
Gerald
Gilles Lenfant schrieb:
> Hi,
>
> This is certainly off topic, but as my problem must have a pythonic answer.
>
> I'
[Gilles Lenfant]
| I'm building an utility that makes a catalog of M$ word files
| in a giant
| directory tree. The password protected files must be marked, and I
| didn't find how to guess which files are password protected and which
| ones are not.
|
| I can't use the COM interface for this
Thomas Lotze wrote:
> Peter Hansen wrote:
>
>
>>Thomas Lotze wrote:
>>
>>>I can see two possibilities to do this: either the current file position
>>>has to be read from somewhere (say, a mutable object passed to the
>>>generator) after each yield, [...]
>>
>>The third approach, which is certain
Hi all,
I once read that it is possible to use a python base class for a C
extension class. To be precise, I want to achieve the following
behavior:
class PythonClass :
pass
class CClass(PythonClass) :
"this class should be implemented as C extension"
pass
Unfortunate
Xavier Décoret a écrit :
> I would like to know if there is for python's classes an equivalent of
> the operator= that can be overidden.
>
> Let's say I have
> >>> a=A()
> and I want to write
> >>> a=5
> and I want this to change some internal value of a instead of making a
> point to a new ob
-Original Message-
From: Hughes, Chad O
Sent: Monday, June 13, 2005 9:09 AM
To: 'Fred Dixon'
Subject: RE: [python-win32] NTService detecting if the Windows System is
Idle
There may be important processes running in the background (headless
process with no user interaction) that need re
[Grumman wrote]
> alexrait1 wrote:
> > I need an IDE for python that has the ability to show the filds of a
> > class when I write "."
> > Just the way it works in eclipse/JBuilder with java or visual studio
> > with c++
> > For now I treid eric3 and IDLE they don't do this...
> >
>
> The ActiveS
Is there any reflective facility in python
that I can use to define a variable with a
name stored in another variable ?
like I have :
x = "myVarName"
what can I do to declare a new variable with the name of the string
stored in x. And how can I access that implicitly later ?
--
http://mail.python
Dan Sommers wrote:
> On Mon, 13 Jun 2005 15:12:54 GMT,
> William Gill <[EMAIL PROTECTED]> wrote:
>
>
>>I am using the % operator to create queries for a db app. It works fine
>>when exact strings, or numbers are used, but some queries need partial
>>matching that use the '%' as a wildcards. So f
On Mon, 13 Jun 2005, Roy Smith wrote:
> O(2) behavior
Um ...
> Lisp, of course, expanded my mind in ways that only Lisp can (the same
> could be said for many things I tried back in those days).
Surely you're not saying you experimented with ... APL?
> I think it's probably just as important
On Monday 13 June 2005 12:55 am, Andrea Griffini wrote:
> On Sun, 12 Jun 2005 20:22:28 -0400, Roy Smith <[EMAIL PROTECTED]> wrote:
>
> >How far down do you have to go? What makes bytes of memory, data busses,
> >and CPUs the right level of abstraction?
>
> They're things that can be IMO genuine
Fredrik Lundh wrote:
> Chris Spencer wrote:
>
> > If an XML parser reads in and then writes out a document without having
> > altered it, then the new document should be the same as the original.
>
> says who?
Good question. There is no One True Answer even within the XML
standards.
It all boils
Ali Razavi wrote:
> Is there any reflective facility in python
> that I can use to define a variable with a
> name stored in another variable ?
> like I have :
> x = "myVarName"
>
> what can I do to declare a new variable with the name of the string
> stored in x. And how can I access that implici
On Sunday 12 June 2005 07:33 am, Dan Sommers wrote:
> > There is no case statement in Python. If you don't care about
> > readability, one alternative is to use a dictionary:
>
> > case = {5: do_this, 6: do_that}
> > case.get(x, do_something_else)()
>
> I find this very readable. YMMV.
Yeah, an
Dan Sommers wrote:
> Let the DB-API do more work for you:
>
> cursor = connection.cursor( )
> sql = """SELECT column2, columns3 FROM table WHERE name LIKE %s"""
> values = ('%%%s%%' % searchterm,) # note that this is a tuple
It looks like this might be a rare case where not using the
On Mon, 13 Jun 2005 16:45:11 +0100, "Richard Lewis"
<[EMAIL PROTECTED]> said:
>
> Whats going wrong? Is it a 'circular import'? Is there a better way that
> I could organise these modules?
>
I've got a hack which I'm not happy with:
I've got rid of the main.py module and put its code into the s
Xavier Décoret wrote:
> What I wanted to do is something like this:
>
> def change(x,v):
> x = v
>
> class A(object):
> def __init__(self,v):
> self.x = v
>
> a = A(3)
> print a.x # displays 3
> change(a.x,4)
> print a.x # still displays 3
How about this?
def change(x, v):
Ali Razavi wrote:
> Ali Razavi wrote:
>
>>Is there any reflective facility in python
>>that I can use to define a variable with a
>>name stored in another variable ?
> Got it! use higher order functions like Lisp!
No, you use higher order functions like Python. :)
> code = x + '= 0'
> exec(cod
"harold fellermann" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>if you write
> >>> a=A()
>an instance of class A is created and bound to the local identifier 'a'.
I think it perhaps better to think of the label 'a' being bound to the
object rather than vice versa. For one,
On 13.06.2005, at 19:23, Terry Reedy wrote:
>
> "harold fellermann" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>> if you write
> a=A()
>> an instance of class A is created and bound to the local identifier
>> 'a'.
>
> I think it perhaps better to think of the label 'a' b
Robin Becker <[EMAIL PROTECTED]> writes on Sun, 12 Jun 2005 09:22:52 +:
> I'm using a polling loop in a thread that looks approximately like this
>
> while 1:
> p = find_a_process()
> rc = p.poll()
> if rc is not None:
> out, err = p.communicate()
> #deal with
Benji York <[EMAIL PROTECTED]> writes:
[snap]
>> code = x + '= 0'
>> exec(code)
>
> You should generally stay away from exec for lots of reasons.
Code 'refactorizability' is one of them.
--
http://mail.python.org/mailman/listinfo/python-list
Terry> Yeah, and I find this even more so:
Terry> case = {
Terry> 5: do_this,
Terry> 6: do_that,
Terry> }
Terry> case.get(x, do_default)()
Terry> Which is looking pretty close to a case statement, anyway.
Sure, modulo namespace issues.
Skip
You should also check out eric3. It is cross-platform, free, very
advanced, and with a super active development community.
-RM
alexrait1 wrote:
> I need an IDE for python that has the ability to show the filds of a
> class when I write "."
> Just the way it works in eclipse/JBuilder with java or
oops. I didn't see the part about you having tried eric3 already. For
your part, you may have missed the very good auto-completion tools
available for eric3. Look here:
http://www.die-offenbachs.de/detlev/eric3-contrib.html
-RM
--
http://mail.python.org/mailman/listinfo/python-list
Here's the scenario:
You have many hundred gigabytes of data... possible even a terabyte or
two. Within this data, you have private, sensitive information (US
social security numbers) about your company's clients. Your company has
generated its own unique ID numbers to replace the social securi
On Monday 13 June 2005 08:46 am, Thomas Bartkus wrote:
> "Steve Jorgensen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Sat, 11 Jun 2005 11:51:02 -0500, tom <[EMAIL PROTECTED]> wrote:
> >
> > ...
> > >Let me add an Item #3 -
> > >If you have some entrepeneurial savvy and can
>there should be no room for "magic" in a computer
>for a professional programmer.
>
well put. sounds like the makings of a good signature...
--
http://mail.python.org/mailman/listinfo/python-list
Before I answer, let me clarify my position. I am NOT advocating any
change for the 2.x series. I'm not even forwarding any particular
proposal for 3.0/3000. My key (and close to sole) point is that behavior
of > & < is conceptually distinct from ordering in a sorted list, even
though the beha
1 - 100 of 211 matches
Mail list logo