#x27;re trying to approach
it from the top down. At the moment we've trimmed down the number of top
level sections and the next stage is to address the top page of each of
those sections (e.g. the 'community', 'documentation','python-dev' pages).
Still some w
Steve Holden wrote:
> Tim Parkin wrote:
>>Fredrik Lundh wrote:
>>
>>I sureley hope you can stop being facetious..
>>
>
> And I surely hope we can all work together for the better representation
> of Python to *all* of its communities :-)
>
> regards
&
[EMAIL PROTECTED] wrote:
> richard wrote:
> [snip]
> Should the "Python Cheeseshop" have anything in it, though? Having a
> stocked cheese shop in relation to Python is just silly!
Well, it shouldn't have any *cheese*, but that's probably OK for a
software repository.
--
http://mail.python.org
[Paul Rubin]
> It looks to me like you can't have two threads in the same generator:
You can't even have one thread in a generator-iterator get away with
activating the generator-iterator while it's already active. That's
an example in PEP 255:
"""
Restriction: A generator cannot be resumed w
[Duncan Booth]
> No, Python doesn't run the garbage collector when it is exiting.
Actually, it does. What it doesn't do is call the garbage collector
twice when it exits, although it used to ;-)
> What it does is to delete all the globals from each module in turn. So:
Yup. The code is in funct
>
>
> That website is down. You could try the archive as well:
> http://web.archive.org/web/20050401015445/http://www.python.org/
or you can look at http://archive-www.python.org which will be up for
the next month.
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
u need your range to start at 1? It's a common newbie error to start counting from 1 instead of zero in some places, but I won't accuse you of such an error without seeing more context :-)HTH
Tim After downloading the substantial distribution .zip file, I'm intrigued
to find i
k it works well.. I've also
removed a couple of bits from the left hand nav and moved the style
sheet switcher elsewhere (it probably should be in the help section). I
think the left hand nav is a lot clearer if kept simple.
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
who develop
>>Python itself."Core Development"? (Used on both perl.org and tcl.tk, so
>>maybe this is the best option.)
>>
>
>"core development" is fine with me.
>
>
>
>
>
>
forgot the link..
http://psf.pollenation.net/cgi-bin/trac.cgi/attachment/ticket/47/python-amends-2.png
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED]
> Icon is a language that share some similarities with Python:
> http://www.cs.arizona.edu/icon/
>
> During the execution of a Icon script there are ways to visualize the
> memory:
> http://www.cs.arizona.edu/icon/progvis/memmon/memmon.htm
>
> Related pages:
> http://www.cs.arizon
nerate word
> documents.
How about PyRTF to generate Rich Text Format documents which MS-Word
will lap up? Thanks to the efforts of Simon Cusack (hi Simon).
See http://cheeseshop.python.org/pypi/PyRTF/0.45
Tim C
--
http://mail.python.org/mailman/listinfo/python-list
se AttributeError, attr
def __setattr__(self, attr, value):
if attr == 'value':
self.__dict__['value'] = value
else:
raise AttributeError, attr
Is there a better ("more pythonic") way to do this?
Particularly if it plays well with sub-classing Foo.
f to PyRTF and send Simon a copy of your
modified code.
Cheers,
Tim C
--
http://mail.python.org/mailman/listinfo/python-list
aybe this is the best option.) "Development Team"?
>>
>>+1 on Core Development. It's still ambiguous, but less
>>so. And I can't think of anything better. ;)
>
>
> Since I just said almost that independently on an earlier
> thread, I guess that makes me +1 on "Core Development" (or
> "Core Developers") myself.
>
Sold to the man in the blue hat!! It's on the server now...
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
r example, to
comp.lang.c and comp.lang.c++.
>This example is why everyone is more excited about Ruby than Python.
That statement is just not true. I've looked at Ruby, but syntactically it
will never sway me from Python.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
g out non-obvious gotchas.
However, I'm sure it's a bear to administer.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
so that none of them threatens another". That's very
different from his problem specification.
It turns out there is only 1 unique (non-rotated, non-reflected) solution
to the problem as he posted it.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
for q3 in range(q2+1,25):
for q4 in range(q3+1,25):
for q5 in range(q4+1,25):
check( [q1+1,q2+1,q3+1,q4+1,q5+1] )
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
R when his message is visible. I'm also using Agent, and
that toggles his extended characters from quoted-printable to visible for
me.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
0 )
fout.write(bmfh)
# Do the BITMAPINFOHEADER.
bmih = struct.pack('LLLHHLL',
40,
width,
height,
1,
32,
0, 0, 0, 0, 0, 0 )
fout.write(bmih)
# Expand the pixels, scan by scan.
for i in range(height):
words = array.array('H')
> The above construct works if I have only few items, but if I have many,
> I'd prefer to write
>
N =3
x =N*[[0]]
x
>
> [[0], [0], [0]]
>
> If I now try extending the lists indepently, I cannot, as they all
> point to the same list object
>
x[0].append(1)
x
>
> [[0, 1], [0,
> For more details about the plan for Python 2.5, see:
>
> http://www.python.org/doc/peps/pep-0356/
Looks like links to PEPs are completely hosed at the moment. For
example, the link above displays an empty directory, and
http://www.python.org/doc/peps
displays a directory full of empty
Roedy Green <[EMAIL PROTECTED]> wrote:
>On Sun, 19 Mar 2006 02:08:11 GMT, Tim Roberts <[EMAIL PROTECTED]> wrote,
>quoted or indirectly quoted someone who said :
>
>>Try pressing Ctrl-R when his message is visible. I'm also using Agent, and
>>that toggl
I can set the whole cell
to bold by this:
xl = win32com.client.Dispatch("Excel.Application")
wb = xl.ActiveWorkbook
ws = wb.Worksheets(1)
r = ws.Range("A1")
r.Characters.Font.Bold = True
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
d you be a bit more specific?
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
using a proxy (one of the anonymous proxies would do the job).
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
[ezd]
| # u.py
| import sys
| print 'args',sys.argv
|
| in "Command Prompt" window, with 2 command lines on 2 PCs:
|
| # Case (1L):
| C:\tmp> u.py a b c
| args ['C:\\tmp\\u.py']
|
| # Case (1D):
| C:\tmp> u.py a b c
| args ['C:\\tmp\\u.py', 'a', 'b', 'c']
Almost certainly means that the associ
[EMAIL PROTECTED] <[EMAIL PROTECTED]>[
> For writing testcode, it looks like there's three ways that it's
> typically done:
>
> (1). using the doctest module,
>
> (2). using the unittest module (i.e. "pyunit"), or else
>
> (3). just putting an "if __name__ = '__main__':" at the bottom of your
> mod
[Douglas Alan]
>> I've noticed that there is little to no spam in comp.lang.python
>> and am wondering how this is accomplished.
[Skip Montanaro]
> Most mailing lists which originate on mail.python.org have SpamBayes
> filtering in front of them.
Worth noting that the SpamBayes project started sp
[lord trousers]
>>> Is there a way I can get hold of these kinds of statistics for
>>> debugging?
[Martin v. Löwis]
>> This is best done when Python is build in debug mode.
>> sys.gettotalrefcount then gives you the number of INCREF
>> calls for which no DECREF has been made; you said that
>> this
at does not appear to have been addressed to him, but SMTP doesn't care.
So, the way a BCC works is that the address goes into the envelope (in the
to_addrs list), but not in the message body.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
he "Refresh" header means that you are supposed to go fetch
the contents of that new page immediately. Try using urllib2.open on THAT
address, and you should get your content.
This is one way to handle a web site reorganization and still allow older
URLs to work.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
> Can one of you say to me what's the best editor for
> editing the python programs ( for linux or windows ), and
> if you can send it to me to the adresse
Hmmm...it's been almost a week since this topic came up on
the list. Good to see the topic is undead :) For plenty of
reading, check out t
BWill wrote:
> Hi, I'm writing a file browser, but I'm not sure how I could go about
> detecting the drives available on windows and linux systems (preferably
> using the standard modules if possible). I guess I could just try to
> list root on each letter of the alphabet for windows and see if it
d (with public/private keys). This was written to scratch a small
itch but also to learn how twisted works with conch, it's ssh module.
http://crontorted-project.pollenation.net/cgi-bin/trac.cgi
Feel free to use, I haven't put a license on it but it would be MIT/BSD
.. contact me if you want an explicit confirmation.
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
Tim Parkin wrote:
> Spire 01 wrote:
>
>>Greetings!
>>
...
>>Thanks a million!
>>Spire
>
>
>
> I wrote a small tool to implement cron like functionality over ssh using
> twisted (with public/private keys). This was written to scratch a small
&g
ng about the vulgar construct
"prolly" that really irks me, even more than "sth" for "something" or
"proggie" for "program".
You're only saving two keystrokes over the correct word, "probably", and
because it's split between the h
? You should just be able to pass the list:
s.sendmail( msg['From'], emails, msg.as_string() )
Or, if you must,
msg['To'] = emails
s.sendmail( msg['From'], msg['To'], msg.as_string() )
It needs to be a list or tuple of individual addresses, e-mail
o the human being at the other end, and
like all e-mail headers, must be a single string. (Note that it does not
actually have to have anything to do with the people who actually receive
the message.)
SMTP.sendmail, on the other hand, sets up the "envelope" of the message for
th
oject.pollenation.net/cgi-bin/trac.cgi
>
>Jean-Paul
>
>
And http://divmod.org/trac/wiki/DivmodNevow/FormHandling
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
guy got onto it)
What are you trying to implement.. it may be that you don't need
livepage at all.. Is it just some javascript to enhance a form field?
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
there was a link to it last time I looked.
Tim C
--
http://mail.python.org/mailman/listinfo/python-list
e still isn't a 'usage' guide for the new logo but I'll get onto one
soon hopefully.
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
[Steve R. Hastings]
> So, Python 2.5 will have new any() and all() functions.
> http://www.python.org/dev/peps/pep-0356/
>
>
> any(seq) returns True if any value in seq evaluates true, False otherwise.
>
> all(seq) returns True if all values in seq evaluate true, False otherwise.
>
> I have a quest
like 1/3 cannot be represented exactly in decimal. Further,
the more arithmetic you do, the less precise is your result.
Floating point is a very tricky world of approximation.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
>
>Thanks for your time,
>Daniel N.
>Phone. 1.416.834.1592
>e-mail. [EMAIL PROTECTED]
>url. http://2ExtremeStupids.com
Mmm, yes, spamming the technical newsgroups is a GREAT way to convince the
world that you are reliable, trustworthy, and knowledgable.
Not.
--
- Tim Rob
and
(17) (x)(Fx) ⊃ (∃x)(Fx),
[i.e., given that some predicate F is true for all x, it follows that
there exists an x for which F is true -- or, all(F) implies any(F) - tim]
which are valid if the universe is not empty, fail for the empty universe as
their truth depends on
the documentation won't
change but it will have a new navigation (rather than just the back, up,
forward on the current latex2html output). It's probably best to get
something up on a test site to look at before over-analysing it though..
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
[Dean Allen Provins]
| My Linux-based Python/Tkinter application runs nicely, and printing
| works just fine (to a user-selected file, or an "lpr" device specified
| in the Entry box). Alas, the user wants to run it under MS
| Win, and of
| course will want to print the canvas for posterity.
|
>>Or there is something else too ??
>
> You should use a decent editor that could automatically
> comment/uncomment code upon your request.
In Vim, you can map a key to do the following:
:s/^/#
to comment the highlighted lines, and
:s/^#
to uncomment them. To map them, you c
inconsistency seems worse)
>
> John
I presume so. It's not really up to me though. Someone has created some
new icons based on the new logo that have received some positive
feedback and that I like a lot.
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
y I hadn't closed the issue in the bug
tracker (it was you that reported it?).
Thanks
Tim
--
http://mail.python.org/mailman/listinfo/python-list
months, XFree86 was effectively dead and X.Org had
taken over the world, with the same code base but a more traditional
license.
I held my breath until I read the actual document...
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
EVERYWHERE.
The thought processes are the same -- you create UI, you handle events.
You also might look at Dabo, which is a wrapper around wxPython for exactly
this kind of app.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
> What I mean is, I want to change, e.g.:
>
> "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434, 72
> S. Ct. 394, 397, 96 L.Ed. 475 (1952)."
>
> into:
>
> "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434 (1952)."
>
> Generally, the beginning pattern would consist of:
Albert Leibbrandt wrote:
> Hi
>
> Can anybody tell me which windows API or python module they are using
> for writing cd's / dvd's with python?
Other people have offered sound suggestions about using
cdrecord etc. under Cygwin. Just to make the point, though,
XP (and above, presumably) does have a
o allow an operation where a 180-pound
character can carry 10,000 gold pieces might actually remove the aspect
of fun from the game."
Isn't this data validation and if it is, should the compiler be checking
this?
Tim Parkin
--
http://mail.python.org/mailman/listinfo/python-list
[efrat]
|I'd like to determine at runtime the computer's CPU frequency and
| memory.
|
| (Please note: I'm interested in hardware stuff, like how much
| memory the
| machine has; not how much free memory is available.)
I don't know if there's a cross-platform solution for this.
For Window
[EMAIL PROTECTED]
|
| I want to write a Python script that, when launched, will choose a
| random .sig (from a list of about 30 cool ones I've devised),
| and store
| the .sig text in the Windows Clipboard, so I can then paste
| it into any
| Windows application.
Very quick and untested answer.
member that this will fail:
print """
Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE;
Set-Cookie: username=testuser;
Status:302
Location:edit.py
"""
because you get a blank line first, which terminates the headers.
--
- Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
[jUrner]
>> def calc_time_res():
>> now = time.time
>> start = now()
>> x = start
>> while start == x:
>> x = now()
>> print x, start # <--
>> print x - start
>>
>> print calc_time_res()
>> 1.50203704834e-05
>>
>> Something is going wrong here.
>> If you look at the
Mike Joyce wrote:
> I am trying to write a portable script that will find removable media,
> such as compact flash, sd card, usb, etc. drive and then upload files
> from the media. I want this to be portable so that I can write and
> maintain one program for both Linux and Windows. Each platform us
[John Salerno]
> Is 'Python 3000' just a code name for version 3.0, or will it really be
> called that when it's released?
The smart money is on changing the name to Ecstasy, to leverage
marketing publicity from the hallucinogenic club drug of the same
name. "class" will be renamed to "rave", and
BartlebyScrivener wrote:
> I'm still new at this. I can't get this to work as a script. If I just
> manually insert the values for sys.argv[1] and sys.argv[2] it works
> fine, but I can't pass the variables from the command line. What am I
> doing wrong? On windows xp, python 2.4.3
>
[... snip c
[BartlebyScrivener]
| I had not seen the thread you linked to. I learned something, but it
| still doesn't explain whatever is happening on my machine. When I run
| assoc and ftype I get exactly the results you say I need to run the
| scripts properly. However, this simple script (printargs.py) se
[Philippe Martin]
| I understand that access can be accessed through an ODBC driver under
| windows (instead of Jet).
|
| I am wondering if the same can be done under Linux.
You need to look at the mdbtools packages
http://mdbtools.sourceforge.net/
which includes a Jet-ODBC driver which can be
[BartlebyScrivener]
| >> You missed the other option: if PATHEXT has .pyc in front
| of .py then you
| >> get exactly the described behaviour.
|
| That's it!!
|
| Trust me, I didn't do it. It was either ActiveState, Wing, or Komodo
| Dragon, or some combination thereof.
Amazing. I had a look,
ossibility is that there are no keys. Then the loop finishes
without ever setting item or values. This would give an unbound local
error. I assume that the OP would have noticed that in the traceback,
but perhaps he missed it.
OT, using i for the field namelike that makes my head hurt.
Tim Hochberg wrote:
> Kent Johnson wrote:
>
>>David Bear wrote:
>>
>>
>>>I'm attempting to use the cgi module with code like this:
>>>
>>>import cgi
>>>fo = cgi.FieldStorage()
>>># form field names are in t
Kent Johnson wrote:
> Tim Hochberg wrote:
>
>>Kent Johnson wrote:
>>
>>>David Bear wrote:
>>>
>>>
>>>>I'm attempting to use the cgi module with code like this:
>>>>
>>>>import cgi
>>>>fo = cgi.Fiel
[Paul Du Bois]
> Using win32 python 2.4.1, I have a minimal test program:
>
> def generate():
> raise TypeError('blah')
> yield ""
>
> print "\n".join((generate()))
>
> Executing the program gives:
>
> Traceback (most recent call last):
> File "", line 5, in ?
> TypeError: sequence expect
= "00"
else:
raise BogusValueFromDoofusError
new_input_value = "%s.%s" % (dollars, cents)
With the above bogus IP-address/currency value, this would
produce a valid result of "192.16" which may or may not be
what you want. Caveat regextor.
Feel free to monkey with the regexp to adjust for your wants.
-tim
--
http://mail.python.org/mailman/listinfo/python-list
Unless "varible number of whitespace" means "at least *some*
whitespace", in which case you'd want to use
(and|or|xor)\s+#
Both are beautiful and precise.
-tim
--
http://mail.python.org/mailman/listinfo/python-list
[Olivier Langlois]
> ...
> I have kept thinking about the original problem and I now believe that
> the only solution if he wants to store 3.6GB of data in a Python script
> is to recompile Python in 64 bits. I do not know if this is something
> that someone has already done successfully...
I did
> I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile)
Well, you asked for the python regexp...different
environments use different regexp parsing engines. Your
response is akin to saying "the example snippet of python
code you gave me doesn't work in my Pascal program".
For g
f.start())
or
[s[f.start():f.start()+3] for f in
re.finditer('(?=aba)', s)]
Note that both of these know the length of the desired
piece. If not, you may have to do additional processing to
get them to work the way you want. Yipp
[Mike Howard]
| Should read ...
| I'm doing some conversion of vb code to python code and I have a
| problem with a COM object
|
| Specifically in VB I can do
| Set oR = oA.Action
| debug.print oR.Item(1,2)
| [returns say "1"]
| oR.Item(1,2)="4"
| debug.print oR
| [returns "4"]
| oR.Update
| [
, "r")
r = re.compile(r'"DcaVer"=dword:([0-9a-fA-F]{7})')
for line in f.readlines():
m = r.match(line)
if m:
value = int(m.group(1), 16)
print value
f.close()
should do the trick for you. This assumes that each string
of hex digits has seven characters. Adjust accordingly.
-tim
--
http://mail.python.org/mailman/listinfo/python-list
Are there existing "quiet" conversion functions? Kin of
int() and float()?
My aim would be to call a function that would guarntee that
the result was of the defined type, choosing sensible
defaults if needed. Example problems include:
int("3.14")
int(None)
int(__builtins__)
int("hello")
For
ate the form name in a hidden field, but there ought to
>be some way to get directly at the form name but I'm just not seeing it. I
>looked in the os.environ() - don't see it there.
Nope, the form name is not transmitted as part of the HTTP request. It
only exists for the conv
[EMAIL PROTECTED]
>> what's the standard way for a "for" loop with float increments?
[Dan Sommers]
> Use a while loop instead:
>
> f = initial_value
> while f <= final_value:
> process(f)
> f = f + increment
>
> Note that there is no general guarantee that f will actually b
1')
> tail('after second h1')
What's the virtue of this form? Is it the indentation? If so, I suspect
some relatively pretty solution could be manufactured using the 'with'
syntax. Does anyone really write html 'by hand'
Steven Bethard wrote:
> Steven Bethard wrote:
>
>>Tim Hochberg wrote:
>>
>>>Steven Bethard wrote:
>>>
>>>>Steven Bethard wrote:
>>>>
>>>>>Duncan Booth wrote:
>>>>>
>>>>>>
er-for-letter like the tutorial states.
Letter for letter, maybe, but not space for space. Indentation is
important in Python. The "ready =", "if ready", and "else:" statements
must start in column 1. The two print statements need to be indented, as
they are.
-
Tim Hochberg wrote:
> Steven Bethard wrote:
>
>> Steven Bethard wrote:
>>
>>> Tim Hochberg wrote:
>>>
>>>> Steven Bethard wrote:
>>>>
>>>>> Steven Bethard wrote:
>>>>>
>>>>>> Dun
python enabled for testing purposes (my aim is
to make use of at least the CGI, mod_python, and
BaseHTTPRequestHandler).
When I run the setup.py script (either as myself or as root)
I get back
[EMAIL PROTECTED] cd ~tim/WebStack-1.1.2
[EMAIL PROTECTED] python2.3 setup.py install
running install
error:
>>[EMAIL PROTECTED] cd ~tim/WebStack-1.1.2
>>[EMAIL PROTECTED] python2.3 setup.py install
>>running install
>>error: invalid Python installation: unable to open
>>/usr/lib/python2.3/config/Makefile (No such file or directory)
>
> apt-get install python2
in the cookbook seems to do the job
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/156178
if it doesn't do exactly what you wnat have a poke around win32
tim
--
http://mail.python.org/mailman/listinfo/python-list
f = open("/tmp/mbrcontent", "rb")
contents = f.read()
f.close()
firstSectorAddress = contents[454:458]
numSectors = contents[458:462]
dia.org/wiki/Floating_point
0.1 isn't represented internally, so you haven't actually reached 10. -
try comparing that "10." (as it's printed) with 10.0 i.e.
print (t == 10.)
you'll get False - even though they print the same
Tim
--
http://mail.python.org/mailman/listinfo/python-list
Marco Mariani wrote:
>luca72 wrote:
>
>> i have checked and pyscard accept also the decimal notation,
>
>I'm not sure you ever understood what the problem was, or where, but I'm
>happy you feel like you've solved it.
+1 QOTW. Great reply.
--
Ti
"S. Chris Colbert" wrote:
>
>What a newbie mistake for me to make.
Don't feel too badly about it. Even very experienced programmers get
bitten by this issue. Until someone points it out, it's certainly not
obvious.
--
Tim Roberts, [email protected]
Providenza &a
plement), I am particularly sensitive to this. Processors are
usually architected so that you don't normally see the -0, but it leads you
to think about arithmetic a bit differently.
--
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailman/listinfo/python-list
((Decimal("101.10"),), (Decimal("99.32"),), (Decimal("97.95"),),
(Decimal("98.45"),), (Decimal("97.39"),), (Decimal("97.91"),), (Decimal
("98.08"),), (Decimal("97.73"),))
as such :
sum(result)
fails with "TypeError: unsupported operand type(s) for +: 'int' and
'tuple'"
How do I either get the
The feature is available in Python 3.x:
a, b, *c = 1, 2, 3, 4, 5
a, b, c
(1, 2, [3, 4, 5])
a, *b, c = 1, 2, 3, 4, 5
a, b, c
(1, [2, 3, 4], 5)
This is a nice feature of 3.x but I'm disappointed (especially in
light of the move to make more things iterators/generators), that
the first form
tuxsun wrote:
I've been working in the shell on and off all day, and need to see if
a function I defined earlier is defined in the current shell I'm
working in.
Is there a shell command to get of list of functions I've defined?
yesish...you can use dir() from the prompt to see the bound names
Olof Bjarnason wrote:
2009/11/27 baboucarr sanneh :
hi all
i would like to create a python program that would read from a text file and
returns one result at random.
e.g
in the text file i have these data
1.hello
2.my name
3.is
4.World
Your help is highly appreciated..thnx in advance
Hi bab
a new Python construct/syntax rather than the
existing py3k syntax. Or at least the removal of the
"ValueError: too many values to unpack" error. That would be a
lovely addition (when the new-feature-ban is lifted :)
-tim
--
http://mail.python.org/mailman/listinfo/python-list
inhahe wrote:
i don't understand the point of using 'with'
but i don't understand what 'with' does at all
i've tried to understand it a few times
anyway here:
import random
result = random.choice(open("c:\\test.txt").readlines())
Yep. That'll do the trick. The point of "with" is that,
while i
Is there a specific library used for displaying up to date consoles in
the same way top behaves?
From the last time a similar question was asked[1]:
You might look at the sourcecode for "iotop"[2] which would make
a good example (it's a "top"-like program written in Python, used
for monitorin
6001 - 6100 of 7724 matches
Mail list logo