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
!")
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
;> 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'
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
18 matches
Mail list logo