, 42]
>>> o.increment_all()
>>> [ i.value for i in o.values ]
[11, 21, 31, 43]
>>>
...it really doesn't make much sense to do something this way, given the limited
information you have provided.
cheers,
- steve
___
Ban
On Tuesday 20 August 2013 05:14 PM, davidsnt wrote:
Can some one please help me to find the best way to do a file upload and
file download to a FTP server in python.
http://bit.ly/KKiEQX
cheers,
- steve
___
BangPypers mailing list
BangPypers
ght of the isnt_that_odd function)[1] ! I
am seeing a pattern here. Interesting. I get a feeling that Anand wasn't even
trying to be funny. sarcastic is possibly a better word I guess -- but I don't
know enough to be sure.
cheers,
- steve
[1] guess I'm better at r
rpose """
raise AmbiguousMissionError, "Mission unclear"
FWIW, I'm more intrigued by the isnt_that_odd() function. Maybe the intent is
not merely being cheeky, there's something deeper that Anand felt strongly
enough to create this repo ? Should w
ghtly. Impedance mismatch
can be fragile. If feasible, stay away.
= = =
Nice one, Dhananjay ! Thanks for spelling out so clearly what feels
instinctively like common sense at times and is just as easy (and
seductive)
to forget about, at others.
cheers,
- steve
[..
the built in pdb prompt when anaconda (the Red Hat/fedora
installer) barfs) and even then, I didn't really find it all that useful from a
'debugging' perspective. It works well only to examine state.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomn
an off hand remark
(directed at one particular person) by a guy, just the fact that the guy is gvr
and is saying something unexpected when taken out of context is not reason
enough to post it to a python mailing list, IMHO. Doing that is plain stupid but
unfortunately it happens all the tim
ept Exception, e:
... traceback.format_stack(limit=1)
...
[' File "", line 4, in \n']
>>> help(traceback)
HTH,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lo
On 09/16/2009 11:39 AM, Vishal wrote:
On Tue, Sep 15, 2009 at 9:07 PM, steve mailto:st...@lonetwin.net>> wrote:
On 09/15/2009 08:56 PM, Vishal wrote:
Hello,
I would like to raise an exception of type Exception(), however the
regular exception stack trace ne
such.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mai
On 09/19/2009 10:37 AM, srid wrote:
http://tinyurl.com/nz73fd
The OP's post in c.l.py appears as the first result. Is this what you
call recursion? :-)
No, this is:
http://www.google.com/search?q=recursion
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
xcept Exception, e
saved = e
try:
g()
except:
pass # ignore
finally:
raise e
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumb
On 10/07/2009 10:13 AM, steve wrote:
Hi Anand,
Well, i am wondering why you are extracting the exc_info() rather than saving
off the exception object itself:
[...snip...]
raise e
[...snip...]
finally:
raise e
Ugh ! sorry, I meant 'raise saved' in both case
blanket except !
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mai
*as well as contribute* by starting small in a large project.
HTH,
cheers,
- steve
PS:
You may find this helpful:
http://lonehacks.blogspot.com/2009/08/on-reading-code-efficiently.html
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.c
~~
So, I thought I'd share this with you. More info here:
http://sourceware.org/gdb/wiki/ProjectArcher
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
heers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.o
n a conversation with more than one person.
...and for people who think that nobody can tell them how they should post would
be also spared any comments from me (and possibly others too). Everybody wins !
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness:
e ?
The whole *point* about interleaved posting is knowing the *context* of the
replies. Rules /evolved/ for a reason.
If that doesn't make things clear, I can't imagine what would.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness
ke to point out to the 'atexit' module
which the above tip uses. It is included in the stdlib and can prove to be quite
useful at times. That one is good to know about.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http:
On 10/23/2009 12:48 PM, Noufal Ibrahim wrote:
On Fri, Oct 23, 2009 at 12:41 PM, steve wrote:
[..]
Of course all this also comes built-in with the Ipython environment, but I
never really got hooked on to that.
[..]
Do you have any reasons why? It's praised a lot in some circles but I
d place it in
your PYTHON_HOME. On my system that is:
/usr/lib64/python2.6/lib-dynload/zlibmodule.so
I'm sorry I do not know how to do that for Ubuntu.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what
..but doesn't really
/stand out/ for anything in particular (like python's simplicity and beauty did,
when I first made its acquaintance). Then again I am not a polyglot as far as
programming is concerned ...so I might not be able to appreciate it's value
...yet ...
cheers,
- steve
On 11/11/2009 06:22 PM, Pradeep Gowda wrote:
On Wed, Nov 11, 2009 at 6:18 AM, steve wrote:
On 11/11/2009 04:17 PM, Ramdas S wrote:
[...snip...]
Yeah! I jumped the line without reading. Actually going through now and
downloading the stuff I cant see much from Python perspective, that
osis.cx/publish/tech_index_cp.html
(note: the icons are links to html versions of the plain text article links)
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lone
in a database (the
name of the database varies across systems, on my system this database is called
ext4).
hth,
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumb
.6/shutil.py", line 53, in copyfile
fdst = open(dst, 'wb')
IOError: [Errno 13] Permission denied: '/foo'
>>>
Make sure that normal copy (using the cp command on the shell/command prompt)
works before trying out shutil.copy. If that works but shutil.copy()
l bus...
heh, yeah, USB is a serial bus just like ethernet is serial communication.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumb
b.org/~esr/faqs/smart-questions.html
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
on:
http://bpython-interpreter.org/
http://bpython-interpreter.org/screenshots/
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.
duct development
companies is better than working at service oriented companies (yes, that might
be a flame bait, but what the heck, that's my personal experience).
cheers,
- steve
(*) Whatever you can rightly say about India, the opposite is also true.
-
hp?script_id=90 ]
NERD_tree.vim [ http://www.vim.org/scripts/script.php?script_id=1658 ]
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lone
oto inc,Now part of freescale semiconductor.
As noufal and steve said I don't know of any companies which develop
products in python in Hyderabad(correct me if I am wrong?).
Umm, I didn't mean to imply that there are no companies which develop products
in python. I said "
ingly,
something similar was discussed at comp.lang.python:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/7897bf3fd2298332/26247987f84cc484
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm
() functions ?
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
oduleComparison
Also, the little that i read online, I see that at least in theory all python
DBI should follow: http://www.python.org/dev/peps/pep-0249/
...which if is also true in practice takes care of concerns you might have about
cross DB API.
cheers,
- steve
--
random non t
Maybe not what you currently need but certainly something useful.
cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
_
CSPY etc.
In the Python world, I would say restructuredText, docutils, Sphinx
in that order.
Just to chip in, restrcturedText can also export to LaTeX besides other formats
(rst2* commands). For a book though, I would recommend investing time to learn
LaTeX and using it directly instead.
n
http://www.python.org/community/jobs/index.html
cheers,
- steve
--
random new spiel: http://lonetwin.net/
random old spiel: http://lonetwin.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@pyth
n str(self.x)
...
... def __repr__(self):
... return "I am a %s with the value %d" % (self.__class__, self.x)
...
>>> a = A()
>>> a = A(10)
>>> a
I am a __main__.A with the value 10
>>> print a
10
>>>
----
ks for buttons to press.
Heh, but to be fair, this works the other direction too. Every time I have to
configure or run something on a windoze box I think in terms of config files or
running cli commands and only later think about looking for pointy-clickly
interfaces.
:-)
cheers,
- steve
--
r
t have fun
anyways :)
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
at the end.
Repeat 1 and 2 over and over
Once I'm ok with a design, I proceed to the next phase, probably writing
some code.
I stumbled upon this recently which might help with 1 and 2:
http://konigi.com/tools/graph-paper
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm
Hi,
addendum ...
On 05/31/2010 03:23 PM, steve wrote:
Hi,
[...snip...]
I stumbled upon this recently which might help with 1 and 2:
http://konigi.com/tools/graph-paper
I am not a designer, but a quick google threw up this:
http://www.geekchix.org/blog/2010/01/03/a-collection-of-printable
f design completely:
http://www.developerdotstar.com/mag/articles/reeves_design_main.html
hth,
cheers,
- steve
[1] http://en.wikipedia.org/wiki/Mind_map
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
society, early organization ...etc) and slip in
Pointers/Prodding to how people might help/contribute in next year's events.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
__
execute/import.
There is another way to fix this issue -- the .pth file/site.py. More
information about this issue at:
http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH
http://docs.python.org/library/site.html
http://bob.pythonmac.org/archives/2005/02/06/using-pth-fi
blame you if I did, the docs are
arranged in a such a manner that making this mistake is easy :).
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPy
#x27;,10],['cat',20],['cat',30],['dog',5],['dog',1],['dog',3]]
>>> d = {}
>>> for k, v in x:
... d.setdefault(k, []).append(v)
...
>>> d
{'dog': [5, 1, 3], 'cat': [10, 20, 30]}
>>> xstar
27;,30],['dog',5],['dog',1],['dog',3]]
x.sort()
xdictstart = dict(reversed(x))
xdictend = dict(x)
xdictstart,xdictend
({'dog': 1, 'cat': 10}, {'dog': 5, 'cat': 30})
Are you sure that'll
alue. If
a given key is seen more than once, the last value associated with it
is retained in the new dictionary."
Nice ! Thanks for digging that out Navin ! Anand's solution is really the most
elegant.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling in
ect.
[1]
class y(x):
def __init__(self):
super(y, self).__init__() # btw, use super if possible
self.A = None
[2]
class y(x):
def __init__(self):
...
def A(self):
raise AttributeError("y instance has no attribute A")
hth,
cheers,
- steve
--
r
windowing toolkit are you using ?
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
id
rewriting them in java.
Judging by what you require, you'd be better off creating a standalone
downloadable executable.
hth,
- steve
(*) HTML is not code and most (all?) browsers have a javascript engine to
execute javascript code.
--
random spiel: http://lonetwin.net/
what
apps (at least gtk based ones) are written in
python. Why is the situation different in windows ?
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
thered learning clojure) think
about that ?
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
sly, corepy[1] and pyasm[2] notwithstanding. :)
Seriously though, one aspect is small to medium sized automation/shell scripts
where although sometimes one is tempted to use the 'power' of python, doing a
`ls` instead of os.listdir('.') and `/some/random/command` instead of
rove them via suggestions/patches from
others.
just my opinion.
cheers,
- steve
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
On 11/24/2010 10:36 PM, Noufal Ibrahim wrote:
On Wed, Nov 24 2010, steve wrote:
[...]
Firstly, wish you the best with this !! Like KG mentioned, we could do
with some more python programmers.
On the topic of slides/notes, IMHO, free (as in freedom) documents are
good. My recommendation
(?(fourdigit)\d{5}) # 5 more phone digits for 5 digit stdcode
)
)$""", re.VERBOSE)
hth,
cheers,
- steve
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
On 11/25/2010 06:45 PM, steve wrote:
On 11/25/2010 04:10 PM, Kenneth Gonsalves wrote:
On Thu, 2010-11-25 at 15:56 +0530, Anand Balachandran Pillai wrote:
> r'(^0\d{2}[-\s]{1}[1-6]{1}\d{7})|(^0\d{3}[-\s]{1}[1-6]{1}\d{6})|(^0
> \d{4}[-\s]{1}[1-6]{1}\d{5})'
>
It
get back on track once the
pressure eases (for eg: using refactoring) <-- real world experience speaking !
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
ecognize some of the names under 'Commercial uses' there ;-) and
http://wiki.python.org/moin/OrganizationsUsingPython
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
uals in an unplanned manner -- the net effect from the /code's/
perspective though is that is being refactored. I'd go as far as saying that
patches which refactor existing code in mature FOSS products are as at least the
same in number as those that introduce new features.
cheers,
heers,
- steve
Original Message
Subject:WebApp requirement @ GSLabs, Pune
Date: Fri, 7 Jan 2011 14:39:23 +0530
*Must have:*
Strong knowledge of web application development in C/C++/Python/Django.
*Good to have:*
Networking, VOIP, Billing, NMS, Flash/Flex etc.
*E
that
you already know about, it is not out of condescension but just because of the
programmer trait of being complete as well as concise.
hth,
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
so many other things some guys replied. That
gave me strong irritation.
I hope my reply didn't give you strong irritation. If what I wrote made sense to
you go back to the thread and re-read it, you'll see a natural flow there about
the discussion based on the assumption that you know
t; a.replace_me()
Replaced
>>>
(hehehe, voice in my head just said Python is dyna-effing-mic, bi***es !!)
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
this:
NewClass = type('NewClass', (object,), {})
where 'NewClass' is the name of your class, (object,) is any tuple of
superclasses and *{} will be the __dict__ of the new class*. As steve
mentioned earlier, you can
So {} can contain function also for the new class,
-change you".
Good point. "Industry standard" is just euphemism and
an urban myth, no such thing exists :)
Like most standards. Thanks, I'll be here all week !
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.
it shows no documentation for 'myfilename,py'
can anyone suggest me how to proceed.
When the argument is without a path component, then pydoc searches for the file
in the current PYTHONPATH. So if your $CWD is not in PYTHONPATH you'd have to say:
pydoc ./myfilename.py
cheers,
- s
s invented.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
obvious given the first
post and the subsequent responses.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/ma
g that properly!)
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
flexible (for example, conditional proxying), explaining that tho' would take
more time so please send details first.
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
__
bot.org/pyfaq/is-there-a-scanf-or-sscanf-equivalent.htm
http://docs.python.org/library/re.html#simulating-scanf
http://stackoverflow.com/questions/2175080/sscanf-in-python
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling
.
}
for line in all_lines:
...extract stuff_that_interests_me from line...
if 'MyFirstKey' in line:
if stuff_that_interests_me == 'true':
config['MyFirstKey'] = 'ON'
elif stuff_that_interests_me == 'false'
, 3), (7, 5), (8, 4), (9, 3),
(10, 5), (11, 5), (12, 5), (13, 4), (14, 5), (15, 3), (16, 5), (17, 3), (18, 5)]
>>>
cheers,
- steve
--
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
Hi,
If it's a production website you might want to look at NewRelic. We started
using it a while back and it has been mighty helpful:
http://newrelic.com
http://newrelic.com/docs/python/new-relic-for-python
cheers,
- steve
On 02/12/2012 08:09 PM, Anand Chitipothu wrote:
> 2012/2/1
rs in python and learned that one has to limit the integer to 32 bits for
this to work correctly. ie:
>>> hex(9)
'0x9'
>>> hex(-9)
'-0x9'
>>> hex(-9 & 0x)
'0xfff7'
>>>
I got this from :
http://stackoverflow.com/ques
ize ( http://wwwsearch.sourceforge.net/mechanize/ ). If, otoh, you are
trying to automate something using a browser (as opposed to doing it from the
command line, for instance using twill - http://twill.idyll.org/ ) then I'd
suggest using javascript or creating/hacking an existing download manager extension.
hth,
ndows but you can get an idea of what could be involved for example from:
http://www.thinkwiki.org/wiki/Python_script_for_Windows_to_control_ThinkPad_features
I'd recommend searching for acpi+python+windows or some combination thereof
cheers,
- steve
On Wed, Oct 31, 2012 at 2:41 PM, Pra
rently. The
x in f is bound to global x.
I'm not sure why we have this confusing behavior.
Here's your answer:
http://stackoverflow.com/questions/291978/short-description-of-python-scoping-rules
cheers,
- steve
___
BangPypers
# now lets be explicit
print(x, Foo.x)
what happened here ?
cheers,
- steve
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers
On Monday 07 January 2013 03:06 PM, davidsnt wrote:
Bangpypers,
Having a little trouble in parsing a file of 702 line appox,
the file is in the format
[...snip...]
Could you show us what you already have done ?
cheers,
- steve
___
BangPypers
tandard library
installed. To do this, simply execute 'yum install python-devel'. Assuming that
your VM is able communicate with a yum repository (over the network or on the
host), this command would install the set of standard python libraries/modules.
cheers,
- steve
(*) There hasn
86 matches
Mail list logo