In article <34va6856ocuas7jpueujscf3kdt7k44...@4ax.com>,
Gilles wrote:
> Hello
>
> I've seen both shebang lines to run a Python script on a *nix host:
>
> #!/usr/bin/env python
> #!/usr/bin/python
>
> What's the difference?
The first one looks through your PATH to find the right python
inte
On 29/09/12 00:51, dave wrote:
more clearer, this is a more realistic use case:
['awefawef', 'awefawfsf', 'awefsdf', 'zz', 'zz',
'zz']
and the quantity of ''zz'' would be dynamic.
Maybe,
class Greatest:
def __lt__(self, other):
r
In article ,
Chris Angelico wrote:
> there's no efficient and reliable way to change/reload code in a
> running application (not often an issue).
What we do (largely cribbed from django's runserver) is start up a
thread which once a second, looks at all the modules in sys.modules,
checks to
In article ,
Chris Angelico wrote:
> On Mon, Oct 1, 2012 at 12:23 AM, Roy Smith wrote:
> > In article ,
> > Chris Angelico wrote:
> >
> >> there's no efficient and reliable way to change/reload code in a
> >> running application (not often an issu
In article ,
Chris Angelico wrote:
> you can't, for instance, retain a "socket connection object" across
> that sort of reload.
Yeah, that's a problem. There's nothing fundamental about a TCP
connection endpoint which precludes it being serialized and passed
around. The amount of state inv
In article
<4806a0b7-818a-4844-8286-f1b891a3c...@rj6g2000pbc.googlegroups.com>,
rusi wrote:
> Here's a test to help you decide: How do you respond to the word
> 'magic'? If positive you will like Ruby, if not you may prefer
> Python.
Some might say that magic underscores a lot of the really
In article ,
Peter Otten <__pete...@web.de> wrote:
> >> Another is to remove it from the global namespace with
> >>
> >> del TestBase
When I had this problem, that's the solution I used.
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Chris Rebert wrote:
> But at any rate:
> shortfall = 4 - len(your_tuple)
> your_tuple += (None,) * shortfall # assuming None is a suitable default
> a, b, c, d = your_tuple
>
> If you also need to handle the "too many items" case, use slicing:
> a, b, c, d = your_tuple[:4]
I usual
In article <507170e9$0$29978$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> I've just looked at one of my classes, picked randomly, and the largest
> method is twelve lines, the second largest is eight, and the average is
> three lines.
I took a look at a subtree of the project
In article ,
Terry Reedy wrote:
> On 10/8/2012 3:28 PM, mooremath...@gmail.com wrote:
> > What's the best way to accomplish this? Am I over-complicating it? My gut
> > feeling is there is a better way than the following:
> >
> import itertools
> x = [1, 2, 3]
> y = list(itertoo
In article <50741ffe$0$6574$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Tue, 09 Oct 2012 04:59:49 -0700, argbsk wrote:
>
> > below is the text file i have How to create Facility as a key and then
> > assign multiple values to it
>
> To use Facility as a key in a dict:
>
>
In article
<1krpdak.u0qy9e1a4knspn%real-not-anti-spam-addr...@apple-juice.co.uk>,
real-not-anti-spam-addr...@apple-juice.co.uk (D.M. Procida) wrote:
> Mark Lawrence wrote:
>
> > On 09/10/2012 14:24, D.M. Procida wrote:
> > > What exactly is the point of a private method? Why or when would I wa
In article ,
moo...@yahoo.co.uk wrote:
> I need to define some configuration in a file that will be manually created.
> [...]
> json seemed a quick an easy way of achieving this
JSON would not be my first choice for a file which needs to be
maintained by hand.
I've only recently started using
In article <507a3365$0$6574$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Remember using PEEK and POKE commands with BASIC back in
> 1978? Pretty much impossible in Python.
But, trivial to implement as an extension :-)
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
MRAB wrote:
> Which codepoint is it? What is the codepoint's name?
>
> Here's how to find out:
>
> >>> hex(ord("?"))
> '0x190'
> >>> import unicodedata
> >>> unicodedata.name("?")
> 'LATIN CAPITAL LETTER OPEN E'
Wow, I never knew you could do that. I usually just google for
In article ,
Dennis Lee Bieber wrote:
> Classically, NNTP did not have "attachments" as seen in MIME email.
NNTP (Network News Transport Protocol) and SMTP (Simple Mail Transfer
Protocol) are both just ways of shipping around messages. Neither one
really knows about attachments. In bo
In article <1b8tk9-un9@chris.zbmc.eu>, tinn...@isbd.co.uk wrote:
> The function producing the error is:-
>
> def get_text(self, idx): # override !
> node = self.items[idx]
>
> a= [
> ", ".join(node.tags),
> node.comment,
>
In article ,
Dennis Lee Bieber wrote:
> For routine database /access/ (that is, someone has created the
> database user account that will be used), MySQLdb is the Python adapter
> to connect to the server. For using THAT, you basically need to know SQL
> (MySQL's flavor in particular), along wit
In article
,
rusi wrote:
> On Oct 15, 9:00 pm, John Gordon wrote:
> > In Debashish Saha
> > writes:
> >
> > > how to insert random error in a programming?
> >
> > Open the program source file and replace the Nth character with a random
> > character.
>
> I'm reminded of a description of vi
In article <1s42l9-9al@satorlaser.homedns.org>,
Ulrich Eckhardt wrote:
> Hi!
>
> I noticed yesterday that a single HTTP request to localhost takes
> roughly 1s, regardless of the actually served data, which is way too
> long. After some digging, I found that the problem lies in
> socket.
In article ,
Ulrich Eckhardt wrote:
> Some updates on the issue:
>
> The etc/hosts file contains the following lines:
>
> # localhost name resolution is handled within DNS itself.
> # 127.0.0.1 localhost
> # ::1 localhost
>
> As I understand it, those effectively
In article <5081d0c3$0$30003$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Some code might be more conveniently written as a single long line. But I
> would argue that nearly never is code more easily *read* as a single long
> line, and since code is read much more than it is w
In article ,
Grant Edwards wrote:
> On 2012-10-21, Steven D'Aprano wrote:
> > On Sun, 21 Oct 2012 22:43:07 +1100, Chris Angelico wrote:
> >
> >> On Sun, Oct 21, 2012 at 9:00 PM, Steven D'Aprano
> >> wrote:
> >>> Er, no. Note spelling of "source code" vs "souce code". Hence the grin.
> >>
> >>
In article <5084e819$0$29897$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Mon, 22 Oct 2012 07:22:18 +1100, Chris Angelico wrote:
>
> > On Mon, Oct 22, 2012 at 6:11 AM, Steven D'Aprano
> > wrote:
>
> >>> Ahh. I totally didn't see that, I'm way too used to reading past
> >>>
I have a url from which I can get an image. I want to use PIL to
manipulate that image. Getting the image is easy:
>>> import requests
>>> r = requests.get(url)
There's a bunch of factory functions for Image, but none of them seem
to take anything that requests is willing to give you. Image.ne
In article ,
Kushal Kumaran wrote:
> On 23 Oct 2012 14:06:59 -0400, r...@panix.com (Roy Smith) wrote:
> > I have a url from which I can get an image. I want to use PIL to
> > manipulate that image. Getting the image is easy:
> >
> > >>> import r
In article ,
Schneider wrote:
> Hi Folkz,
> how can i create a SSH-Connection with python? I have to send some
> commands to the remote host and parse their answers.
> greatz Johannes
At a low level, you want to look at the paramiko library. Built on top
of that, and adding hoards of neat fu
In article ,
Gelonida N wrote:
> Another problem is, that paramiko depends on pycrypto 2.1+
> which doesn't exist as binary release for python 2.7
I'm running paramiko-1.7.6 with python 2.7.3 on my Ubunto Precise box.
I'm reasonably sure all I did was "pip install paramiko".
On the other han
In article ,
Gelonida N wrote:
> The sh module looks intersting, but it's not supported for Windows
> platforms.
"The X module looks interesting but it's not supported for Windows" is
true for many values of X. It's all part of the TCO of using a
brain-dead operating system.
--
http://mail
In article ,
Andrew Robinson wrote:
> Show me an example where someone would write a slice with a negative and
> a positive index (both in the same slice);
> and have that slice grab a contiguous slice in the *middle* of the list
> with orientation of lower index to greater index.
It's possib
In article ,
Gelonida N wrote:
> On 10/29/2012 02:10 PM, Roy Smith wrote:
> > In article ,
> > Gelonida N wrote:
> >
> >> The sh module looks intersting, but it's not supported for Windows
> >> platforms.
> >
> > "The X module look
In article ,
Ian Kelly wrote:
> On Mon, Oct 29, 2012 at 9:42 AM, Andrew Robinson
> wrote:
> > The list was generated in a single pass by many .append() 's, and then
> > copied once -- the original was left in place; and then I attempted to slice
> > it.
>
> Note that if the list was generated
In article ,
Ian Kelly wrote:
> On Mon, Oct 29, 2012 at 5:24 PM, Roy Smith wrote:
> > I think you're missing the point of "amortized constant time". Yes, the
> > first item appended to the list will be copied lg(20,000,000) ~= 25
> > times, because the
In article <50932111$0$29967$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Huh. If you're messing about with ancient[1] languages like Java, C# and
> especially C, you're not a real programmer. Real programmers use modern,
> advanced languages like D, Erlang, Go or Haskell.
D
In article ,
Andriy Kornatskyy wrote:
> 'Z05738521581'
> 'Z17888279480'
> 'Z07395350007'
>
> Short, human readable and satisfy original requirements.
>
> Andriy
If you really want human readable, it's better to chunk the data up into
3 or 4 digit groups. So, instead of Z05738521581, maybe
In article <50959154$0$6880$e4fe5...@news2.news.xs4all.nl>,
Hans Mulder wrote:
> That's a matter of perspective: in my book, the primary advantage of
> working with interned strings is that I can use 'is' rather than '=='
> to test for equality if I know my strings are interned. The space
> sav
In article <5096202c$0$29967$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Sat, 03 Nov 2012 22:19:19 -0700, Aahz wrote:
>
> > In article <509441cb$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven
> > D'Aprano wrote:
> >>On Fri, 02 Nov 2012 04:20:20 -0700, Jason Benjamin
Environment:
Python-2.7.3
Ubuntu Precise
mongoengine 0.6.20
I have a class which includes a __unicode__() method:
class User(mongoengine.Document):
def __unicode__(self):
return self.username
If I create an instance of this class by calling the constructor
directly, self.usern
In article ,
Roy Smith wrote:
> >>> print u.__unicode__()
> None
>
> >>> print unicode(u)
> Traceback (most recent call last):
> File "", line 1, in
> TypeError: coercing to Unicode: need string or buffer, NoneType found
>
> What
In article ,
Chris Angelico wrote:
> It's nothing to do with operating system. File names are names, and
> spaces in them are seldom worth the hassle unless you manipulate those
> files solely using a GUI.
That's a very ascii-esqe attitude. In a fully unicode world, I could
easily see using U
In article <50989a16$0$29980$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Shell do not [quote strings, etc] because they
> are designed for lazy users and merely aim to be "good enough".
Well, sort of. Or, perhaps more correctly, "Yes, but that's a good
thing".
Shells are d
In article <5099ec1d$0$21759$c3e8da3$76491...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Wed, 07 Nov 2012 00:23:44 +, MRAB wrote:
>
> >> Incorrect. Python uses what is commonly known as call-by-object, not
> >> call-by-value or call-by-reference. Passing the list by value would
> >>
In article ,
Gregory Ewing wrote:
> Steven D'Aprano wrote:
> > The downside is that if spaces are not argument separators, then you need
> > something else to be an argument separator. Or you need argument
> > delimiters. Or strings need to be quoted. Programming languages do these
> > things
In article <509ab0fa$0$6636$9b4e6...@newsspool2.arcor-online.net>,
Alexander Blinne wrote:
> I don't know the best way to find the current size, I only have a
> general remark.
> This solution is not so good if you have to impose a hard limit on the
> resulting file size. You could end up having
In article ,
Demian Brecht wrote:
> On 2012-11-07, at 3:17 PM, Smaran Harihar wrote:
> > Any idea where am I going wrong?
>
> Looks like you're missing a closing parenthesis:
What I find is useful in situations like this is to just let emacs
auto-indent the code. When it starts indenting (o
In article <18134e77-9b02-4aec-afb0-794ed900d...@googlegroups.com>,
bruceg113...@gmail.com wrote:
> Is there a simpler way to modify all arguments in a function before using the
> arguments?
>
> For example, can the below code, in the modify arguments section be made into
> a few statements?
I'm trying to pull down tweets with one of the many twitter APIs. The
particular one I'm using (python-twitter), has a call:
data = api.GetSearch(term="foo", page=page)
The way it works, you start with page=1. It returns a list of tweets.
If the list is empty, there are no more tweets. If t
In article ,
Ian Kelly wrote:
> On Sat, Nov 10, 2012 at 7:13 PM, Chris Angelico wrote:
> > I would not assume that. The origin is a point, just like any other.
> > With a Line class, you could deem a zero-length line to be like a
> > zero-element list, but Point(0,0) is more like the tuple (0,0
In article ,
Peter Otten <__pete...@web.de> wrote:
> deque(
> imap(
> process,
> chain.from_iterable(
> takewhile(bool, imap(partial(api.GetSearch, term), count(1),
> maxlen=0)
>
> ;)
If I wanted STL, I would still be writing C++ :-)
--
http://mail.pyth
In article ,
Mark Lawrence wrote:
> On 12/11/2012 00:31, Oscar Benjamin wrote:
> >
> > Plain wrong. Vectors are not defined *from any origin*.
> >
>
> So when the Captain says "full speed ahead, steer 245 degrees", you
> haven't the faintest idea where you're going, because you have no origin?
In article ,
Oscar Benjamin wrote:
> But then I'm assuming you meant that 245 degrees was a bearing
> relative to North. Was it supposed to be relative to my current angle?
> Truthfully I wouldn't know what to do without asking the captain a
> couple more questions.
Granted, this requires some
On 12/11/12 13:40, F.R. wrote:
On 11/12/2012 02:27 PM, Robert Franke wrote:
Hi Frederic,
[...]
bas = {}
for year in range (2010, 2013):
ba = st.runs ('BA', '%d-01-01' % year, '%d-12-31' % year)
ba.run ()
print year, id (ba)
bas [year] = ba
2010 150289932
2011 150835852
2012 1
In article <0692e6a2-343c-4eb0-be57-fe5c815ef...@googlegroups.com>,
Richard wrote:
> Hello,
>
> I want to create a URL-safe unique ID for URL's.
> Currently I use:
> url_id = base64.urlsafe_b64encode(url)
>
> >>> base64.urlsafe_b64encode('docs.python.org/library/uuid.html')
> 'ZG9jcy5weXRob24u
In article <1ce88f36-bfc7-4a55-89f8-70d1645d2...@googlegroups.com>,
Richard wrote:
> So the use case - I'm storing webpages on disk and want a quick retrieval
> system based on URL.
> I can't store the files in a single directory because of OS limitations so
> have been using a sub folder str
In article ,
w...@mac.com wrote:
> I need to time the operation of a command-line utility (specifically
> nslookup) from within a python program I'm writing.
Ugh. Why are you doing this? Shelling out to nslookup is an incredibly
slow and clumsy way of doing name translation. What you really
In article ,
William Ray Wing wrote:
> On Nov 13, 2012, at 11:41 PM, Roy Smith wrote:
>
> > In article ,
> > w...@mac.com wrote:
> >
> >> I need to time the operation of a command-line utility (specifically
> >> nslookup) from within a python progr
I wrote:
>> Oh, my. You're using DNS as a replacement for ping? Fair enough. In
>> that case, all you really care about is that you can connect to port 53
>> on the server...
>>
>> s = socket.socket()
>> s.connect(('8.8.8.8', 53))
In article ,
Chris Angelico wrote:
>That assumes that (a) the
In article ,
Chris Angelico wrote:
> I'm slightly surprised that there's no way with the Python stdlib to
> point a DNS query at a specific server
Me too, including the "only slightly" part. The normal high-level C
resolver routines (getaddrinfo/getnameinfo, or even the old
gethostbyname se
In article ,
Chris Angelico wrote:
> Indeed. But Python boasts that the batteries are included, and given
> the wealth of other networking facilities that are available, it is a
> bit of a hole that you can't run DNS queries in this way.
Think of the socket and struct modules as a pile of carbo
In article ,
chip9m...@gmail.com wrote:
> Now I would like to debug it in eclipse..
Heh. It took me a while to realize that the subject line was not
referring to
http://en.wikipedia.org/wiki/Solar_eclipse_of_November_13,_2012
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Dave Angel wrote:
> I'd also add a print statement, just to assure yourself that it's running.
My trick to make sure something is running is to add "assert 0".
To be fair, I usually start by adding a print statement, as Dave
suggests. If I see the output, I know it ran. But if
In article ,
Nobody wrote:
> That's because the high-level routines aren't tied to DNS.
This is true.
>> gethostbyname() and getaddrinfo() use the NSS (name-service switch)
> mechanism, which is configured via /etc/nsswitch.conf. Depending upon
> configuration, hostnames can be looked up via a
Ulrich Eckhardt wrote:
> in general importing configuration data by loading and
> executing code is a questionable approach. The problem is in particular
> that the code parser is always more strict with the syntax than a
> configuration file should be. Also, it presents the danger of code
>
In article ,
w...@mac.com wrote:
> On Nov 17, 2012, at 10:04 AM, Jordan Bylsma wrote:
>
> > I'm looking into writing a python script that colorizes particular hops
> > when using traceroute. Anyone run across something like this? I don't think
> > it would be extremely difficult to write but
In article <50a8acdc$0$29978$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Use a list when you want a list of items that should all be treated the
> same way [...] or when you need a collection of items where the order they
> are in is
> important:
>
> Use a tuple when you wan
In article <50a911ec$0$29978$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Oh I'm sorry, did something I say suggest that the couple of examples I
> gave are the *only* acceptable uses? My apologies for not giving an
> exhaustive list of every possible use of lists and tuples,
In article <50a97de0$0$29983$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> > The stack that's returned is a list. It's inherently a list, per the
> > classic definition:
>
> Er, no, it's inherently a blob of multiple text lines.
No, it's a list that looks like (taken from the
In article <50a9e5cf$0$21863$c3e8da3$76491...@news.astraweb.com>,
Steven D'Aprano wrote:
> I see. It wasn't clear from your earlier description that the items had
> been post-processed from collections of raw log lines to fixed records.
Well, I did provide the code that does this.
> But it d
OK, I've just read back over the whole thread. I'm really struggling to
understand what point you're trying to make. I started out by saying:
> Use a list when you need an ordered collection which is mutable (i.e.
> can be altered after being created). Use a tuple when you need an
> immutabl
In article <50aac3d8$0$29983$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> By the way, your news client seems to be mangling long URLs, by splitting
> them when they exceed the maximum line length.
Hmmm. So it did. My bad.
--
http://mail.python.org/mailman/listinfo/python-li
In article <50aac66c$0$29983$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> I'm asking about the case where one might want the key to remain mutable
> even after it is used as a key, but can't because Python won't let you.
Ah. Now I see what you're getting at. Thank you.
Well
as 'at' does"
>
> If it's the former, it's pretty easy--'at' accepts a wide variety of
> formats.
Fortunately, it's the former.
Since posting my original query, I have discovered by experimentation that the
API also accepts a string of digit
In article ,
Michael Herrmann wrote:
> do you think it's bad style to override the built-in function `type`? I'm
> co-developing a GUI automation library called Automa
> (http://www.getautoma.com) and 'type' would be a very fitting name for a
> function that generates artificial key strokes.
My command either takes two positional arguments (in which case, both
are required):
$ command foo bar
or the name of a config file (in which case, the positional arguments
are forbidden):
$ command --config file
How can I represent this with argparse; add_mutually_exclusive_group()
isn't qu
Steven D'Aprano wrote:
> Given the practical reality that documentation is often neglected, there
> is a school of thought that says that *code* is the One True source of
> information about what the code does, that documentation is at best a
> hint or at worst completely redundant.
Yes, there
In article <8ea52e1b-2e02-40b2-8ce0-fcce7fc2e...@googlegroups.com>,
Miki Tebeka wrote:
> Greetings,
>
> The usual package mangers (easy_install, pip ...) install packages in one
> central location.
>
> I'm looking for a solution that will allow every project (which run on the
> same machine)
In article ,
Miki Tebeka wrote:
> > When we deploy, we create a new virtualenv, then do
> > "pip install -r requirements.txt".
> 1. Do you do that for every run?
Well, sort of.
We are currently using a single virtualenv per deployment host. Each
time we deploy new code, we checkout all th
I've got a minimal test script:
-
$ cat test_foo.py
import pyza.models
print pyza.models
def test_foo():
pass
-
pyza.models is a package. Under normal conditions, I can import it fine:
$ python
Python 2.7.3 (default, Aug 1 2012, 05:1
On 28/11/12 21:34, Ricky wrote:
Hi all,
I am doing a project on traffic simulation. I want to introduce exponential
arrival distribution to precede this task. Therefore I want write a code in
python for exponential arrival distribution. I am very new for programming and
if anybody can help m
In article <50b78e26$0$6945$e4fe5...@news2.news.xs4all.nl>,
Hans Mulder wrote:
> That is baffling indeed. It looks like nose is adding some
> directory to sys.path, which contains a module pyza.py instead
> of a package.
We finally figured it out. As it turns out, that's pretty close.
> Anot
This is kind of weird (Python 2.7.3):
try:
print "hello"
except foo:
print "foo"
prints "hello". The problem (IMHO) is that apparently the except clause
doesn't get evaluated until after some exception is caught. Which means
it never notices that foo is not defined until it's too late
In article <29c74a30-f017-44b5-8a3d-a3c0d6592...@googlegroups.com>,
SherjilOzair wrote:
> Hello list,
>
> When it comes to printing things while some computation is being done, there
> are 2 extremes.
>
> 1. printing speed is slower than data-to-print generation speed. In this
> case, printi
In article ,
Marco wrote:
> Hi all, do you think this code:
>
> $ more myscript.py
> for line in open('data.txt'):
> result = sum(int(data) for data in line.split(';'))
> print(result)
That sum() line is a bit of a mouthful. I would refactor it into
something like this:
> for line
In article <8c78344a-8019-450a-bfdf-13508bf75...@googlegroups.com>,
Victor Hooi wrote:
> Hi,
>
> I'm getting a strange error when I try to run the following:
>
> for root, dirs, files in os.walk('./'):
> for file in files:
> if file.startswith('ml') and file.endswith('.
On 10/12/12 22:38, qbai...@ihets.org wrote:
I need help with a program i am doing. it is a cryptography program. i am given
a regular alphabet and a key. i need to use the user input and use the regular
alphabet and use the corresponding letter in the key and that becomes the new
letter. i hav
In article ,
Stefan Behnel wrote:
> suresh.pinn...@gmail.com, 14.12.2012 03:49:
> > My aim is to get a job into google or cisco or facebok.
>
> Why?
>
> There are lots of attractive places to work at. Choosing a less visible one
> means that you have a higher chance of getting hired in the fir
In article <50cbaf19$0$29991$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Fri, 14 Dec 2012 09:48:54 -0500, Roy Smith wrote:
>
> > On the other hand, as somebody who's looking to hire software engineers,
> > I can tell you that we loo
In article ,
Chris Angelico wrote:
> If the boss's vision is anything to go by, we're going to be bigger
> than Microsoft, eBay, Facebook, and Google combined, and all by early
> 2013.
That's the kind of attitude you need to be at a startup.
--
http://mail.python.org/mailman/listinfo/python-l
In article ,
iMath wrote:
> where to view open() function's C implementation source code ï¼Â
http://www.python.org/download/releases/
Download the source for the version you're interested in.
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
iMath wrote:
> ÃÂ� 2012ÃÂN12ÃÂÃÂ18ÃÂ�ÃÂ�ÃÂ�ÃÂ�UTC+8ÃÂ�ÃÂ�1æÂ¶35Ã¥ÂÂ58ç§Âï¼ÂRoy
> SmithÃ¥ÂÂéÂÂï¼Â
> > In article ,
> >
> > iMath wrote:
> >
> >
> >
> > > where to view open() function's C implementation
In article ,
"larry.mart...@gmail.com" wrote:
> On Thursday, December 20, 2012 5:38:03 PM UTC-7, Chris Angelico wrote:
> > On Fri, Dec 21, 2012 at 11:19 AM, larry.mart...@gmail.com
> >
> > wrote:
> >
> > > This code works, but it takes way too long to run - e.g. when cdata has
> > > 600,000
In article ,
prilisa...@googlemail.com wrote:
> Thanks to all your answers, I have read a lot about namespaces, but still
> there's something I do not understood. I have tried your example but as I
> expected:
>
> line 13, in HandoverSQLCursor
> curs.execute("SELECT * FROM lager")
> Attrib
I have an integer that I want to encode as a hex string, but I don't
want "0x" at the beginning, nor do I want "L" at the end if it happened
to be a long. The result needs to be something I can pass to int(h, 16)
to get back my original integer.
The brute force way works:
h = hex(i)
ass
In article <40d108ec-b019-4829-a969-c8ef51386...@googlegroups.com>,
Pander Musubi wrote:
> Hi all,
>
> I would like to sort according to this order:
>
> (' ', '.', '\'', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a',
> 'A', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', 'b', 'B',
In article ,
Tim Chase wrote:
> On 12/24/12 09:36, Roy Smith wrote:
> > I have an integer that I want to encode as a hex string, but I don't
> > want "0x" at the beginning, nor do I want "L" at the end if it happened
> > to be a long. The result
In article ,
Alister wrote:
> Indeed due to the poor quality of most websites it is not possible to be
> 100% accurate for all sites.
>
> personally I would start by checking the doc type & then the meta data as
> these should be quick & correct, I then use chardectect only if these
> fail t
In article <46db479a-d16f-4f64-aaf2-76de65418...@googlegroups.com>,
Pander Musubi wrote:
> > I'm assuming that doesn't correspond to some standard locale's collating
> > order, so we really do need to roll our own encoding (and that you have
> > a good reason for wanting to do this).
>
> It i
In article ,
Abhas Bhattacharya wrote:
> While I am defining a function, how can I access the name (separately as
> string as well as object) of the function without explicitly naming
> it(hard-coding the name)?
> For eg. I am writing like:
> def abc():
> #how do i access the function abc
In article <0e36e143-5103-4b4b-aaa9-b7b1b7686...@googlegroups.com>,
Gnarlodious wrote:
> This is problem that has unduly vexed me. When you start learning Python they
> don't tell you about these sharp edges. Someone needs to explain.
The same thing happens when you're born. You spend your en
In article <50dc29e9$0$29967$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Wed, 26 Dec 2012 23:46:31 -0800, Abhas Bhattacharya wrote:
>
> >> > two = lamba : "one"
> >> > one = two
> >>
> >> > Which one of these is the "name" of the function?
> [...]
> > If i call one() and t
301 - 400 of 3427 matches
Mail list logo