If I have a string that contains the name of a function, can I call it?
As in:
def someFunction():
print "Hello"
s = "someFunction"
s() # I know this is wrong, but you get the idea...
/David
--
http://mail.python.org/mailman/listinfo/python-list
I don't know exactly what a COM object is, but those aren't them. The
win32com package takes care of converting everything to Python types.
The excel call returns a tuple of tuples. That is, the outer tuple is
the sequence of rows, and each such row is itself a tuple with one
member per column requ
"David Rasmussen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I have a string that contains the name of a function, can I call it?
> As in:
>
> def someFunction():
> print "Hello"
>
> s = "someFunction"
> s() # I know this is wrong, but you get the idea...
>
> /David
Lookup th
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Thomas Bartkus wrote:
> > Well, I'm looking at the source for the ever popular MySQLdb library. It
> > appears to be nothing but straight up Python source code. I see no
reason
> > why you couldn't just take these modules
I am new to Python and have to create an import library in C that uses
matrices.
These matrices can be one-dimensional (vectors) or two-dimensional. If I
look in the ActivePython 2.4 documentation at data structures, then I see at
least 2 posibilities to represent them: Lists and Tuples.
The d
Grant Edwards <[EMAIL PROTECTED]> wrote:
> Doesn't your OS have an entropy-gathering RN generator built-in?
Alternatively, if you want lots of high-quality random numbers, buy
a cheap web camera: http://www.lavarnd.org/ . Using data from the
Internet is just a bad idea.
Neil
--
http://mail.
Well that looks quite nice, so I'll work that into my script. Thanks!!!
That 1-tuple business was confusing me, and I was getting errors stating
something about converting an object, so as you can see, I was grasping
at straws.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL
Tor Erik Sønvisen wrote:
> Hi
>
> I need a time and space efficient way of storing up to 6 million bits.
The most space-efficient way of storing bits is to use the bitwise
operators on an array of bytes:
import array
class BitList(object):
def __init__(self, data=None):
self._data = arr
> Tuples or lists for matrix-like functionality?
Use lists. Tuples are meant for small immutable sets of things that go
together. Lists are more like arrays, and you can assign to one
existing element if you want.
One exception, is a short vector is often a tuple like (x, y, z) and
you might wa
Since I'm on the topic of pyzeroconf today, I might as well keep
posting ;)
So on to another platform... windows. Has anyone used pyzeroconf on
Windows recently? It doesn't appear to work (and it isn't the
127.0.0.1 thing either).
Running python Zeroconf.py gives the following:
Multicast DNS Ser
You can certainly have more than one version loaded. You may
find it easier to fall back to Python 2.3. Unless you are
using 2.4 specific features, it won't cost you much. You have
to mess with path, associations, etc. in Windows registry to
switch between the two.
-Larry Bates
clinton Brandt
Peter Notebaert wrote:
> I am new to Python and have to create an import library in C that uses
> matrices.
>
> These matrices can be one-dimensional (vectors) or two-dimensional. If I
> look in the ActivePython 2.4 documentation at data structures, then I see at
> least 2 posibilities to repre
On Wednesday 02 November 2005 04:58 pm, clinton Brandt wrote:
> Hey I am Learning Blender for 3D mesh design and the current Relese doesnt
> recognize my python 2.4.1 it stopped at python 2.3. there alpha test of
> their next release supports py 2.4 but as a noob id like to learn an a less
> bu
In article <[EMAIL PROTECTED]>,
"DENG" <[EMAIL PROTECTED]> wrote:
> Hi, all
>
> I've used Python Bz2 module for times and want to kown something about
> Burrows-Wheeler (BWT) algorithm, the Bz2 module is wrriten in C, is
> there a version in Python too?
>
> BWT
> http://gatekeeper.dec.com/pub/D
Hi Clinton,
If I was you, I would stick for a little while with python 2.3 untill
Blender 2.40 gets stable. In the meantime you can use Movable Python
(python on an usb stick) to program in Python 2.4:
http://www.voidspace.org.uk/python/movpy/
But I guess Blender will become stable soon.
Stani
"Paul McGuire" <[EMAIL PROTECTED]> writes:
> "David Rasmussen" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> If I have a string that contains the name of a function, can I call it?
>> As in:
>>
>> def someFunction():
>> print "Hello"
>>
>> s = "someFunction"
>> s() # I know this
So just stop talking. It's funny that you guys are having a
conversations about not responding to a guys post. First of all,
freedom of speech, blah blah, who cares, just let him alone. But
certainly don't go on his post, reply, telling people not to reply.
That's like saying EVEN THOUGH I'M
Im at the end of chapter 3 of "Python Programming For The Absolute
Beginner, Michael Dawson " and he asks to make a fortune program that
displays a fortune each time its ran, and to have 5 unique fortunes.
Whats confusing is that, he never discussed how to do this. The only
thing he talked about w
BTW, it'd be 6 megabits or 750kb ;)
> Six megabytes is pretty much nothing on a modern computer.
== Posted via Newsgroups.com - Usenet Access to over 100,000 Newsgroups
==
Get Anonymous, Uncensored, Access to West and East Coast Server Farms!
== Highest Retention and Completion Rat
what is .tk? Turkmenistan? or is it just some arbitrary suffix.
> www.javaholics.tk
== Posted via Newsgroups.com - Usenet Access to over 100,000 Newsgroups
==
Get Anonymous, Uncensored, Access to West and East Coast Server Farms!
== Highest Retention and Completion Rates! HTTP:/
[EMAIL PROTECTED] writes:
> Im at the end of chapter 3 of "Python Programming For The Absolute
> Beginner, Michael Dawson " and he asks to make a fortune program that
> displays a fortune each time its ran, and to have 5 unique fortunes.
>
> Whats confusing is that, he never discussed how to do t
In article <[EMAIL PROTECTED]>,
Ben Finney <[EMAIL PROTECTED]> wrote:
> Erik Max Francis <[EMAIL PROTECTED]> wrote:
> > Ben Finney wrote:
> > > If I want to implement a __repr__ that's reasonably "nice" to the
> > > programmer, what's the Right Way? Are there recipes I should look
> > > at?
> >
Though I tried to submit a (pre-) PEP in the proper form through the proper
channels, it has disappeared into the ether.
In building a class that supports Python's slicing interface,
http://groups.google.com/group/comp.lang.python/msg/8f35464483aa7d7b
I encountered a Python bug, which, upon
For more information on Iron Python see http://www.ironpython.com/
My take on Iron Python is the new job the develolper of Iron Python
started last year takes up just about all of his time and the developer
is currently spending very little time actively developing Iron Python.
I suspect it will be
[EMAIL PROTECTED] writes:
> Im at the end of chapter 3 of "Python Programming For The Absolute
> Beginner, Michael Dawson " and he asks to make a fortune program that
> displays a fortune each time its ran, and to have 5 unique fortunes.
>
> Whats confusing is that, he never discussed how to do th
Thomas Bartkus wrote:
> "Steve Holden" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Thomas Bartkus wrote:
>>
>>>Well, I'm looking at the source for the ever popular MySQLdb library. It
>>>appears to be nothing but straight up Python source code. I see no
>
> reason
>
>>>why
IronPython is good if you want to bring in Python into a .NET world.
Python for .NET is good if you want to bring in .NET into a Python
world.
As for your learning concerns, there need be none. There is really
nothing to learn extra for the integration. They just work. Once you
learn the .NET fra
Bryan Olson wrote:
> Though I tried to submit a (pre-) PEP in the proper form through the proper
> channels, it has disappeared into the ether.
>
>
> In building a class that supports Python's slicing interface,
>
>http://groups.google.com/group/comp.lang.python/msg/8f35464483aa7d7b
>
> I e
I downloaded python 2.4. When attempting to run python interpreter, I
get following:
warning: strop functions are obsolete; use string methods
How do I correct this? Did I do install incorrectly?
Thanks - John
--
http://mail.python.org/mailman/listinfo/python-list
I am a fresh here , and I have no idea of it.
Do you have any comments?
--
http://mail.python.org/mailman/listinfo/python-list
entropy wrote:
> [EMAIL PROTECTED] wrote...
>
>>On Tue, 25 Oct 2005 16:54:13 +, John Wingate wrote:
>>
>>
>>>Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>>>
That would be a good guess, except that Microsoft's predatory and illegal
behaviour began long before OS/2 was even planned. It be
You are importing and using, directly or indirectly, the "strop" module.
Here's an example from the interactive interpreter which triggers the warning:
$ python2.3
Python 2.3.3 (#1, May 7 2004, 10:31:40)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits"
On 2005-11-02, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
> Grant Edwards <[EMAIL PROTECTED]> wrote:
>> Doesn't your OS have an entropy-gathering RN generator built-in?
>
> Alternatively, if you want lots of high-quality random numbers, buy
> a cheap web camera: http://www.lavarnd.org/.
The therm
hrh1818 wrote:
> For more information on Iron Python see http://www.ironpython.com/
> My take on Iron Python is the new job the develolper of Iron Python
> started last year takes up just about all of his time and the developer
> is currently spending very little time actively developing Iron Pyth
ice wrote:
> I am a fresh here , and I have no idea of it.
> Do you have any comments?
Why do you want to write your own system? There are already lots of
blog programs written in Python which you could just use, or customize.
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 02 Nov 2005 06:33:28 +, Bengt Richter wrote:
> On Wed, 2 Nov 2005 06:08:22 + (UTC), Paul Cochrane <[EMAIL PROTECTED]>
> wrote:
>
>>Hi all,
>>
>>I've got an application that I'm writing that autogenerates python code
>>which I then execute with exec(). I know that this is not the
Grant Edwards <[EMAIL PROTECTED]> writes:
> On 2005-11-02, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
>> Grant Edwards <[EMAIL PROTECTED]> wrote:
>> Using data from the Internet is just a bad idea.
> I think that the timing of certain network events is one of the
> Linux kernel's entropy sources.
Hello All,
I am comming back to python after being away for several years.
I would like to use weak refs in an observer pattern implementation.
The problme that I have seems to be that weakrefs can't manage functions.
--- from docs:
http://www.python.org/doc/current/lib/module-
hrh1818 <[EMAIL PROTECTED]> wrote:
> For more information on Iron Python see http://www.ironpython.com/
> My take on Iron Python is the new job the develolper of Iron Python
> started last year takes up just about all of his time and the developer
> is currently spending very little time actively
Sorry about this almost off-topic post, but I am guessing there must be
other readers of this group who use Thunderbird (in my case 1.0.2) to
access it as gmane.comp.general.python.
I'm currently showing 344,548 articles in the group due to the gmane
policy of permanent retention, and lately it
Brandon K <[EMAIL PROTECTED]> wrote [inverting his topposting!]:
> > Six megabytes is pretty much nothing on a modern computer.
> BTW, it'd be 6 megabits or 750kb ;)
...but Mike was proposing using one digit per bit, hence, 6 megabytes.
That makes it easy to search for bitpatterns with re or str
Ok, like I mentioned before, I'm learning C# for fun. I'm interested in
learning Python sort of as a "supplement" (by that, I mean a language
with scripting capabilities that can do things maybe simpler than C#
might). One concern I have about learning them simultaneously is that
I'll start to
In my program, I get input from the user and insert it into an XHTML
document. Sometimes, this input will contain XHTML, but since I'm
inserting it as a text node, xml.dom.minidom escapes the angle brackets
('<' becomes '<', '>' becomes '>'). I want to be able to
override this behavior cleanly.
Sori Schwimmer <[EMAIL PROTECTED]> wrote:
...
> 2) Rocco Morreti wrote:
> > What is so repugnant about the equivalent, currently
> valid way of writing it?
> Nothing "repugnant". We have in almost all procedural
> languages an "if-else" construct, and a "case" or
> "elif" as well.
Python has no
The Eternal Squire <[EMAIL PROTECTED]> wrote:
...
> 2) Consider what he really wants for a supervisor of software
> engineers. Ideally such a person should be a software engineer with
> at least 3 times the experience of the most junior member. Such a
I like the general idea but not your fo
Hello All,
Could anyone tell me why this code produces the output it does?
noAdjacencies = 2
gridsPerAdj = 3
rows = 4
columns = 5
gridSystemId = [[None]*columns]*rows
for row in range(rows):
for column in range(columns):
gridSystemId[row][column] = "%d-%d" % (row,column)
print gr
Michael Schneider <[EMAIL PROTECTED]> wrote:
> I would like to use weak refs in an observer pattern implementation.
> The problme that I have seems to be that weakrefs can't manage functions.
They can manage just fine functions written in *Python*, just not
"builtin functions*, i.e., ones written
Newsfeeds <[EMAIL PROTECTED]> wrote:
> Hello All,
>
> Could anyone tell me why this code produces the output it does?
...
> gridSystemId = [[None]*columns]*rows
You've made gridSystemID a list of `rows` references to the SAME "inner"
list, so the behavior you observe is the only possible on
Thank you! I've been banging my head against the wall!
Chris M.
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Newsfeeds <[EMAIL PROTECTED]> wrote:
>
>> Hello All,
>>
>> Could anyone tell me why this code produces the output it does?
> ...
>> gridSystemId = [[
Steve Holden wrote:
> Sorry about this almost off-topic post, but I am guessing there must be
> other readers of this group who use Thunderbird (in my case 1.0.2) to
> access it as gmane.comp.general.python.
>
> I'm currently showing 344,548 articles in the group due to the gmane
> policy of pe
John Salerno <[EMAIL PROTECTED]> writes:
[Wants to learn C# and Python simultaneously.]
> So my question is, is this feasible?
Should be. It might be faster to do them sequentually.
> Or does learning Python require (or entail) learning all the details
> behind it?
Not really. There are some tra
On Thu, 2 Nov 2005 [EMAIL PROTECTED] wrote:
> In my program, I get input from the user and insert it into an XHTML
> document. Sometimes, this input will contain XHTML, but since I'm
> inserting it as a text node, xml.dom.minidom escapes the angle brackets
> ('<' becomes '<', '>' becomes '>'). I
On Thu, 3 Nov 2005, Chris McCoy wrote:
> Thank you! I've been banging my head against the wall!
>
> Chris M.
>> gridSystemId = [[None]*columns]*rows
>
> You've made gridSystemID a list of `rows` references to the SAME "inner"
> list, so the behavior you observe is the only possible one.
>
> If y
I need to stop the program in the middle and pause there.
Are there anyway I can stop the program in the middle and have
something like:
please press y to continue.
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
David Rasmussen wrote:
> If I have a string that contains the name of a function, can I call it?
> As in:
>
> def someFunction():
> print "Hello"
>
> s = "someFunction"
> s() # I know this is wrong, but you get the idea...
py> eval("someFunction()")
'Hello'
py> eval(s)() # note the second
>Ernesto enlightened us with:
>>
>>I'm trying to use a $ delimeter, but it doesn't seem to work. Here is
>>the code:
>>
>>
>>launchWithoutConsole("devcon.exe",d'$enable
>> "@USB\VID_0403&PID_6010&MI_00\7&15E4F68&1&"$)
Where did you get the idea that this would work? I can't find any
referen
"Richard Brodie" <[EMAIL PROTECTED]> wrote:
>
>"Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>
>> On the other hand, I can't imagine any reason why you would want to
>> define such a class,
>
>PEP 754?
My congratulations on a very subtle and somewhat multicultural joke...
"questions?" wrote:
> I need to stop the program in the middle and pause there.
>
> Are there anyway I can stop the program in the middle and have
> something like:
>
> please press y to continue.
portable:
raw_input("please press return to continue.")
to get a single character, you
Mike Meyer wrote:
> Grant Edwards <[EMAIL PROTECTED]> writes:
>
>>On 2005-11-02, Neil Schemenauer <[EMAIL PROTECTED]> wrote:
>>
>>>Grant Edwards <[EMAIL PROTECTED]> wrote:
>>>Using data from the Internet is just a bad idea.
>>
>>I think that the timing of certain network events is one of the
>>Li
You could use either:
s = raw_input("Please Hit a Key...")
s being the string they typed before hitting enter.
or you could use
print "Please hit a key..."
s = sys.stdin.readline()
the only reason i recommend the second is because i believe i saw in a
PEP that raw_input was being de
Are you fresh to Python or just to this group?
There are quite a few python frameworks that provide functionality for
blogs.
You'll just have to decide which one you want to try out.
--
http://mail.python.org/mailman/listinfo/python-list
It may, but I haven't been using Pychecker yet. I'm still fairly new to
Python.
Thanks,
Chris M.
"Roman Suzi" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 3 Nov 2005, Chris McCoy wrote:
>
>> Thank you! I've been banging my head against the wall!
>>
>> Chris M.
>
>>> g
"Newsfeeds" <[EMAIL PROTECTED]> wrote:
> Could anyone tell me why this code produces the output it does?
http://www.python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list
has the full story.
--
http://mail.python.org/mailman/listinfo/python-list
Roman Suzi <[EMAIL PROTECTED]> writes:
> On Thu, 3 Nov 2005, Chris McCoy wrote:
>>> gridSystemId = [[None]*columns]*rows
>> You've made gridSystemID a list of `rows` references to the SAME "inner"
>> list, so the behavior you observe is the only possible one.
>> If you want copies instead, ASK for
Thanks guys for the reply.
This is very helpful
--
http://mail.python.org/mailman/listinfo/python-list
try something like ->
s = raw_input("Please Press a button...")
#s is the string they type.
Although i believe i remember a PEP that said they were removing
raw_input so perhaps
print "Please Press A button..."
s = sys.stdin.readline()
would be better, note the above requires yo
Steven D'Aprano wrote:
> Mike Meyer wrote:
>>BSD as well. The key word is "one". While network events don't make a
>>good source of random data, proplery combining such sources can create
>>good random data.
>
>
>
> Depends on what you mean by "random". In particular,
> the randomness of netw
thank you Graham
Now I know how to get it thru
And i have last question is it possible send mail from Lotus via
Python/COM?
Once Again Thanks
--
http://mail.python.org/mailman/listinfo/python-list
201 - 268 of 268 matches
Mail list logo