On Tue, 13 Mar 2007 20:42:17 -0700, [EMAIL PROTECTED] wrote:
It should be possible to enumerate all sets of five numbers which sum
to 50 and randomly select one of them.
Of course it's possible. It's also a very inefficient way of doing so. For
five numbers between 1 and 50, there are 50**5 =
Steven D'Aprano [EMAIL PROTECTED] writes:
It should be possible to enumerate all sets of five numbers which sum
to 50 and randomly select one of them.
Of course it's possible. It's also a very inefficient way of doing so. For
five numbers between 1 and 50, there are 50**5 = 312,500,000
Duncan Smith [EMAIL PROTECTED] wrote:
Yes, if the generating processes yield numbers from different
probability mass functions. You could simply look at the likelihood
ratio. Otherwise, the likelihood ratio will be 1.
I was thinking about the same random number generator being used in
Steven D'Aprano [EMAIL PROTECTED] wrote:
Easy-peasey. Just collate the individual numbers from the lists, and graph
their frequencies. You will get quite different distributions. Both are
random, but in different ways.
8 code -
Thanks - I think too complex - was
Gabriel Genellina [EMAIL PROTECTED] wrote:
You can't have two different sets with four equal numbers - it's not a
very difficult thing, it's impossible to distinguish because they're
identical!
Given 4 numbers in the set, the 5th is uniquely determined. By example:
12, 3, 10, 18 *must* end with
On Tue, 13 Mar 2007 23:08:38 -0800, Paul Rubin wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
It should be possible to enumerate all sets of five numbers which sum
to 50 and randomly select one of them.
Of course it's possible. It's also a very inefficient way of doing so. For
five
On Wed, 14 Mar 2007 19:25:46 +1100, Steven D'Aprano wrote:
Now that I've seen your _partition() function, I'm quite impressed. It is
still brute-force, but it avoids generating all 50**5 non-unique lists. By
my count, it only has to throw away 11,294 lists to generate the 2611
unique lists it
Hi everyone,
during our development, we need to write some unit tests that interact
with OpenOffice through pyUno.
Is there anyone who has got any experience on it? As OpenOffice is
quite a large beast, and interaction is rather complex, I would like
to know if there is someone who is willing to
To make the solutions equi-probable, a simple approach is to
recursively enumerate all possibilities and then choose one of them
with random.choice().
Since people are posting their solutions now (originally only hints
were provided for the homework problem), here's mine:
def genpool(n, m):
On Mar 13, 7:54 pm, [EMAIL PROTECTED] wrote:
On Mar 13, 5:57 am, Gerard Flanagan [EMAIL PROTECTED] wrote:
Hello,
I have a third party shell script which updates multiple environment
values, and I want to investigate (and ultimately capture to python)
the environment state after the
On 3月14日, 上午5时44分, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
The reason I want to do simulation but not just crawling is : we have
to check many web pages' front page to see whether it conform to our
visual standard, e.g, it should put a search box on the top part of
the page. It's
manstey a écrit :
Thanks.
All I want to know is whether the newlist, as a list of instances, is
modified. I thought equality was the way to go, but is there a simpler
way? How can I monitor the state of newlist and set a flag if it is
changed in anyway?
thinking-out-loud
Override the
On 13 Mar 2007 11:53:24 -0700, Steve [EMAIL PROTECTED] wrote:
What are the required version of the SOAPpy, PyXML, fpconst that are
needed to run under the Python 2.5 environment on Windows?
SOAPpy doesn't install under Python 2.5 as-is. You'll need to add
source code encodings on all the source
Hi,
I am using paramiko 1.5.3 with python 2.4 and pycrypto 1.9
I need to know if it is possible to catch sysytem level error, like
disk space full or cpu usage indication etc.
Any help would be appriciated.
Regards,
MSK
--
http://mail.python.org/mailman/listinfo/python-list
On 14/03/07, Paul Hummer [EMAIL PROTECTED] wrote:
I actually just read this in the O'Reilly book Python Cookbook, so I
know this answer off the top of my head. OpenOffice files are merely
zip files with well documented XML inside. Use the builtin zip module
to open them, and then it's just
Hi
I have created a simple function called 'addTheString(string str,
string appstr)' and the intension
is to append the 'appstr' to 'str' and use 'str'.
I tried swigging this method. My swigtest.i file is okay as I think
I have added both
- stl.i at top
- std_string.i
Steven D'Aprano [EMAIL PROTECTED] wrote:
Consider the distance between each paid of consecutive poles. The sum of
the distances must add up to the distance from the first to the last, and
if there are two fixed poles plus five in between, there are five
distances.
No there are six
Hi!
Under windows, I drive OOo, from Python, via COM/OLE-automation.
It's run OK, but some bugs, in the OOo-COM-Python, had stop my
devloppements...
However, this way is usable (only on Win, ok?)
@-salutations
--
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin a écrit :
Bruno Desthuilliers [EMAIL PROTECTED] writes:
(snip)
Python has had functions as first class objects and
(quite-limited-but) anonymous functions, map(), filter() and reduce()
as builtin funcs at least since 1.5.2 (quite some years ago).
True, though no iterators so you
Arnaud Delobelle a écrit :
On Mar 13, 8:53 pm, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
Paul Rubin a écrit :
[snip]
Iterators like that are a new Python feature
List comps are not that new (2.0 or 2.1 ?):
print \n.join([contact for name, contact in contacts.items() \
- A c++ program receives a 2D-matrix from python as input and gives a
2D-matrix as output back to python.
pyogre uses swig
ogre is a 3d realtime rendering engine written in c++ so there are
many matrix manipulation there and also pyogre does not modify the
original code
cgkit is a computer
[Alex Martelli]
map([random.randrange(5) for i in xrange(45)].count, xrange(5))
i.e., this gives 5 integers (each between 0 and 45 included) summing to
45 -- add 1 to each of them to get the desired result.
This is a really nice approach. Besides being fast, it is not too
hard to see that
On 14 Mar 2007 02:38:32 -0700, Szabolcs Nagy [EMAIL PROTECTED] wrote:
- A c++ program receives a 2D-matrix from python as input and gives a
2D-matrix as output back to python.
pyogre uses swig
Well, pyogre has few problems with maintenance, and new bindings to
Ogre engine was
created using
Raymond Hettinger wrote:
Since people are posting their solutions now (originally only hints
were provided for the homework problem), here's mine:
Homework problem? Do you have some information from the OP that I can't
find in this thread? Anyway, I consider the 'homework' idea and the
Hi list:
I have googled quite a bit on this matter and I can't seem to find what
I need (I think Im just looking where I'm not suppose to :). I'm
working with code that is not of my authorship and there is a class
attribute that is changes by directly referencing it (object.attr =
value)
Well, pyogre has few problems with maintenance, and new bindings to
Ogre engine was
created using Boost.Python( http://www.ogre3d.org/wiki/index.php/PyOgre )
oh
last time i played with pyogre they made a transition from boost to
swig :)
so they are back again at boost
(the problem with boost
On 3/14/07, Joel Andres Granados [EMAIL PROTECTED] wrote:
I have googled quite a bit on this matter and I can't seem to find what
I need (I think Im just looking where I'm not suppose to :). I'm
working with code that is not of my authorship and there is a class
attribute that is changes by
Hi all
I understand that I can't hope to pass a FILE* from the Windows
version of Python into a SWIG module that I've built using MinGW gcc/g+
+, because apparently the FILE* structure are different and
incompatible.
Is there an official workaround for this? Presumably I need to
implement a
Check out this example from NumPy. This would be the way sanctioned by
the scipy community, as you benefit from a large library of matrix
routines that you can use to prepare/postprocess the data.
http://www.scipy.org/Cookbook/SWIG_and_NumPy
--
Joel Andres Granados a écrit :
Hi list:
I have googled quite a bit on this matter and I can't seem to find what
I need (I think Im just looking where I'm not suppose to :). I'm
working with code that is not of my authorship and there is a class
attribute that is changes by directly
Joel Andres Granados a écrit :
Hi list:
I have googled quite a bit on this matter and I can't seem to find what
I need (I think Im just looking where I'm not suppose to :). I'm
working with code that is not of my authorship and there is a class
attribute that is changes by directly
Hi,
I have a dictionary which may contain various keys/values, however,
it will always contain 'name' and 'age' keys.
This dictionary is kept inside a class, such as
class Person:
def __init__(self, name, age):
self.data = {'name' : name, 'age' : age}
On Mar 14, 7:29 am, abcd [EMAIL PROTECTED] wrote:
Hi,
I have a dictionary which may contain various keys/values, however,
it will always contain 'name' and 'age' keys.
This dictionary is kept inside a class, such as
class Person:
def __init__(self, name, age):
Since people are posting their solutions now (originally only hints
were provided for the homework problem), here's mine:
Well, I never really said it was a homework problem. Sure there are
more implications to my question that I had first imagined and I'm
really happy I could get so many
Hello all,
I have written a web-based voting system (add question, add possible
answers to that question, and let users vote) in python. It uses:
- mod_python
- postgreql (through psycopg2)
It includes basic session and user management.
It's a very simple system, and the
Scott David Daniels wrote:
Bart Willems wrote:
...
I always try to stay away from 'negative' operators if possible, to
improve readability:
while True:
hint = raw_input('\nAre you stuck? y/n: ').lower()
if hint = 'y' or hint = 'n':
break
else:
print 'Please answer
Hello,
When I execfile a file which contains a syntax error, the file becomes
locked and stays this way all the way until I exit the interpreter (I am
unable to delete it, for example). I have tried but failed to find any
way to unlock the file... Is this a bug in Python?
Is there *any* way to
abcd a écrit :
On Mar 14, 7:29 am, abcd [EMAIL PROTECTED] wrote:
Hi,
I have a dictionary which may contain various keys/values, however,
it will always contain 'name' and 'age' keys.
This dictionary is kept inside a class, such as
class Person:
Do yourself a favor : use
Hello all,
I come from a shell/perl background and have just to learn python. To
start with, I'm trying to obtain system information from a Linux
server using the /proc FS. For example, in order to obtain the amount
of physical memory on the server, I would do the following in shell:
grep
abcd wrote:
On Mar 14, 7:29 am, abcd [EMAIL PROTECTED] wrote:
Hi,
I have a dictionary which may contain various keys/values, however,
it will always contain 'name' and 'age' keys.
This dictionary is kept inside a class, such as
class Person:
def __init__(self, name,
Hello,
I'm new to IronPython and COM so please bear with me.
I have a COM interface provided to me. I need to implement this
interface and pass it to a method as a way of implementing
'callbacks'.
However it appears that the methods of my interface object are never
called.
As a alternative, I
tereglow wrote:
Hello all,
I come from a shell/perl background and have just to learn python. To
start with, I'm trying to obtain system information from a Linux
server using the /proc FS. For example, in order to obtain the amount
of physical memory on the server, I would do the
Mark wrote:
and i`ve put it in tel.py (just the same as in the sample) than chmod
it to 777 (just to make sure it isn`t a permission issue) and than i
run it with: ./tel.py
now this is the error that i get:
Traceback (most recent call last):
File ./tel.py, line 12, in module
for
Hi,
I read that logging was thread safe ... but can I use it under a GUI timer ?
Thanks,
hg
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
Joel Andres Granados a écrit :
Hi list:
I have googled quite a bit on this matter and I can't seem to find what
I need (I think Im just looking where I'm not suppose to :). I'm
working with code that is not of my authorship and there is a class
attribute
On 14 Mar, 13:37, tereglow [EMAIL PROTECTED] wrote:
Hello all,
I come from a shell/perl background and have just to learn python.
Welcome aboard!
To start with, I'm trying to obtain system information from a Linux
server using the /proc FS. For example, in order to obtain the amount
of
Slawomir When I execfile a file which contains a syntax error, the file
Slawomir becomes locked and stays this way all the way until I exit the
Slawomir interpreter (I am unable to delete it, for example). I have
Slawomir tried but failed to find any way to unlock the file... Is
Steve Holden a écrit :
Regular expressions aren't really needed here. Untested code follows:
for line in open('/proc/meminfo').readlines:
for line in open('/proc/meminfo').readlines():
if line.startswith(Memtotal:):
name, amt, unit = line.split()
print name, amt, unit
On Wed, 2007-03-14 at 01:39 -0700, PaoloB wrote:
Hi everyone,
during our development, we need to write some unit tests that interact
with OpenOffice through pyUno.
Is there anyone who has got any experience on it? As OpenOffice is
quite a large beast, and interaction is rather complex, I
Divya wrote:
Hello,
I'm new to IronPython and COM so please bear with me.
I have a COM interface provided to me. I need to implement this
interface and pass it to a method as a way of implementing
'callbacks'.
However it appears that the methods of my interface object are never
I come from a shell/perl background and have just to learn python. To
start with, I'm trying to obtain system information from a Linux
server using the /proc FS. For example, in order to obtain the amount
of physical memory on the server, I would do the following in shell:
grep ^MemTotal
My take was that this is an effort to manipulate these files without the
need for Open Office, so I replied as follows:
Open Office files (.ods and perhaps .odt) are just zipped or gzipped.
Unpack that and then you are dealing with manipulating regular text
files--probably HTML.
Duncan Smith wrote:
greg wrote:
Gabriel Genellina wrote:
The 5th number is not random.
More precisely, the fifth number is not *independent*
of the others. You can't have five independent random
numbers that sum to 50; only four independent numbers
plus a dependent one.
--
Greg
In
On 14 Mar, 14:48, Carsten Haese [EMAIL PROTECTED] wrote:
On Wed, 2007-03-14 at 01:39 -0700, PaoloB wrote:
Hi everyone,
during our development, we need to write some unit tests that interact
with OpenOffice through pyUno.
Is there anyone who has got any experience on it? As OpenOffice is
Raymond Hettinger [EMAIL PROTECTED] wrote:
[Alex Martelli]
map([random.randrange(5) for i in xrange(45)].count, xrange(5))
i.e., this gives 5 integers (each between 0 and 45 included) summing to
45 -- add 1 to each of them to get the desired result.
This is a really nice approach.
On 14 Mar, 14:52, Shane Geiger [EMAIL PROTECTED] wrote:
My take was that this is an effort to manipulate these files without the
need for Open Office, so I replied as follows:
Open Office files (.ods and perhaps .odt) are just zipped or gzipped.
Unpack that and then you are dealing with
On Mar 14, 9:02 am, imx [EMAIL PROTECTED] wrote:
Cool, but does it mean that I will need .net to run the code?
Yep - runtime is free though as is IronPython. For my program the
license is BSD.
Cheers,
Davy
--
http://mail.python.org/mailman/listinfo/python-list
Hendrik van Rooyen wrote:
Duncan Smith [EMAIL PROTECTED] wrote:
Yes, if the generating processes yield numbers from different
probability mass functions. You could simply look at the likelihood
ratio. Otherwise, the likelihood ratio will be 1.
I was thinking about the same random
I currently use Java to generate a 150 page PDF from about 50 .odt files,
including replacing occurrances of about 10 place-holder phrases from data
in our system. I do not use the OOo database/mailmerge features, just UNO.
This process takes about 20 seconds on my 2 year old XP laptop and about
What should I be using to replace Numeric/arrayobject.h:
numpy/arrayobject.h
or
numpy/oldnumeric.h
Thanks,
VJ
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 13, 5:34 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi all.
I have a problem with some code :(
---
hint = raw_input(\nAre you stuck? y/n: )
hint = hint.lower()
while (hint != 'n') or (hint != 'y'):
hint = raw_input(Please specify a valid choice: )
I'd even make
metaperl wrote:
Without even checking them all out, I'm thinking the Amara XML Toolkit
must be the most feature-packed.
Please check out lxml before you post FUD like this.
http://codespeak.net/lxml/
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
When is it appropriate to use dict.items() vs dict.iteritems. Both
seem to work for something like:
for key,val in mydict.items():
print key,val
for key,val in mydict.iteritems():
print key,val
Also, when is it appropriate to use range() vs xrange(). From my
understanding, xrange()
Raymond: It looks to me as if you are trying to turn a generator into
a list in the final line. That doesn't work.
Raymond Hettinger wrote:
To make the solutions equi-probable, a simple approach is to
recursively enumerate all possibilities and then choose one of them
with
Drew a écrit :
When is it appropriate to use dict.items() vs dict.iteritems. Both
seem to work for something like:
for key,val in mydict.items():
print key,val
for key,val in mydict.iteritems():
print key,val
Also, when is it appropriate to use range() vs xrange(). From my
hi all. What i need to know is if there is some function like
os.getuid(), but taking an argument (the username, off course), so i can
do getuid('myuser')
Thanks you dudes!
Gerardo
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 13, 3:16 pm, Gabriel Genellina [EMAIL PROTECTED]
wrote:
En Tue, 13 Mar 2007 10:38:24 -0300, Patrick Altman [EMAIL PROTECTED]
escribió:
Yes, it's a known problem. See this message with a
self-response:http://mail.python.org/pipermail/python-list/2006-March/375087.html
Are there
On Mar 14, 11:44 am, Laurent Pointal [EMAIL PROTECTED] wrote:
Both work, you may prefer xrange/iteritems for iteration on large
collections, you may prefer range/items when processing of the result
value explicitly need a list (ex. calculate its length) or when you are
going to manipulate the
Steven D'Aprano [EMAIL PROTECTED] writes:
If you generate all the possible sets of five numbers between 1 and 50,
there are 50**5 of them, not 2611.
Yes, the idea is generate only the sets that add up to 50.
unique_partitions(60, 6) takes 0.8 seconds; unique_partitions(80, 8)
takes about 25
Raymond Hettinger [EMAIL PROTECTED] writes:
Since people are posting their solutions now (originally only hints
were provided for the homework problem), here's mine:
def genpool(n, m):
if n == 1:
yield [m]
else:
for i in xrange(1, m):
for rest in
Thanks for all the responces, both on and off list.
So, I should forget about the DLL, and if I intend to connect the thing
to a Linux computer, I'll have to develop the code myself for
communicating with it over USB. Fair enough. I might even try that.
I've done some surfing since yesterday.
Ahoj všeci,
Tak nějak prakticky poprvé se dostávám k tomu,
jak přečíst unicode řetězce ze souboru, který
je uložen ve formátu UTF-8 se signaturou
na začátku (BOM). Nějak se mi nedaří.
Mám takovýto soubor.txt v UTF-8 s BOM
=
První řádek.
Druhý řádek.
Třetí
In [EMAIL PROTECTED], Laurent Pointal wrote:
Steve Holden a écrit :
Regular expressions aren't really needed here. Untested code follows:
for line in open('/proc/meminfo').readlines:
for line in open('/proc/meminfo').readlines():
for line in open('/proc/meminfo'):
if
On 14 Mar, 16:15, Stefan Behnel [EMAIL PROTECTED] wrote:
metaperl wrote:
Without even checking them all out, I'm thinking the Amara XML Toolkit
must be the most feature-packed.
Please check out lxml before you post FUD like this.
http://codespeak.net/lxml/
Calm down, Stefan! The inquirer
print and softspace in python
In python, whenever you use print statement it will append a
newline by default. If you don't want newline to be appended, you got
use a comma at the end (print 10,)
When, you have a list of characters and want them to be printed
together a string using a for loop,
All,
Thanks for the suggestions!
I think that I will move forward with elementsoap instead of soappy...
Steve
On Mar 13, 11:53 am, Steve [EMAIL PROTECTED] wrote:
Hi All,
What are the required version of the SOAPpy, PyXML, fpconst that are
needed to run under the Python 2.5 environment on
Paul Rubin wrote:
def genpool(n, m):
if n == 1:
yield [m]
else:
for i in xrange(1, m):
for rest in genpool(n-1, m-i):
yield rest + [i]
import random
print random.choice(list(genpool(n=4, m=20)))
This generates a lot of the
Steven D'Aprano [EMAIL PROTECTED] writes:
list(_partitions(25, 24))
[(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2)]
list(_partitions(25, 25))
[]
Hmm. I'll look into this later if I get a chance. Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I'm rewriting some code from other language to Python; can anyone
explain me which way is the simpliest:
I have
class C1():
def __init__(self):
self.a = 5
class C2(C1):
def __init__(self):
self.b = 8
c = C2()
print c.b#prints 8
print c.a#prints error, because
On Mar 14, 11:57 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
In [EMAIL PROTECTED], Laurent Pointal wrote:
Steve Holden a écrit :
Regular expressions aren't really needed here. Untested code follows:
for line in open('/proc/meminfo').readlines:
for line in
On Mar 14, 1:52 am, hg [EMAIL PROTECTED] wrote:
Hi,
I read that logging was thread safe ... but can I use it under a GUI timer ?
Thanks,
hg
That was barely enough information to be worthy of a reply. Need more
than that. What do you mean under a gui timer? What gui? What type of
usage?
Paul Boddie wrote:
On 14 Mar, 16:15, Stefan Behnel [EMAIL PROTECTED] wrote:
metaperl wrote:
Without even checking them all out, I'm thinking the Amara XML Toolkit
must be the most feature-packed.
Please check out lxml before you post FUD like this.
http://codespeak.net/lxml/
Calm down,
dmitrey schrieb:
Hi all,
I'm rewriting some code from other language to Python; can anyone
explain me which way is the simpliest:
I have
class C1():
def __init__(self):
self.a = 5
class C2(C1):
def __init__(self):
self.b = 8
c = C2()
print c.b#prints 8
# Just by looking at the output, it seems pretty obvious that xrange
would be more memory effcient for large ranges:
print With range():,range(100,200)
print
print With xrange():,xrange(100,200)
d = {1:2,2:3,3:4}
d.items()
d.iteritems()
# I have been curious to use Pysizer (which requires
dmitrey wrote:
Hi all,
I'm rewriting some code from other language to Python; can anyone
explain me which way is the simpliest:
I have
class C1():
def __init__(self):
self.a = 5
class C2(C1):
def __init__(self):
self.b = 8
c = C2()
print c.b#prints 8
I can't find these via web serch
thank you in advance,
Dmitrey
--
http://mail.python.org/mailman/listinfo/python-list
dmitrey [EMAIL PROTECTED] writes:
I can't find these via web serch
thank you in advance,
Dmitrey
str2func: getattr(some_module, 'f')
func2str: f.__name__
ischar: isinstance(x, basestring) and len(x) == 1
isfunc: callable(x) # is most likely to be what you want
'as
--
Laurent Pointal wrote:
Both work, you may prefer xrange/iteritems for iteration on large
collections, you may prefer range/items when processing of the result
value explicitly need a list (ex. calculate its length) or when you are
going to manipulate the original container in the loop.
xrange
Anton Vredegoor wrote:
def memoize(fn):
cache = {}
def proxy(*args):
try: return cache[args]
except KeyError: return cache.setdefault(args, fn(*args))
return proxy
Sorry this doesn't work in this case. This works:
def memoize(fn):
cache = {}
dmitrey wrote:
I can't find these via web serch
You won't find exact equivalents. But, the same functionality is
available. Perhaps you would like to show us what you are trying to do
in Python.
Python's eval has some similarity with str2func
Python's repr() or str() has some similarity
Thank you
(however in MATLAB ischar is the same as isstr)
but what if I don't know the name of module?
I.e. I have
def myfunc(param): ...
#where param can be both funcName or a function, and I want to obtain
both name and func, something like
if isinstance(param, basestring):
func, funcName =
Thanks Jeff for all the great advice on where to look next, including help
with mailman. (I fell off the list and am using this reply to figure out
why!) Just switched to gmail and still learning it too.
And thanks for being so kind in the code review. Fundamentally, I had too
many imported
Phoe6 schrieb:
print and softspace in python
In python, whenever you use print statement it will append a
newline by default. If you don't want newline to be appended, you got
use a comma at the end (print 10,)
When, you have a list of characters and want them to be printed
together a string
Hello!
I want to assign self to object of parent class in constructor, like
def my_func():
...
return ParentClass()
class MyClass (ParentClass):
def __init__(self):
self = my_func()
but it not work, because object not initialized. What i can do?
--
Okay,
It is now working as follows:
memFile = open('/proc/meminfo')
for line in memFile.readlines():
if line.startswith(MemTotal):
memStr = line.split()
memTotal = memStr[1]
memFile.close()
print Memory: + memTotal + kB
I'm learning the whole try,
inline wrote:
Hello!
I want to assign self to object of parent class in constructor, like
def my_func():
...
return ParentClass()
class MyClass (ParentClass):
def __init__(self):
self = my_func()
but it not work, because object not initialized. What i can do?
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Gerardo Herzig wrote:
hi all. What i need to know is if there is some function like
os.getuid(), but taking an argument (the username, off course), so i can
do getuid('myuser')
Thanks you dudes!
Gerardo
Please refer
Hi! I need to connect to Oracle.
I found this binding,
http://www.zope.org/Members/matt/dco2
that is the recommended in the Python page.
But that page seems a bit confuse to me. In the upper right corner says
that the last release is PreRelease 1, from 2001-11-15.
At the bottom, however, it
I would suggest using cx_Oracle as I have had good experience with it.
http://www.cxtools.net/default.aspx?nav=cxorlb
-Josh
On 3/14/07, Facundo Batista [EMAIL PROTECTED] wrote:
Hi! I need to connect to Oracle.
I found this binding,
http://www.zope.org/Members/matt/dco2
that is the
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
inline wrote:
Hello! I want to assign self to object of parent class in
constructor, like
def my_func(): ... return ParentClass()
class MyClass (ParentClass): def __init__(self): self = my_func()
but it not work, because object not
1 - 100 of 225 matches
Mail list logo