Steve Holden wrote:
> James Stroud wrote:
>
>> SuperHik wrote:
>>
>>> and the winner is... :D
>>> David Isaac wrote:
>>>
>>>
>>>> alpha = string.lowercase
>>>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
&
James Stroud wrote:
> SuperHik wrote:
>
>> James Stroud wrote:
>>
>>> SuperHik wrote:
>>>
>>>> and the winner is... :D
>>>> David Isaac wrote:
>>>>
>>>>> alpha = string.lowercase
>>>>> x=(a+b+
Steve Holden wrote:
> James Stroud wrote:
>
>> SuperHik wrote:
>>
>>> and the winner is... :D
>>> David Isaac wrote:
>>>
>>>
>>>> alpha = string.lowercase
>>>> x=(a+b+c for a in alpha for b in alpha for c in alpha)
&
Fredrik Lundh wrote:
> James Stroud wrote:
>
>> See the actual question:
>>
>> >How would you construct a generator to acheive this?
>
>
> if you don't think the context provided by the subject line and the
> sentence before the question is impo
ient and which aren't?
>
> Thanks in advance,
> Ben
>
As an experiment, I googled 'python idioms' and got a few good hits
right at the top. I probably should have done this a long time ago.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Bo
in relation to tuples at all, do they?
>
Aside from grouping, they are special to construct an empty tuple.
py> () == tuple()
True
Also, don't underestimate their relationship with tuples when it comes
to grouping:
py> a, b, c = 1, 2, 3
py>
py> a == a, b, c
(True, 2, 3)
py&g
ly your question (which you
didn't really have). I'm sure I will regret this becuase, as you will
find, suggesting code on this list with additional utility is somewhat
discouraged by the vociferous few who make a religion out of 'import this'.
Also, I still have no idea what 'groupby' does. It looks interesting
thgough, thanks for pointing it out.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
James Stroud wrote:
> Frank Millman wrote:
>
>> Hi all
>>
>> This is probably old hat to most of you, but for me it was a
>> revelation, so I thought I would share it in case someone has a similar
>> requirement.
>>
>> I had to convert an ol
Alex Martelli wrote:
> James Stroud <[EMAIL PROTECTED]> wrote:
>...
>
>>def doit(rows, doers, i=0):
>> for r, alist in groupby(rows, itemgetter(i)):
>> if len(doers) > 1:
>> doit(alist, doers[1:], i+1)
>> doers[0](r)
>
>
Alex Martelli wrote:
> James Stroud <[EMAIL PROTECTED]> wrote:
>...
>
>>def doit(rows, doers, i=0):
>> for r, alist in groupby(rows, itemgetter(i)):
>> if len(doers) > 1:
>> doit(alist, doers[1:], i+1)
>> doers[0](r)
>
>
7', 16)
>
> 231
> ---
>
> Does anyone have a clue a to what I need to do?
>
> Thanks!
>
> Andreas Lydersen
>
py> t = lambda x: int(x, 16) - ((int(x, 16) >> 7) * 256)
py> t('e7')
-25
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
e fun kind of memory) and all of those mind boggling
keystrokes begin to feel like an artistic expression reminiscent of
playing the piano.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
108, 111, 44, 32, 119, 111, 114, 108, 100, 33]
>
> print filter(lambda n: n % 2 == 0, numbers)
>
>
>
> numbers = [72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33]
>
> print reduce(lambda x, y: x+y, numbers)
>
>
>
> Thank you,
>
> Alan
ue...maybe personality #2 should be
> arguing for brown instead).
>
> My best friend is an emacs user, and I'm a vimmer...it doesn't
> come between us. :)
>
> -tkc
Yes, heartwarming, but if you are thinking marriage...
--
James Stroud
UCLA-DOE Institute for G
)
> ECB cipher. Why we have this limitation?
>
> Laszlo
>
>
CBC mode is cipher block chaining, so it still works as a block cipher,
which means that it must be that len(text) % block_size == 0. In other
words, CBC does not shift by one byte but by block_size bytes. See:
http://e
common task and I don't want to re-invent the
> wheel.
>
> Ryan
Most people probably use something like vim rather than re-inventing the
wheel themselves.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud
s. I'm not so sure C is better suited.
Definitely resist "shell scripting". Several chapters in Mark Lutz's
_Programming Python_ will help with networking (after you have read
through _Learning Python_ or equivalent). NewRiders publishes _Python
Web Programming_ authored by Ste
>
This problem seems to be beyond the code you provide. Is this part of a
larger program? Is it possible to show the entire script?
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
7;.join(t))
> return l
>
> This gives me a syntax error!
> I need to output a list that has all the permutations of the input string.
>
>
>
>
>>--
>>http://mail.python.org/mailman/listinfo/python-list
>>
>
>
p = ["".join(s) for s in permute('abcdefg')]
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
Girish Sahani wrote:
>>>thanks lawrence...however this func doesnt return the permuted strings,
>>>so
>>>i added some code as follows to generate a list of all the permutations:
>>>
>>>def permute(seq):
>>>l = []
>>>if len(seq) == 0:
>>>yield []
>>>else:
>>>for i in rang
Dan Sommers wrote:
> On Sun, 25 Jun 2006 21:10:31 +0100,
> Andrew McLean <[EMAIL PROTECTED]> wrote:
>
>
>>I'm looking at putting some e-mail contact addresses on a web site,
>>and wanted to make it difficult for spammers to harvest them.
>
>
> [ ... ]
>
>
>>Searching the web it looks like the
LITE_FILE_NAME':
> HI_LITE_FILE_NAME}
>
> I wonder if this has something to do with HTML's % character.
>
> KT
>
Yes it does. Have a look at urllib.quote and unquote. These may help.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
;===
You have assigned open (which, by the way, is a builtin!) in a function
*after* you have referenced it. You have over-ridden the open name with
the assignment, but you have referenced it 'before assignment', as your
error mesage says. This is a favorite trip-up of newer pytho
+2)
149679044
py> id(7*6)
149679044
So, I guess my question is to what extent is this equivalency
implementation dependent? Is this equivalency a requirement for a
legitimate python implementation? Won't these checks slow down
evaluation of 'is' considerably? Does '==
lHello = Label(F, text="Hello")
> lHello.pack()
> bQuit = Button(F, text="Quit", command=F.quit)
> bQuit.pack()
> # set the loop running
> top.mainloop()
>
This gets pretty close:
top.geometry('%sx%s+0+0' % top.maxsize())
James
--
James Stroud
U
oriented web development
with a focus on applying my python skills.
Any suggestions will be greatly appreciated.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
ho', 'art', 'in', 'heaven', 'hallowed', 'be', 'their', 'names', 'did',
'forthwith', 'declare', 'that', 'all', 'men', 'are', 'created', 'to
n
Eddy and colleagues:
http://hmmer.janelia.org/
http://selab.janelia.org/people/eddys/
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
#x27;(?:c|n)(?:p|s)(?:k|u|d)g-3(?:1|0)0(?:A|0)(?:A|B|1|0|3|2|6|8)'
print rgx_str
But, if you get much more complicated that this, you will definitely
want to check out hmmer, especially if you can align your sequences.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
27; object has no attribute 'group'
py> patt_3plus.search(s1).group(0)
Traceback (most recent call last):
File "", line 1, in ?
AttributeError: 'NoneType' object has no attribute 'group'
py> patt_2plus.search(s1).group(0)
Traceback (most recent call la
ing one of the most accessible modules (to me, anyways)--and well
worth learning.
However, in complicated applications, regex is usually still fun and
valuable as an intellectual exercise.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
he columns. Zeros will
indicate high probability of between-column. Code tomorrow if no one
else posts.
Must run...
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hello,
>
> I am looking for python code useful to process
> tables that are in ASCII text. The code must
> determine where are the columns (fields).
> Concerned tables for my application are various,
> but their columns are not very complicated
> to locate for a human, b
James Stroud wrote:
> indices = [t for t in zip(indices[::2],indices[1::2])]
(Artefact of cut-and-paste.)
Make that:
indices = zip(indices[::2],indices[1::2])
James
--
http://mail.python.org/mailman/listinfo/python-list
;, x
return highliter
class Test:
def __init__(self, parent):
buttons = [tk.Button(parent, text=str(x+1),
command=make_it(x)) for x in range(5)]
for button in buttons:
button.pack(side=tk.LEFT)
root = tk.Tk()
d = Test(root)
root.mainloop()
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
Simon Burton wrote:
>>>>class A(object):
>
> ... def foo(self): pass
> ...
>
>>>>class B(A):
>
> ... pass
> ...
>
>>>>b=B()
>>>>b.foo
>
> >
>
> How can I work out what class b.foo was defined in
k this is, but I would do it thus:
dicts = [{'column':1}, {'column':2}, {'column': 4}, {'column': 8},
{'column':4}]
vals = list(set(d['column'] for d in dicts))
vals.sort()
amap = dict((b,a) for (a,b) in enumerate(vals))
for d in dic
is this possible?
>
Depends on your namespace, but for the local namespace, you can use this:
py> a = object()
py> a
py> locals()['bob'] = a
py> bob
A similar approach can be used for the global namespace.
James
--
James Stroud
UCLA-DOE Institute for Genomics
uot;?".join([baseurl, fetchparams]))
afile = open(filename, "w")
afile.write(wwwf.read())
afile.close()
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
Hello All,
I'm curious, in
py> 0 | (1 == 1)
1
py> False | (1 == 1)
True
What is the logic of the former expression not evaluating to True (or
why the latter not 1?)? Is there some logic that necessitates the first
operand's dictating the result of the evaluation? Or is this an artefact
of the
Everyone wrote:
> [something intelligent]
Ah, clarity. My confusion can undoubtedly be traced to a non-existent
formal training in computer programming.
Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> At Thursday 21/9/2006 02:26, alex23 wrote:
>
>> page = urllib.urlopen('http://some.address')
>
> add .read() at the end
>
>> open('saved_page.txt','w').write(page).close()
>
> write() does not return the file object, so this won't work; you have to
> bind the file to
at %s' % COOKIEFILE)
print "<===cookies"
for map_id in xrange(1001, 1507):
try:
download_map(map_id)
wait = 7.5 + random.randint(0,5)
print "=> waiting %s seconds..." % wait
time.sleep(wait)
except urllib2.HTTPError, e:
# except DummyError, e:
print "%s: failed to download" % map_id
print " HTTP ERROR:", e
else:
print "# Downloaded map %s successfully." % map_id
signout = urllib.urlopen(pda + ("?%s" % signout_params))
afile = open("signout.html", "w")
afile.write(signout.read())
afile.close()
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
yxh wrote:
> how to use timer in python.
> the functionnality is like the MFC SetTimer()
>
>
Try this (a little more flexible than Timer):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/464959
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los
;red")
# note change here
self.button["command"] = functools.partial(self.getPath, t)
self.button.pack(side=LEFT)
def getPath(self, t):
dirPath = tkFileDialog.askdirectory(initialdir="c:\\")
print dirPath
t.set(dirPath)
root = Tk()
app = App(root)
root.mainloop()
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
e special in this regard?
I'm running Linux FC4 on a dual intel p4 (~3.2 GHz) with sundry
libraries in non-standard places. Is this non-standard part what's
killing me?
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jam
James Stroud wrote:
> Hello All,
>
> This is annoying. I am trying to build scipy right now but every .so
> file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared"
> to the ld flags.
>
> Main Question: When building with "setup.py", whe
Robert Kern wrote:
> James Stroud wrote:
>
>> Hello All,
>>
>> This is annoying. I am trying to build scipy right now but every .so
>> file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl
>> -shared" to the ld flags.
>
>
>>
Robert Kern wrote:
> James Stroud wrote:
>> I did build my own python 2.5, yesterday, requiring me to rebuild all
>> extensions.
>
> Do other extensions build correctly? If so, it's beginning to look like
> a problem in numpy.distutils .
It seems that every thi
Martin v. Löwis wrote:
> James Stroud schrieb:
>> This is annoying. I am trying to build scipy right now but every .so
>> file requires my adding "-lpython2.5 -lpthread -lm -lutil -ldl -shared"
>> to the ld flags.
>
> That shouldn't be necessary.
Robert Kern wrote:
> James Stroud wrote:
>> I did build my own python 2.5, yesterday, requiring me to rebuild all
>> extensions.
>
> Do other extensions build correctly? If so, it's beginning to look like
> a problem in numpy.distutils .
Actually, I just fou
lude/pgsql
Again, see the above rant for an explanation about any needless paths or
flags--though advice and knowledge is welcome.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
>>
>>In the state of the onion address?
>>
>>http://www.perl.com/pub/a/2006/09/21/onion.html
>
>
> There is also this:
> 'But I think the basic Perl paradigm is "Whatever-oriented programming."'
This reminds me of when I realized I could become m
Robert Kern wrote:
> James Stroud wrote:
>
>> Well I added those arguments to $LDFLAGS, but it seemed like a pretty
>> miserable hack, especially the "-shared" part.
>
>
> Hmmm. Did you have $LDFLAGS set to anything (or more likely, nothing)
> befor
Martin v. Löwis wrote:
> James Stroud schrieb:
>
>>>What happens if you omit these flags?
>>
>>Please see my last message to Robert Kern.
>
>
> If you don't want me to help you, that's fine, then I won't.
>
> I couldn't find an an
or
devising this system for you.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
> James Stroud <[EMAIL PROTECTED]> writes:
>
>> I try things until a build works. I consider everything I do
>> until acquiring a working build as necessary. Going back to see
>> exactly what I did to make things work is not a viable option
>
&
Martin v. Löwis wrote:
> James Stroud schrieb:
>> I think I would like to know how to avoid or correct these sort of
>> issues in the future, which seem to be limited, for me at least, to
>> scipy and numpy, with the possible exception of MySQLdb and its
>> dependenc
Robert Kern wrote:
> Okay, this is possibly part of the problem. numpy.distutils handles
> FORTRAN code differently than other extension modules; this is why pure
> C extension modules both inside numpy and elsewehere were linking fine.
> Try unsetenving $CPPFLAGS and $LDFLAGS and adding those a
Hello,
I decided that the ultimate python IDE would basically be a vim editor
with a hotkey or button that ran the currently edited module as
"__main__", allowing gui (tkinter, wx) windows to spawn etc.
That's it.
I tried the "runscript.vim" plugin which basically promises this, but it
seems
walterbyrd wrote:
> If so, I doubt there are many.
>
> I wonder why that is?
>
If you know German, there was just a job posting on this list for a
python programmer. That would be at least one person.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Bo
Ilias Lazaridis wrote:
> Ilias Lazaridis wrote:
>> IDLE has an output format like this:
>>
>> >>> object
>>
>> >>> type
>>
>> >>> object.__class__
>>
>> >>> object.__bases__
>>
>> How can I customize it to become like that:
>>
>> >>> object
>>
>> >>> type
>>
>> >>> object.__cl
has anything to teach me that say python, C, and Java don't
(LISP/Scheme is on my short-list to learn.)
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
ed inside of the
setquit() function in the site.py module.
Would moving this class definition to module level be something that
would meet with great resistance?
I was thinking of posting to python-dev, but that list looked pretty
high-level.
James
--
James Stroud
UCLA-DOE Institute for Gen
Ilias Lazaridis wrote:
> James Stroud wrote:
>>Ilias Lazaridis wrote:
>>>I am wondering that other users are not annoyed by this reduced
>>>readability.
>>
>>I'm sure its quite unpopular to agree with you, but I do. I am
>>tremendously annoyed
Fredrik Lundh wrote:
> James Stroud wrote:
>
>> It seems I can find a reference to just about every type except those
>> for "exit" and "quit" in the standard library somewhere. E.g.:
>>
>> py> type(__builtins__.Ellipsis) is types.EllipsisT
Fredrik Lundh wrote:
> James Stroud wrote:
>
>> Yes, but I was speaking more consistency than convenience (see above
>> for what I mean by consistency).
>
> why would having access to a type object for exit/quit help you do
> proper syntax coloring, btw? if you want
Georg Brandl wrote:
> James Stroud wrote:
>> Hello All,
>>
>> Still jubilantly configuring my work environment for python 2.5, I
>> came accross a curiosity when writing an automatic vim syntax file
>> creator (so I can automatically update my syntax colorin
[EMAIL PROTECTED] wrote:
> Xah Lee wrote:
>> Computer Language Popularity Trend
>>
>> This page gives a visual report of computer languages's popularity, as
>> indicated by their traffic level in newsgroups. This is not a
>> comprehensive or fair survey, but does give some indications of
>> popular
[EMAIL PROTECTED] wrote:
> James> But then again, maybe the consistency I perceive for the rest of
> James> __builtins__ is more or less illusory. This might have been the
> James> point of Fredrik's question.
>
> As I implied in my note, there is a difference between fundamental built
lls.
>
> sherm--
>
While Xah does have a reputation for trolling, and the crossposting
borders on pathological, you must admit that he presents here a bit of
nice and illuminating research. We probably should encourage him when he
does worthwhile things, and perhaps, in the future, he
gt;
> andy
>
In the commented line, you are only creating a generator. This is not
equivalent to calling its "next" function, i.e., nothing will be
"yielded" the way you have written it.
def nn():
def _nn():
print 'inside'
yield 1
ot field in self._fields:
raise ValueError, 'Field "%s" not supported.' % field
else:
self.__setattr__(field, value)
def get_value(field):
if not field in self._fields:
raise ValueError, 'Field "%s" not supported.' % field
James Stroud wrote:
> John Salerno wrote:
>
>> Let's pretend I'm creating an Employee class, which I will later
>> subclass for more specific jobs. Each instance will have stuff like a
>> name, title, degrees held, etc. etc.
>>
>> So I'm won
5. I called %edit from ipython
At which point ipython took me to a new gvi window (and process).
What am I not doing that doesn't seem to be in the instructions?
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.
only to be downloaded when needed. This way, the user
would at least have to reverse engineer your program to see where the
resources were coming from so they could plug the appropriate query in
their web browser.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
are
using your program so much, that you'll probably be able to go ahead and
buy your own hosting company. One python hosting company offers 50GB/mo
bandwidth for $7.50/mo. Google "python hosting" and you'll find them.
That's hella usage of a program.
James
--
James S
Harold Trammel wrote:
> Hi everyone,
>
> Does anyone know the status of a version of MySQLdb that will work with
> Python 2.5? I will accept a workaround if you know one. Thanks in
> advance.
>
> Harold Trammel
I could not find a way around this requirement, but you will want to
manually ad
hg wrote:
> But today ? what is the cost of replacing %w("blah blah") by
> Hi_I_Want_To_Split_The_String_That_Follows( "blah blah")
The latter is beginning to look like the Cocoa/NextStep framework.
Perhaps we should give up scripting languages for ObjC?
James
--
http://mail.python.org/mailman/
b,'value',v+5) for (v,b) in enumerate(alist)]
[None, None, None, None, None]
py> alist
[: 5, : 6, : 7, : 8, : 9]
py> map(setattr, alist, ['value']*5, xrange(5))
[None, None, None, None, None]
py> alist
[: 0, : 1, : 2, : 3, : 4]
--
James Stroud
UCLA-DOE Institute for
John Machin wrote:
> James Stroud wrote:
>
>>Daniel Nogradi wrote:
>>
>>>Is looping over a list of objects and modifying (adding an attribute
>>>to) each item only possible like this?
>>>
>>>mylist = [ obj1, obj2, obj3 ]
>>>
>>&
ut the error?
>
py> try:
... raise ValueError, 'Illegal value for your shoe size!'
... except (IndexError, ValueError), e:
... print e
...
Illegal value for your shoe size!
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 900
k(self, some_value):
... self.value = some_value
...
py> C.value
42
py> c1 = C()
py> c1.value
42
py> c2 = C()
py> c2.value
42
py> c2.separate_from_pack(88)
py> c2.value
88
py> C.value
42
py> c3 = C()
py> c3.value
42
James
--
James Stroud
UCLA-DOE Institu
path/to/Code" in it.
5. Open a new shell so the $PYTHONPATH gets set correctly for your rc
file.
6. Now, start python in that shell and import your packages.
Congratulations! You have now setup an environment where all the code
you write becomes packages and re-usable. Why a similar
x[1] += 1# shorthand
print "newx = %s" % newx# basic formatting
print "res = %s" % res # should be what you expect
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
sense:
res = []
for i in xrange(1,7):
res.append([1,i])
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
hich gives an overflow message
> So can't I truncate the long by discaring the upper bits ..
> Like b[0] = 0x & a[0]
>
> How does one normally cast an object from long to short?
Take the modulo 65536?
py> array.array('H', (array.array('L
Hello,
Does anyone know of the most straightforward way to get rid of the
intensely annoying "console" window that py2app feels so compelled to
create?
On a related but less important note, why would anyone want that stupid
window in the first place?
James
--
http://mail.python.org/mailman/l
James Stroud wrote:
> Hello,
>
> Does anyone know of the most straightforward way to get rid of the
> intensely annoying "console" window that py2app feels so compelled to
> create?
>
> On a related but less important note, why would anyone want that stup
Dave Opstad wrote:
> In article <[EMAIL PROTECTED]>,
> James Stroud <[EMAIL PROTECTED]> wrote:
>
>> Does anyone know of the most straightforward way to get rid of the
>> intensely annoying "console" window that py2app feels so compelled to
>
Hello All,
I am trying to create a semi-standalone with the vendor python on OS X
10.4 (python 2.3.5). I tried to include some packages with both
--packages from the command and the 'packages' option in setup.py. While
the packages were nicely included in the application bundle in both
cases (
Hendrik van Rooyen wrote:
> Hi,
>
> I get the following:
>
> [EMAIL PROTECTED]:~/Controller/lib> python display.py
> UpdateStringProc should not be invoked for type font
> Aborted
>
> and I am back at the bash prompt - this is most frustrating, as there is no
> friendly traceback to help me gues
rmine that information for yourself when it could save you a step
> and just tell you? This seems like a "no-brainer" to me. Am I missing
> something?
>
I think you have a point. I am curious to see how far people are willing
to go to defend this omission. It promises to be en
JustStand wrote:
> For detail, view http://www.homeoftester.com/viewtopic.php?t=281
> __
> I have a dream, I hope I can be as strong as Enter key.
Does this pointless blogvertisement in anyway compensate for the fact
that windows sucks so hard?
James
Russ wrote:
> Fredrik Lundh wrote:
>
>
>>>Sorry I haven't thought this through 100%
>>
>>obviously not.
>
>
>
> And you didn't like the "tone" of some of my earlier posts?
>
Some people consider themselves above a sensi
[EMAIL PROTECTED] wrote:
> hi,
> how can i skip printing the last line using loops (for /while)
>
> eg
>
> for line in open("file):
> print line.
>
> I want to skip printing last line of the file.thanks
>
afile = open(filename)
xlines = afile.xreadlines()
aline = xlines.next
for nextlin
James Stroud wrote:
> [EMAIL PROTECTED] wrote:
>> hi,
>> how can i skip printing the last line using loops (for /while)
>>
>> eg
>>
>> for line in open("file):
>> print line.
>>
>> I want to skip printing last line
[EMAIL PROTECTED] wrote:
> Fredrik Lundh wrote:
>> [EMAIL PROTECTED] wrote:
>>
>>> how can i skip printing the last line using loops (for /while)
>>>
>>> eg
>>>
>>> for line in open("file):
>>> print line.
>>>
>>> I want to skip printing last line of the file.
>> do it lazily:
>>
>> last_
Fredrik Lundh wrote:
> James Stroud wrote:
>
>> See the documentation for xreadlines.
>
> why?
>
>
>
>
>
5.16 xreadlines -- Efficient iteration over a file
--
http://mail.python.org/mailman/listinfo/python-list
ng from its position and make
inferences about the tuple object searched, /philosophically/ speaking?
Or is the logic conveniently one-way?
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/
--
http://mail.python.
301 - 400 of 1138 matches
Mail list logo