e to do that just looking to the code
> or debugging it because it is pretty complicated, but I am able to
> invoke this situation again.
I wrote http://pypi.python.org/pypi/objgraph for this purpose.
--
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
ed
>>> import gc
>>> gc.get_referrers(42)
?
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
Call-By-Reference?" thread of the year!
> http://groups.google.com/group/comp.lang.pythonfd36962c4970ac487ea/
Any chance of getting them fixed?
Regards,
--
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
way.
Someone already did: "Advanced Python or Understanding Python"
http://video.google.com/videoplay?docid=7760178035196894549
(76 minutes).
Worth watching.
Regards,
--
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 4, 9:29 pm, kj wrote:
> The only solution I can come up with is to define a "dummy module",
> say _config.py, which contains only upper-case variables representing
> these global switches, and is imported by all the other modules in
> the application with the line "from _config import *".
On Aug 25, 2:55 pm, Esmail wrote:
> Re pdb, if you have a 'pointer' (ie reference) to an object, is there
> an easy way to dump out its contents, ie all of its members short of
> writing a method that does that and then calling it?
Usually
pp vars(your_object)
does what you want
--
http://ma
Hi,
On Fri, May 29, 2009 at 2:09 AM, Gary Herron wrote:
> Marius Retegan wrote:
>
>> Hello
>> I have simple text file that I have to parse. It looks something like
>> this:
>>
>> parameters1
>> key1 value1
>> key2 value2
>> end
&
Hello
I have simple text file that I have to parse. It looks something like
this:
parameters1
key1 value1
key2 value2
end
parameters2
key1 value1
key2 value2
end
So I want to create two dictionaries parameters1={key1:value1,
key2:value2} and the same for parameters2.
I woud
!")
The warnings module is used for warnings about program code, not user
input.
import logging
logging.warn("Oh noes, you passed me two arguments instead of one!")
--
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
eString, e:
> print usage
> print e
> sys.exit(1)
I would recommend printing error messages to sys.stderr.
BTW, in this particular case you may want to use
parser.error(e)
instead of print + sys.exit.
--
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
ctive
interpreter.
So far I have tried
- import classes # doesn't import my classes
- from classes import * # imports, but I can't reload
- reload(classes) # I have the same class definition
after this
I've tried the documentation but I got lost, so please h
Wing IDE 101
Version: 3.1.4-1 (rev 18789)
Release Date: September 18, 2008
from http://www.wingware.com/wingide-101
"Wing IDE 101 is a free basic edition of Wing IDE that was designed
with the University of Toronto Computer Science Department for
teaching entry level computer science courses with
;> concat([[1,2], [3, 4], [5], [6, 7, 8]])
>>> list(concat([[1,2], [3, 4], [5], [6, 7, 8]]))
[1, 2, 3, 4, 5, 6, 7, 8]
wondering if google groups will add a .sig or not-ly,
Marius Gedminas
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 24, 2:12 pm, Bjoern Schliessmann wrote:
> 7stud wrote:
> > if hasattr(elmt, some_func):
> >elmt.some_func()
>
> Personally, I prefer
>
> try:
> elmt.some_func()
> except AttributeError:
> # do stuff
That also hides attribute errors that occur within some_func. I think
I'd rath
On Jun 6, 3:18 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> > Since 'i' and 'j' are canonically loop indices, I find it
> > totally confusing to use them to name the iteration variable -
> > which is not an index.
>
> Certainly i and j are just as generic, but they have the
> advantage over 'item'
Bo Yang wrote:
> Hi everyone ,
> I have join this list for about 4 months , and everyday I receive
> hundreds of
> mails . There is no means to read all of them , so I just read something
> interesting
> for me . But if so , there are too much mails pile up in my inbox , I
> want to ask
> how do y
> echo adds a newline:
>
>>>> import md5
> >>> test = md5.new("marius\n")
>>>> print test.hexdigest()
>0f0f60ac801a9eec2163083a22307deb
>
> Just
Thanks, that was it ;)
--
http://mail.python.org/mailman/listinfo/python-list
The datetime module is usually more convenient for date/time
arithmetic. However in your particular case, you may find the
time.time() function convenient. It returns the number of seconds
since the epoch. To get the number of days divide the number of
seconds by 86400.
--
http://mail.python.o
David Bear wrote:
> I'm trying to use os.chmod and am refered to the stat module.
>
> Is there are explanation of:
> * S_ISUID
...
> * S_IXOTH
These come from the POSIX standard. See
http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
HTH,
Mariu
I managed it with vim.
--
http://mail.python.org/mailman/listinfo/python-list
I cannot reach the contest site at since all this morning. :-(
--
http://mail.python.org/mailman/listinfo/python-list
I cannot not reach the contest site at since all this morning. :-(
--
http://mail.python.org/mailman/listinfo/python-list
Jean-Paul Calderone wrote:
> On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote:
> >Shane Hathaway wrote:
> >> Paul McGuire wrote:
> >>
> >>
> >> Also, here's another cheat version. (No, 7seg.com does not exist.)
> >>
> >>import urllib2
> >>def seven_seg(x):return u
Magnus Lycka wrote:
> To read the last x bytes of a file, you could do:
>
> >>> import os
> >>> x = 2000 # or whatever...
> >>> f=open('my_big_file')
> >>> l=os.fstat(f.fileno()).st_size
> >>> f.seek(l-x)
> >>> f.read()
You don't need fstat/st_size, you can ask seek to move to an offset
rela
Maybe you should ask : Is VB like Python
( remark the )
On 17 Mar 2005 09:45:22 +0200, Ville Vainio <[EMAIL PROTECTED]> wrote:
> > "Cappy" == Cappy2112 <[EMAIL PROTECTED]> writes:
>
> Cappy> VB has a much better IDE than the IDE's for Python,
> Cappy> although Eric3 is one
I have the folowing code:
c=2
e=3
s="12"
code.append('funtion ("c, e,s")')
print "\n".join(code) + '\n'
The problem is when i call append.
The variables s, c, e are not replaced with their value, so in the end
i get the result:
funtion(" c, e, s");
The result that i want is :
funtion("2,3,1
Hi.
How can i execute a string in python?
For example if I have the variable s, defined below
s = '"print "hello"'
How can I execute the code that "s" keeps inside, considering that the
code is correct?
--
http://mail.python.org/mailman/listinfo/python-list
* [EMAIL PROTECTED]
> So is that a yes or a no to the man's question?
Of course it is.
--
Marius Bernklev
Holmgang: Deodoranter har parfyme, mens folk bare kaster kaffegruten.
Bør nye PC-er inkludere ekstra USB-kabel? Vi tar debatten!
--
http://mail.python.org/mailman/listinf
* [EMAIL PROTECTED]
> Perhaps ()'s are a good idea for some other reason I don't know?
One-element tuples are written as (4,).
--
Marius Bernklev
http://www.ping.uio.no/~mariube/ >
--
http://mail.python.org/mailman/listinfo/python-list
29 matches
Mail list logo