Shafique, M. (UNU-MERIT) wrote:
Hi,
I have a number of different groups g1, g2, … g100 in my data. Each
group is comprised of a known but different set of members (m1, m2,
…m1000) from the population. The data has been organized in an
incidence matrix:
g1 g2 g3 g4 g5
m1 1 1 1 0 1
m2 1 0 0 1
Hans Georg Schaathun wrote:
Is there a simple way to find the external interface and bind a
socket to it, when the hostname returned by socket.gethostname()
maps to localhost?
What seems to be the standard ubuntu configuration lists the local
hostname with 127.0.0.1 in /etc/hosts. (I checked
Chris Rebert wrote:
On Tue, Apr 26, 2011 at 8:58 AM, Ariel isaacr...@gmail.com wrote:
Hi everybody, how could I concatenate unicode strings ???
What I want to do is this:
unicode('this an example language ') + unicode('español')
but I get an:
Traceback (most recent call last):
File
snorble wrote:
I'm not a Pythonista, but I aspire to be.
My current tools:
Python, gvim, OS file system
My current practices:
When I write a Python app, I have several unorganized scripts in a
directory (usually with several named test1.py, test2.py, etc., from
random ideas I have tested),
Ben Finney wrote:
Mercurial – are the ones to choose from. Anoyone recommending a VCS tool
that has poor merging support (such as Subversion or, heaven help us,
CVS) is doing the newcomer a disservice.
True enough. But the modern crop of first-tier VCSen – Bazaar, Git,
For a single user,
Chris Angelico wrote:
On Wed, Apr 27, 2011 at 7:24 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
For a single user, there would be no merge issue. And svn is very simple to
use.
That would not be a such bad advice for a beginner with VCS systems.
As someone who for years had
Anssi Saari wrote:
Jean-Michel Pichavant jeanmic...@sequans.com writes:
For a single user, there would be no merge issue.
Really? What about a single user with many computers and environments?
I find myself merging files on occasion because I edited them
separately and forgot
1011_wxy wrote:
Hi friends:
Here I need some help.
#encoding=utf-8
#moudle a.py
def a():
print function a!
#encoding=utf-8
#moudle b.py
def b():
print function b!
#encoding=utf-8
#moudle c.py
import a
import b
def c():
a.a()
b.b()
Here in function c,How can i
1011_wxy wrote:
Hi JM:
*python c.py afile.log*
could you pls give me the whole example?
I am so sorry that I am a beginner in Python.
Your module a and b that you cannot modify given your original
description, are printing data using the print statement.
That means these module only
Geoff Bache wrote:
Hi all,
I currently find myself needing a Python read-write lock. I note that
there is none in the standard library, but googling python read-write
lock quickly produced 6 different competing examples, including two
languishing patch proposals for the standard library.
I can
Ethan Furman wrote:
For anybody interested in composition instead of multiple inheritance,
I have posted this recipe on ActiveState (for python 2.6/7, not 3.x):
http://code.activestate.com/recipes/577658-composition-of-classes-instead-of-multiple-inherit/
Comments welcome!
~Ethan~
Sounds
Ben Finney wrote:
Ethan Furman et...@stoneleaf.us writes:
Carl Banks wrote:
That's not what we mean by composition. Composition is when one
object calls upon another object that it owns to implement some of
its behavior. Often used to model a part/whole relationship, hence
the name.
anvar wrote:
Hello,
Could you please help me with the modeling in Python the following
problem: (e.g., g_t means g with index t)
Min∑_(i=1)^n▒∑_(t=1)^l▒[s_i (t)-min[s ̂_i (t)×α_t×exp(g_t ),C_i
(t) ] ]^2
subject to
s_i (t)=f_i (t)[S_i+f_(i-1) (t)[S_(i-1)+f_(i-2) (t)[S_(i-2)+⋯f_2 (t)
[S_2+f_1
Wim Feijen wrote:
Excuse me, this message was sent to the wrong mailing list.
Sorry, Wim
2011/5/3 Wim Feijen w...@go2people.nl mailto:w...@go2people.nl
Dag mannen,
You're lucky that the native language of our Benevolent Dictator For
Life is tolerated in this list.
JM
--
James Mills wrote:
On Wed, May 4, 2011 at 10:45 AM, Astan Chee astan.c...@gmail.com wrote:
Hi,
I'm trying to make a python script (in windows 7 x64 using python 2.5) to
start a process, and kill it after x minutes/seconds and kill all the
descendants of it.
Whats the best way of doing this
James Mills wrote:
On Tue, May 10, 2011 at 10:40 AM, Kyle T. Jones
onexpadrem...@evomeryahoodotyouknow.com wrote:
It has been hard for me to determine what would constitute overuse.
A rule of thumb I always follow and practice is:
Let the error lie where it occurred.
or
Don't hide
Littlefield, Tyler wrote:
Hello:
Thanks all for your information and ideas. I like the idea of open
source; I have a fairly large (or large, by my standards anyway)
project that I am working on that is open source.
Here's kind of what I want to prevent. I want to write a multi-player
online
Cathy James wrote:
f = open ('c:/testing.txt'', 'r')
replace the double quote by a single quote.
JM
--
http://mail.python.org/mailman/listinfo/python-list
RVince wrote:
Ha! You;re right -- but is there a way to get it without the filename
appended at the end?
On May 24, 11:52 am, Tim Golden m...@timgolden.me.uk wrote:
On 24/05/2011 16:36, RVince wrote:
s = C:\AciiCsv\Gravity_Test_data\A.csv
f = open(s,r)
How do I obtain the full
Lew Schwartz wrote:
So, if I read between the lines correctly, you recommend Python 3?
Does the windows version install with a development environment?
If you want to use python 3, make sure before that all the good stuff
you need (==modules) have been ported to python 3.
If you are a
- Original Message -
On Feb 23, 2014, at 1:44 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Sorry, I don't really understand your question. Could you show an
example
of what you are doing?
Do you mean add 5 or *5? Add *5 doesn't really mean anything
- Original Message -
On Sun, 23 Feb 2014 10:20:15 -0800, Pierre Quentel wrote:
The new home page of python.org is very nice, congratulations !
The best I can say about it is that I'm extremely underwhelmed by the
design, which is far more busy and colourful than the old design
- Original Message -
Hello,
I'm sure this is a common question but I can't seem to find a
previous thread that addresses it. If one one exists, please point
me to it.
I've been developing with python recreationally for a while on Ubuntu
but will soon be transitioning to
- Original Message -
Hello Experts,
I have requirement, like i want to use below command in python
script.
command --username username --password password Command line
arguments
now my requirement is i want to write some class so i can re-use
command --username username
- Original Message -
Hi,
I am using Thread class to create threads.
CODE
thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3=val])
thread.start()
/CODE
This code is throwing compilation error(Ipython).
In [19]: import threading
In [20]: def Fun(agr1, arg2,
- Original Message -
One of my roles on this newsgroup is to periodically whine about
stupidities in the Python datetime module. This is one of those
times.
I have some code which computes how long ago the sun set. Being a
nice
pythonista, I'm using a timedelta to represent this
- Original Message -
We've recently started using pyflakes. The results seem to be
similar
to most tools of this genre. It found a few real problems. It
generated a lot of noise about things which weren't really wrong, but
were easy to fix (mostly, unused imports), and a few plain
- Original Message -
Hello,
I'm pleased to announce the release of Nevow 0.11.1.
Nevow is a web application construction kit written in Python and
based
on Twisted. It is designed to allow the programmer to express as much
of
the view logic as desired in Python, and includes a
Martin P. Hellwig wrote:
On 11/15/11 12:04, Roark wrote:
Hi,
I am first time trying my hands on python scripting and would need
some guidance from the experts on my problem.
I want to execute a windows command within python script from a client
machine on a remote target server, and would
David Riley wrote:
On Nov 15, 2011, at 12:35 PM, Andreea Babiuc wrote:
On 15 November 2011 17:24, Chris Kaynor ckay...@zindagigames.com wrote:
As with any Python code, you can wrap the import into a try: except block.
try:
import badModule
except:
pass # Or otherwise handle the
sword wrote:
The logging cookbook gives an Filter example, explainning how to add
contextural info to log. I can't figure out how to filter log from it.
Suppose I have 3 file, a.py, b.py and main.py
#file: a.py
import logging
logger=logging.getLogger(__name__)
def print_log():
GZ wrote:
Hi,
I have a class Record and a list key_attrs that specifies the names of
all attributes that correspond to a primary key.
I can write a function like this to get the primary key:
def get_key(instance_of_record):
return tuple(instance_of_record.__dict__[k] for k in key_attrs)
sword wrote:
On Nov 16, 7:40 pm, Jean-Michel Pichavant jeanmic...@sequans.com
wrote:
sword wrote:
The logging cookbook gives an Filter example, explainning how to add
contextural info to log. I can't figure out how to filter log from it.
Suppose I have 3 file, a.py, b.py
Gelonida N wrote:
I wondered whether there is any way to un-import a library, such, that
it's occupied memory and the related shared libraries are released.
My usecase is following:
success = False
try:
import lib1_version1 as lib1
import lib2_version1 as lib2
success = True
Jean-Michel Pichavant wrote:
Gelonida N wrote:
I wondered whether there is any way to un-import a library, such, that
it's occupied memory and the related shared libraries are released.
My usecase is following:
success = False
try:
import lib1_version1 as lib1
import lib2_version1
Massi wrote:
Hi everyone,
in my project I have the following directory structure:
plugins
|
-- wav_plug
|
-- __init__.py
-- WavPlug.py
-- mp3_plug
|
-- __init__.py
-- Mp3Plug.py
...
-- etc_plug
|
--
candide wrote:
In which cases should we use the is() function ? The is() function
compares identity of objects rather than values so I was wondering in
which circumstances comparing identities of objects is really vital.
Examining well reputated Python source code, I realize that is()
Jayron Soares wrote:
Hi Felipe,
I did, however I got this error:
Traceback (most recent call last):
File /home/jayron/Downloads/grafos.py, line 48, in module
g, e = ministro_lei()
File /home/jayron/Downloads/grafos.py, line 34, in ministro_lei
for i in G.degree():
TypeError: 'int'
cassiope wrote:
I've been trying to migrate some code to using the standard python
logging classes/objects. And they seem quite capable of doing what I
need them to do. Unfortunately there's a problem in my unit tests.
It's fairly common to have to create quite a few entities in the
course of
Jean-Michel Pichavant wrote:
PS : Try to code document in English, it's much better especially
when asking for help on this list, mixing spanish and english has few
benefits since you may bother both spanish and english ppl :o)
Actually it is english mixed with portuguese, sorry if I
Adrian Powell wrote:
I'm new to python and I'm trying to get a twitter client running on a new
machine but it keeps on failing. I tracked the problem down to an issue opening
URLs and wrote this little test case:
import urllib2
url = 'http://www.google.com/'
opener = urllib2.build_opener()
Roy Smith wrote:
Consider the following django snippet. Song(id) raises DoesNotExist if the id
is unknown.
try:
songs = [Song(id) for id in song_ids]
except Song.DoesNotExist:
print unknown song id (%d) % id
Is id guaranteed to be in scope in the print statement? I
Steven D'Aprano wrote:
On Mon, 05 Dec 2011 19:57:15 +0100, Jean-Michel Pichavant wrote:
The proper way to propagate information with exceptions is using the
exception itself:
try:
songs = [Song(_id) for _id in song_ids]
except Song.DoesNotExist, exc:
print exc
I'm
Roy Smith wrote:
I just spent a while beating my head against this one.
# Python 2.6
a, b = 'foo'
Traceback (most recent call last):
File stdin, line 1, in module
ValueError: too many values to unpack
The real problem is that there's too *few* values to unpack! It should
have
Roy Smith wrote:
On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote:
string are iterable, considering this, the error is correct.
Yes, I understand that the exception is correct. I'm not saying the exception
should be changed, just that we have
Ethan Furman wrote:
Jean-Michel Pichavant wrote:
You have to opportunity to not use unpacking anymore :o) There is a
recent thread were the dark side of unpacking was exposed. Unpacking
is a cool feautre for very small applications but should be avoided
whenever possible otherwise.
Which
Roy Smith wrote:
MRAB pyt...@mrabarnett.plus.com wrote:
or use 'globals':
def function(self):
logger = globals()['logger'].getChild('function')
logger.debug('stuff')
logger.debug('other stuff')
Ah-ha! That's precisely what I was looking for. Much
Steven D'Aprano wrote:
On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
Using the same name for 2 different objects is a bad idea in general.
We have namespaces precisely so you don't need to care about making names
globally unique.
I don't get your point
Steven D'Aprano wrote:
On Tue, 13 Dec 2011 10:54:51 +0100, Jean-Michel Pichavant wrote:
Steven D'Aprano wrote:
On Mon, 12 Dec 2011 12:13:33 +0100, Jean-Michel Pichavant wrote:
Using the same name for 2 different objects is a bad idea in general.
We have
Andrea Crotti wrote:
I think is simple but I can't get it to work as I wish.
Suppose I have a big application, my idea is that the running
script sets a global logging level and then all the imported modules
would act consequently.
In my codebase, however, unless I set the level for each of the
Joshua Landau wrote:
On 13 December 2011 13:30, Jean-Michel Pichavant
jeanmic...@sequans.com mailto:jeanmic...@sequans.com wrote:
writing
x = 1
def spam():
x = 2
is in general a bad idea. That was my point.
Why? I have a few (probably wrong) guesses.
Because you
Chris Angelico wrote:
On Wed, Dec 14, 2011 at 9:14 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
The problem makes little sense when using names like x or func1. Besides
namespace issues, naming 2 *different objects* with the same meaningful name
is usually a bad idea and points
Steven D'Aprano wrote:
On Wed, 14 Dec 2011 13:05:19 +0100, Jean-Michel Pichavant wrote:
Bad ideas :
i = 5
def spam():
for i,v in enumerate([1,2,3,4]):
for i,v in enumerate(['a','b', 'c']):
print i, v
print i,v # bad surprise
The bad surprise happens because you
Ian Kelly wrote:
On Wed, Dec 14, 2011 at 1:28 AM, Felipe O pip@gmail.com wrote:
Hi All,
I was wondering what everyone's thought process was regarding properties.
Lately I find I've been binging on them and have classes with 10
properties. While pylint doesn't complain (yet), it tends to
Joshua Landau wrote:
[snip]
Using currentLogger is just padding, in my opinion. *Every *value is
currentvalue.
Not always. I try to keep names on the same object because that object
is supposed to be named that way.
I can change one of the object attribute, but the object named that way
keep
Peter wrote:
Situation: I am subclassing a class which has methods that call other
class methods (and without reading the code of the superclass I am
discovering these by trial and error as I build the subclass - this is
probably why I may have approached the problem from the wrong
viewpoint
Jean-Michel Pichavant wrote:
Peter wrote:
Situation: I am subclassing a class which has methods that call other
class methods (and without reading the code of the superclass I am
discovering these by trial and error as I build the subclass - this is
probably why I may have approached
Yigit Turgut wrote:
class test(test1):
def __init__(self, device):
.
.
.
def _something(self, x=1)
self.dt = data
if __name__ == __main__:
test.something.dt ???
I am trying to call a variable located in a function of a class from
main but couldn't
patr...@bierans.de wrote:
Thanks for the feedback!
I took the time reading and understanding it and to let it getting into my
bones. And I also lost time on reading more of this freaky and interesting
documentation and was testing a lot of different stuff with my enviroment.
My current code
Matthew Pounsett wrote:
[snip]
Second, I'm trying to get a handle on how libraries are meant to
integrate with the applications that use them. The naming advice in
the advanced tutorial is to use __name__ to name loggers, and to allow
log messages to pass back up to the using application's
Ben Finney wrote:
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes:
On Thu, 12 Jan 2012 18:50:13 -0800, alex23 wrote:
Tamer Higazi th9...@googlemail.com wrote:
So, instead of making yourself continuously headache for an
outdated OS I advise [...]
Please
Eduardo Suarez-Santana wrote:
El 13/01/12 11:33, Eduardo Suarez-Santana escribió:
I wonder whether this is normal behaviour.
Even simpler:
$ python
Python 2.7.2 (default, Oct 31 2011, 11:54:55)
[GCC 4.5.3] on linux2
Type help, copyright, credits or license for more information.
r={'a':1};
Chris Angelico wrote:
On Fri, Jan 13, 2012 at 9:34 PM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Recommending an OS to solve one python package installation is zealotry. At
least, advise to use a virtual machine software to try it out, there are
some VM softwares for free working
Jérôme wrote:
Hi all.
Like others before me, I'd like to show you my first python attempt, in the
hope in can get advices on how to improve my coding.
I started learning python and pyGTK last november. I had had a short
experience of GTK with C, but had given up as I lacked time and I found it
Jabba Laci wrote:
Hi,
In a unit test, I want to verify that a function returns a
cookielib.LWPCookieJar object. What is the correct way of doing that?
1) First I tried to figure out its type with type(return_value) but it
is type 'instance'
2) return_value.__class__ .__name__ gives
lh wrote:
Is this possible please? I have done some searching but it is hard to
narrow down Google searches to this question. What I would like to do
is, for example:
1) define a class Foo in file test.py... give it some methods
2) define a file test2.py which contains a set of methods that are
Brian wrote:
I've been banging my head against this for the past hour, and I'm
hoping someone here can set me straight.
[Snip]
but, using the same same python, I'm able to import the module from
the interactive interpreter. The PATH and PYTHONPATH environment
variables are identical in
On Thu, Jan 26, 2012 at 5:58 AM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Brian wrote:
I've been banging my head against this for the past hour, and I'm
hoping someone here can set me straight.
[Snip]
but, using the same same python, I'm able to import
Terry Reedy wrote:
On 1/30/2012 4:30 PM, Roy Smith wrote:
Every so often (typically when refactoring), I'll remove a .py file
and forget to remove the corresponding .pyc file. If I then import
the module, python finds the orphaned .pyc and happily imports it.
Usually leading to confusing and
Steven D'Aprano wrote:
On Tue, 31 Jan 2012 11:26:10 +0100, Jean-Michel Pichavant wrote:
Terry Reedy wrote:
On 1/30/2012 4:30 PM, Roy Smith wrote:
Every so often (typically when refactoring), I'll remove a .py file
and forget to remove the corresponding .pyc file. If I
Terry Reedy wrote:
On 1/31/2012 9:19 AM, Jean-Michel Pichavant wrote:
A: My wheel is flat
B: Buy a new car
A better analogy would be
Q. How do I make my old model car do something (it cannot do)?
A. Get the free new model that has that feature added.
Of course, there is a cost to giving up
Vinay Sajip wrote:
On Jan 24, 2:52 pm, Rob Richardson rdrichard...@rad-con.com wrote:
I use PythonWin to debug the Python scripts we write. Our scripts often use
the log2pyloggingpackage. When running the scripts inside the debugger, we
seem to get oneloggingobject for every time we run
Vinay Sajip wrote:
Sarge, a cross-platform library which wraps the subprocess module in
the standard library, has been released.
What does it do?
Sarge tries to make interfacing with external programs from your
Python applications easier than just using subprocess alone.
MRAB wrote:
On 19/02/2012 20:23, Herman wrote:
I tried to use file to config my logger and I got a weird situation
that each message is outputted twice...
Here is my scenario:
python: 2.6
file abc_logging.conf:
[snip]
[logger_abc]
level=DEBUG
handlers=consoleHandler
qualname=abc
Add this
Michael Torrie wrote:
I do not understand what you are saying, or at least why you are saying
this. But I don't understand most of your posts.
It's a bot. Add it to your kill file.
JM
--
http://mail.python.org/mailman/listinfo/python-list
Arnaud Delobelle wrote:
On 20 February 2012 16:03, Jason Friedman ja...@powerpull.net wrote:
I am logging to HTTP:
logger.addHandler(logging.handlers.HTTPHandler(host, url))
Works great, except if my HTTP server happens to be unavailable:
socket.error: [Errno 111] Connection refused
Nav wrote:
Hi Guys,
I have a custom user form class, it inherits my own custom Form class:
class UserForm(Form):
first_name = TextField(attributes={id='id_firstname'})
Now, everytime UserForm() is instantiated it saves the attributes of
each form members and passes it on to the new
Smiley 4321 wrote:
It requires concepts of 'python persistence' for the code to be designed .
Else it simple.
Looking for some flow??
Hi,
Have a look at http://docs.python.org/library/pickle.html
Cheers,
JM
--
http://mail.python.org/mailman/listinfo/python-list
xixiliguo wrote:
c = [1, 2, 3, 4, 5]
class TEST():
c = [5, 2, 3, 4, 5]
def add( self ):
c[0] = 15
a = TEST()
a.add()
print( c, a.c, TEST.c )
result :
[15, 2, 3, 4, 5] [5, 2, 3, 4, 5] [5, 2, 3, 4, 5]
why a.add() do not update c in Class TEST? but update c in main file
Rick Johnson wrote:
On Feb 25, 11:54 am, MRAB pyt...@mrabarnett.plus.com wrote:
[...]
That should be:
if maxlength is not None and len(string) = maxlength:
Using imaginary infinity values defiles the intuitive nature of your
code. What is more intuitive?
def confine_length(string,
Ben Finney wrote:
Chris Angelico ros...@gmail.com writes:
On Sun, Feb 26, 2012 at 7:51 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
If you're pleased to announce their immediate availability, then
please do that!
Isn't it perfectly accurate to say that the RCs are now
Frank Millman wrote:
Hi all
I seem to have a recurring battle with circular imports, and I am trying to
nail it once and for all.
Let me say at the outset that I don't think I can get rid of circular
imports altogether. It is not uncommon for me to find that a method in
Module A needs to
Rolf Wester wrote:
Hi,
I would like to define methods using exec like this:
class A:
def __init__(self):
cmd = def sqr(self, x):\nreturn x**2\nself.sqr = sqr\n
exec cmd
a = A()
print a.sqr(a, 2)
This works, but I have to call sqr with a.sqr(a, 2), a.sqr(2) does not
nac wrote:
The RotatingFileHandler running on win 7 64-bit; py 2.7 is failing
when the script launches a process using subprocess.Popen. Works fine
if the subprocess is not launched
The exception thrown
Traceback (most recent call last):
File C:\Python27\lib\logging\handlers.py, line 78, in
Frank Millman wrote:
Hi all
I have been using 'import' for ages without particularly thinking about it -
it just works.
Now I am having to think about it a bit harder, and I realise it is a bit
more complicated than I had realised - not *that* complicated, but there are
some subtleties.
youssef.mah...@hotmail.com wrote:
hi all, when installing sage, there is a problem with emacs.py
so, this screen appeared after rynning ./sage
--
| Sage Version 4.4.2, Release Date: 2010-05-19 |
| Type
bvdp wrote:
Which is preferred in a raise: X or X()? I've seen both. In my specific case
I'm dumping out of a deep loop:
try:
for ...
for ...
for ...
if match:
raise StopInteration()
else ...
except StopInteration:
print found it
I prefer the
Chris Angelico wrote:
Just never treat them as laws of physics (in
Soviet Physics, rules break you!).
ChrisA
hum ...
I wonder how this political message is relevant to the OP problem.
JM
--
http://mail.python.org/mailman/listinfo/python-list
Steven Lehar wrote:
It seems to me that the Python class system is needlessly confusing.
Am I missing something?
For example in the class Complex given in the documentation
*class Complex:*
*def __init__(self, realpart, imagpart):*
*self.r = realpart*
*self.i = imagpart*
*
Kiuhnm wrote:
[snip]
numbers - push - avrg - 'med' - pop - filter(lt('med'), ge('med'))\
- ['same', 'same'] - streams(cat) - 'same'
It reads as
take a list of numbers - save it - compute the average and named it
'med' - restore the flow - create two streams which have, respect.,
the
Jon Clements wrote:
On Wednesday, 14 March 2012 13:28:58 UTC, Cosmia Luna wrote:
class Foo(object):
def bar(self):
return 'Something'
func = Foo().bar
if type(func) == type 'instancemethod': # This should be always true
pass # do something here
What should type at type
Kiuhnm wrote:
Why do you write
// Print the number of words...
def printNumWords(): ...
and not
// Prints the number of words...
def printNumWords(): ...
where it is understood?
Is that an imperative or a base form or something else?
Kiuhnm
http://www.python.org/dev/peps/pep-0257/
Aloke Ghosh wrote:
Hi,
I am learning Python and do not have programming experience.
I was following
an exercise from http://learnpythonthehardway.org/book/ex2.html
and made a mistake in entry :
*PrintI like typing this.*
and got the following error message:
*In [2]: PrintI like typing
Lawrence D'Oliveiro wrote:
In message
mailman.2230.1282037319.1673.python-l...@python.org, Jean-Michel Pichavant
wrote:
Saying that, if one intend to distribute its code, he should stick to 80
chars per line.
Why?
Because some(many ?) people cannot deal with more than 80 chars
Paulo da Silva wrote:
Em 23-08-2010 04:30, James Mills escreveu:
On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva
psdasilva.nos...@netcabonospam.pt wrote:
I understand the concept of a static method.
However I don't know what is a class method.
Would anybody pls. explain me?
John O'Hagan wrote:
I want to know the best way to organise a bunch of functions designed to
operate on instances of a given class without cluttering the class itself with
a bunch of unrelated methods.
What I've done is make what I think are called helper classes, each of which
are
John O'Hagan wrote:
How to call a function with the right arguments without knowing in advance
which function? For example:
import random
def f1():
pass
def f2(foo):
pass
def f3(foo, bar):
pass
foo=random.choice((1,2,3))
bar=random.choice((1,2,3))
myfunc=random.choice((f1, f2,
Jonas Galvez wrote:
Is there a way to inject something into a module right before it's
loaded?
For instance, a.py defines foo. b.py print()s foo.
I want to load b.py into a.py, but I need to let b.py know about foo
before it can execute.
Is this any way to achieve this?
-- Jonas
No that
Rogério Brito wrote:
class C:
f = 1
def g(self):
return f
I get an annoying message when I try to call the g method in an object of type
C, telling me that there's no global symbol called f. If I make g return self.f
instead, things work as expected, but the code loses some
Peter Pearson wrote:
On Sat, 09 Oct 2010 19:30:16 -0700, Ethan Furman et...@stoneleaf.us wrote:
Steven D'Aprano wrote:
[snip]
But that doesn't mean that the list comp is the general purpose solution.
Consider the obvious use of the idiom:
def func(arg, count):
# Initialise
701 - 800 of 978 matches
Mail list logo