On Tue, 2007-04-10 at 15:32 -0400, John Salerno wrote:
Sorry for this non-Python question, but since it's computer related I
know you guys will have an answer, and I don't really know where else to
ask. Mainly I'm just curious anyway.
I'm wondering, why do computers use a RGB color scheme
On Tue, 2007-04-10 at 21:23 -0700, Paul Rubin wrote:
Carsten Haese [EMAIL PROTECTED] writes:
You have a point. Here is my revised solution:
assert current_player in p
opponents = tuple(x for x in p if x is not current_player)
Still wrong on two counts. First, assert is a no-op
On Mon, 2007-04-09 at 11:50 +1000, Steven D'Aprano wrote:
On Sun, 08 Apr 2007 20:10:21 -0400, Carsten Haese wrote:
Will tuples also get a sort method? What about append and extend? pop?
__iadd__? __delslice__?
Since tuples are immutable, no.
[...]
If you see tuples as an immutable list
On Mon, 2007-04-09 at 22:52 +0530, Pradnyesh Sawant wrote:
Hello,
I have a string which in reality is the name of a module to be
imported. The name of the class contained in the module also has the
same (although with different capitalization). My requirement is to
import the module, and also
On Sun, 2007-04-08 at 07:51 -0700, Paul Rubin wrote:
Carsten Haese [EMAIL PROTECTED] writes:
Maybe we can add such methods to the PyPy tuples for some time, to
experimentally see if they make the language worse :-)
Adding useless features always makes a product worse. What's your use
On Sun, 2007-04-08 at 13:10 -0700, Paul Rubin wrote:
Carsten Haese [EMAIL PROTECTED] writes:
Do you not see the gratuituous inconsistency between tuples and lists
as a useless feature? What is the use case for keeping it?
When a new feature is requested, the burden of proof
On Sat, 2007-04-07 at 06:45 -0700, [EMAIL PROTECTED] wrote:
Carsten Haese:
The lack of convincing use cases is still a pertinent reason today. Note
that the original poster on this thread did not present a use case for
tuple.index, they were only asking out of curiosity.
If you have a use
On Sun, 08 Apr 2007 02:40:52 GMT, Alan Isaac wrote
Carsten Haese [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Adding useless features always makes a product worse. What's your use
case for tuple.index?
[...] consider a game,
where the fixed set p of players have a fixed order
On Fri, 2007-04-06 at 11:33 -0700, 7stud wrote:
On Apr 6, 7:56 am, Paul Boddie [EMAIL PROTECTED] wrote:
The problem with 7stud's quote from GvR is that it's out of date:
I would argue that it shows the very guy who invented the language
stated publicly there was no good reason for tuples
On Thu, 2007-04-05 at 12:51 -0700, [EMAIL PROTECTED] wrote:
I would like to gauge interest in the following proposal:
Problem:
Assignment statements cannot be used as expressions.
Performing a list of mutually exclusive checks that require data
processing can cause excessive
On Tue, 2007-04-03 at 13:26 -0400, Boudreau, Emile wrote:
I am trying to extract one file from a tarball, without success. This
is the code I'm using to open the tarball and extract the file:
tar = tarfile.open(component+'-win32-app-'+bestVersion+'-dev.tar.gz',
'r')
extractedFile =
On Fri, 2007-03-30 at 14:34 -0700, erikcw wrote:
On Mar 30, 5:23 pm, [EMAIL PROTECTED] wrote:
I haven't tested it, but superficially I'd suggest giving this a try:
def endElement(self, name):
if name == 'row' :
if not self.data.has_key(self.parent):
On Fri, 2007-03-23 at 09:54 -0700, [EMAIL PROTECTED] wrote:
When constructing a particularly long and complicated command to be
sent to the shell, I usually do something like this, to make the
command as easy as possible to follow:
commands.getoutput(
'mycommand -S %d -T %d ' %
On Wed, 2007-03-21 at 06:36 -0700, flit wrote:
Hello All,
I have a hard question, every time I look for this answer its get out
from the technical domain and goes on in the moral/social domain.
First, I live in third world with bad gov., bad education, bad police
and a lot of taxes and
On Wed, 2007-03-21 at 11:33 -0700, gtb wrote:
On Mar 21, 8:36 am, flit [EMAIL PROTECTED] wrote:
2 - If I put the code in web like a web service, how can I protect my
code from being ripped? There is a way to avoid someone using my site
and ripping the .py files?
Maybe an application for
On Tue, 2007-03-20 at 06:46 -0700, abcd wrote:
I have the following directory/file structure...
c:\foo\utils.py
c:\foo\bar\ok.py
In ok.py I want to do something like...
import utils
utils.helpMeDoSomething()
However, it seems that ok.py doesn't know about utils. Other than
On Tue, 2007-03-20 at 16:47 -0700, Gerry wrote:
I'm still mystified why:
qno was ever unicode,
Thus quoth http://www.lexicon.net/sjmachin/xlrd.html This module
presents all text strings as Python unicode objects.
-Carsten
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2007-03-20 at 20:26 -0400, jim-on-linux wrote:
I have been getting the same thing using SQLite3
when extracting data fron an SQLite3 database.
Many APIs that exchange data choose to exchange text in Unicode because
that eliminates encoding uncertainty. Whether an API uses Unicode would
On Mon, 2007-03-19 at 11:42 -0700, abcd wrote:
nevermind this took care of it:
import sys
def tryAllThree():
a = c:\\alpha
b = c:\\beta
g = c:\\gamma
sys.path.append(a)
import Person
alpha = Person.Person()
sys.path.remove(a)
sys.path.append(b)
On Fri, 2007-03-16 at 04:04 -0700, Yury wrote:
I am new to python and programming generally, but someday it is time
to start :)
I am writing a python module in C and have a question about multibyte
character strings in python=C.
I want a C function which takes a string as argument from python
On Wed, 2007-03-14 at 01:39 -0700, PaoloB wrote:
Hi everyone,
during our development, we need to write some unit tests that interact
with OpenOffice through pyUno.
Is there anyone who has got any experience on it? As OpenOffice is
quite a large beast, and interaction is rather complex, I
On Sat, 2007-03-10 at 22:27 -0500, Terry Reedy wrote:
Anton Vredegoor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
| Terry Reedy wrote:
|
| Partitioning positive count m into n positive counts that sum to m is a
| standard combinatorial problem at least 300 years old. The
On Mon, 2007-03-12 at 18:08 +0300, Fabio Gomes wrote:
Yes, Luca.
I noticed that printing the list item will show the string as
expected. But I need to print the entire list in the script I'm
writing and doing that, the list will will be repr()'ed. Is there any
way to print the entire list
On Fri, 2007-03-09 at 07:17 -0800, cesco wrote:
On Mar 9, 3:51 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
cesco [EMAIL PROTECTED] writes:
I have to generate a list of N random numbers (integer) whose sum is
equal to M. If, for example, I have to generate 5 random numbers whose
sum
On Fri, 2007-03-09 at 12:32 -0800, Sean McIlroy wrote:
hi all
when i run this code in python 2.3
## BEGIN CODE
class warfare:
def __init__(self): self.pairs = [[0,0]]*2
def __str__(self): return str(self.pairs)
def setfirst (self,i,value):
On Wed, 2007-03-07 at 15:18 -0500, John wrote:
I am coding a radix sort in python and I think that Python's dictionary may
be a choice for bucket.
The only problem is that dictionary is a mapping without order. But I just
found that if the keys are numeric, the keys themselves are ordered
On Fri, 2007-02-16 at 05:34 -0800, Johny wrote:
On Feb 16, 2:14 pm, Peter Otten [EMAIL PROTECTED] wrote:
Johny wrote:
I have
string=span class=test45655/span.
tdspan class=test123128/span
span class=test789170/span
where I need to replace
span class=test45655/span.
On 27 Jan 2007 07:43:59 GMT, Fabrice DELENTE wrote
Incidentally, I noticed something about the environment: in my
script, I use the LINES and COLUMNS environment vars that are set in
my shell:
columns=int(os.environ.get(COLUMNS))
lines=int(os.environ.get(LINES))
In the shell, I get
On Thu, 2007-01-11 at 23:47 +, Nick Maclaren wrote:
In article [EMAIL PROTECTED],
Facundo Batista [EMAIL PROTECTED] writes:
| Noud Aldenhoven wrote:
|
| When I was programming in a mathematical project I began to wonder if
python
| supports rational numbers[1]. In a language like
On Fri, 2007-01-12 at 15:05 +, Nick Maclaren wrote:
In article [EMAIL PROTECTED],
Carsten Haese [EMAIL PROTECTED] writes:
| On Thu, 2007-01-11 at 23:47 +, Nick Maclaren wrote:
| In article [EMAIL PROTECTED],
| Facundo Batista [EMAIL PROTECTED] writes:
| | Python does not have
On Fri, 2007-01-12 at 12:17 -0800, mark wrote:
I want to pass a value to an argument of a function. The argument name
is dynamic and is stored in a
variable. How do I call the function using with arg_name and value as
the parameters.
thanks
mark
For ex:
def function(arg1='None',
On Fri, 2007-01-12 at 20:22 +, Simon Brunning wrote:
On 1/12/07, mark [EMAIL PROTECTED] wrote:
I want to pass a value to an argument of a function. The argument name is
dynamic and is stored in a
variable. How do I call the function using with arg_name and value as the
parameters.
On Wed, 2007-01-10 at 14:05 -0800, Huayang Xia wrote:
I am trying to use PyObject_CallMethod. It needs a format string to
specify what are the followed arguments. Is it possible to use a
PyObject* as an argument?
Where can I find the spec for the format?
Thanks in advance.
See
On Tue, 2007-01-09 at 11:38 +, Nick Maclaren wrote:
| Rory Campbell-Lange wrote:
|
| Is using the decimal module the best way around this? (I'm
| expecting the first sum to match the second). It seem
| anachronistic that decimal takes strings as input, though.
As Dan Bishop says,
On Sat, 2007-01-06 at 15:43 +0100, Michael M. wrote:
In Perl, it was:
## Example: Abc | def | ghi | jkl
## - Abc ghi jkl
## Take only the text betewwn the 2nd pipe (=cut the text in the 1st
pipe).
$na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g;
## -- remove [ and ] in text
On Thu, 2007-01-04 at 17:01 -0800, _ wrote:
(I did google for this, I promise)
How do I get python NOT to insert newlines into string representations
of lists when I do something like this:
strCollector += %s % (['a', 'list', 'with', 'lots', 'of', 'elements']
* 100)
What makes you think
On Wed, 2007-01-03 at 15:37 +0100, Stef Mientki wrote:
If I call a parameterless function without brackets at the end,
the function is not performed, but ...
I don't get an error message ???
Is this normal behavior ?
Yes. If you call a function without brackets, it's not a call.
Remember
On Wed, 2007-01-03 at 10:48 -0800, dwelden wrote:
I have successfully used the sort lambda construct described in
http://mail.python.org/pipermail/python-list/2006-April/377443.html.
However, how do I take it one step further such that some values can be
sorted ascending and others descending?
On Mon, 2007-01-01 at 21:57 -0800, ronrsr wrote:
I have an MySQL database called zingers. The structure is:
zid - integer, key, autoincrement
keyword - varchar
citation - text
quotation - text
I am having trouble storing text, as typed in latter two fields.
Special characters and
On Tue, 2007-01-02 at 17:17 +0100, Sebastian 'lunar' Wiesner wrote:
Ravi Teja [EMAIL PROTECTED] typed
Ivan Voras wrote:
Ramdas wrote:
Well,
I need to add users from a web interface for a web server, which
runs only Python. I need to add users, set quotas and in future
even
On Sun, 2006-12-31 at 13:23 -0600, [EMAIL PROTECTED] wrote:
rrenaud Is there a reason why erf() is not included in the math
rrenaud package? According to the following URL it looks like it has
rrenaud been standard C since 1999.
Python is implemented in the C89 dialect. Maybe
On Fri, 2006-12-29 at 09:30 -0600, Chris Mellon wrote:
On 12/28/06, Ray Schumacher [EMAIL PROTECTED] wrote:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(1)
conn, addr = s.accept()
while 1:
data = conn.recv(1024)
if data[:3] == 'GET':
On Fri, 2006-12-29 at 19:15 +, Just Another Victim of the Ambient
Morality wrote:
I can't seem to get VideoCapture (http://videocapture.sourceforge.net/)
to work with my version of Python (2.5). Why is that? I've followed the
instructions which made it look easy but, as it happens
On Thu, 2006-12-28 at 16:14 +0100, Stef Mientki wrote:
I want to return a simple variable from a function,
not using the function result.
Is that in any way possible ??
The code below is from O'Reilly, Learning Python,
and there seems no way
to return a simple var like z in the example
On Thu, 2006-12-28 at 15:28 +, Paul Hummer wrote:
You'd have to either pass the variables by reference into the function, [...]
In Python, all function calls are call by reference. Period. The key
difference between Python and other programming languages is in the
behavior of the assignment
On Thu, 2006-12-28 at 19:49 +0100, Stef Mientki wrote:
[...]
When I replace the assignment to filter_prev, by a loop,
the function works as expected.
Python
#filter_prev = Extended [ len(Signal_IN) : ]
for i in range( len(filter_prev )):
filter_prev[i] = Extended [ len(Signal_IN)
On Wed, 2006-12-27 at 18:10 +, yomgui wrote:
actually, it is not linked to threading but to the scope.
the second attempt to access MyPackage.aVariable
is inside the __init__ of a class
and this seems to be the problem.
I believe it is a genuine python bug.
Please post a minimal but
On Wed, 2006-12-27 at 10:37 -0800, Ramashish Baranwal wrote:
[...]
def fun2(**kwargs):
# get id param
id = kwargs.pop('id', '')
# pass on remaining to fun1
fun1(kwargs)
When I try to call fun2 I get the following error-
TypeError: fun1() takes exactly 0 arguments (1
On Wed, 2006-12-27 at 12:13 -0800, tac-tics wrote:
I have a program which has a GUI front-end which that runs a separate
thread to handle all the important stuff. However, if there is a
problem with the important stuff, I want the GUI to raise a MessageBox
alert to indicate this.
For
On 25 Dec 2006 21:50:15 -0800, many_years_after wrote
While , there is something wrong in my expression. What I mean is the
thread will wait some time after doing some tasks. I want to know is
there any method to end the thread or make it out of execution of
waiting. I use time.sleep() to let
On Tue, 2006-12-26 at 11:15 -0800, [EMAIL PROTECTED] wrote:
Hi,
It is possible to get bytecode from code object.
Reversely, is it possible to create code object from bytecode?
ex.
## python code (not a module)
pycode = '''\
print ul\n
for item in items:
print li%s/li\n %
On Tue, 2006-12-26 at 14:48 -0500, Carsten Haese wrote:
* Code objects come in two flavors: statements and expressions.
* exec can execute a 'statement' flavored code object.
* eval can evaluate an 'expression' flavored code object.
* Your code snippet is a statement, actually, a suite
On Tue, 2006-12-26 at 13:08 -0800, John Machin wrote:
Wojciech Mula wrote:
Steve Bergman wrote:
I'm looking for a module to do fuzzy comparison of strings. [...]
Check module difflib, it returns difference between two sequences.
and it's intended for comparing text files, and is
On Sun, 2006-12-24 at 22:55 -0800, many_years_after wrote:
Hi, pythoners:
There is a problem I couldn't dispose. I start a thread in the my
program. The thread will do something before executing time.sleep().
When the user give a signal to the main thread (such as click the 'end'
On Thu, 2006-12-21 at 11:22 -0800, [EMAIL PROTECTED] wrote:
Michele Simionato wrote:
The subject says it all, I would like a script to act differently when
called as
$ python script.py and when called as $ python -i script.py. I looked
at the sys module
but I don't see a way to retrieve
On Wed, 2006-12-20 at 20:22 +0100, Fredrik Lundh wrote:
[EMAIL PROTECTED] wrote:
I'm extremely new to Python and programming as a whole. I have written
a python script with the assistance of ESRI ArcGIS 9.2, which uses
Python 2.4.1, however, it gives me this error when I try to run it.
On Wed, 2006-12-20 at 11:33 -0800, Mark Peters wrote:
Warning: I know nothing about the Python ArcGIS stuff.
The first thing that jumps out at me is your while condition. You are
testing Townshps when it seems from the code that you should be
testing Townshp. However, the typical Python
On Sat, 2006-12-16 at 20:48 +, John Nagle wrote:
The SourceForge page
http://sourceforge.net/project/showfiles.php?group_id=22307
says
MySQL versions 3.23-5.0; and Python versions 2.3-2.4 are supported.
Last release was April, 2006. There's no binary for Python 2.5
On Sat, 2006-12-16 at 04:27 +, dyork wrote:
John Machin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I suppose it all depends on your definition of obvious :-)
I was looking for a constructor that was the complement of str(). Most/many
languages would provide that.
On Thu, 2006-12-14 at 06:45 -0800, [EMAIL PROTECTED] wrote:
Can someone please explain why these expressions both produce the same
result? Surely this means that non-greedy regex does not work?
print re.sub( 'a.*b', '', 'ababc' )
gives: 'c'
Understandable. But
print re.sub( 'a.*?b',
On Thu, 2006-12-14 at 15:57 +, Nick Maclaren wrote:
In article [EMAIL PROTECTED],
Fredrik Lundh [EMAIL PROTECTED] writes:
|
| The point is that an index method makes sense on ANY data structure that
| can be subscripted by an integer value but, for reasons that aren't at
| all clear,
On Wed, 2006-12-06 at 17:33 +0100, Schüle Daniel wrote:
def permute3gen(lst):
lenlst = len(lst)
def permute(perm, level):
if level == 1:
yield perm
return # not sure return without a value is allowed,
theoretically it could be replaces with
On Mon, 2006-12-04 at 01:04 -0800, Russ wrote:
Robert Kern wrote:
Nothing is going to happen until you do one of these two things. Being more
rude
(and yes, you are being incredibly rude and insulting) won't move things
along.
I re-read the thread, and I don't see anywhere where I
On Mon, 2006-12-04 at 08:49 -0800, [EMAIL PROTECTED] wrote:
Carsten Haese wrote:
On Mon, 2006-12-04 at 01:04 -0800, Russ wrote:
Robert Kern wrote:
Nothing is going to happen until you do one of these two things. Being
more rude
(and yes, you are being incredibly rude
On Mon, 2006-12-04 at 14:03 -0800, king kikapu wrote:
I recap: if i put only functions declarations on a .py file, like
these:
def A(): print a
def B(): print b
def C(): print c
and run the program, nothing happens, nothing executed.
Nothing *visible* happens. The def statements *do* get
On Mon, 2006-12-04 at 23:44 +0100, Fredrik Lundh wrote:
Carsten Haese wrote:
* The function body gets compiled into byte code (but not executed).
careful: when you get as far as executing the def statement, the
function body has already been compiled. the byte code for the function
opaque types in their binary representation
Downloads and info at http://informixdb.sourceforge.net
Best regards,
Carsten Haese
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 2006-11-27 at 19:14 +, OKB (not okblacke) wrote:
Duncan Booth wrote:
And is there a mechanism in Python that will allow me to override
the operators of a class, for all its occurrences, even the ones
implemented on C built-in objects?
No.
For what it's worth,
On Fri, 2006-11-17 at 10:43 -0500, Michael Yanowitz wrote:
Your pattern would be [^A-Za-z0-9_]word[^A-Za-z0-9_]
--
Juho Schultz
Thanks.
This works great except for one thing:
The character after the replacement is deleted, so that if I have
send_data (LAPTOP, test_string)
On Fri, 2006-11-17 at 16:51 -0500, Michael B. Trausch wrote:
[...]
Let's say that I want to work with the latitude 33.6907570. In
Python, that number can not be stored exactly without the aid of
decimal.Decimal().
33.6907570
33.6907568
You say that like it's Python's fault. Can
On Fri, 2006-11-17 at 16:51 -0500, Michael B. Trausch wrote:
On Fri, 2006-11-17 at 21:25 +0100, Fredrik Lundh wrote:
Some of the lat/long pairs that I have used seem to come out fine, but
some do not. Because the mathmatics used with them involve complex
equations when determining
On Thu, 2006-11-16 at 07:32 -0800, Danny Colligan wrote:
Carsten mentioned that generators are more memory-efficient to use when
dealing with large numbers of objects. Is this the main advantage of
using generators? Also, in what other novel ways are generators used
that are clearly superior
On Thu, 2006-11-16 at 08:09 -0800, Danny Colligan wrote:
The more trivial the example, the harder it is to see the advantage.
I absoultely agree. Thanks for pointing me out to some real-world
code. However, the function you pointed me to is not a generator
(there is no yield statement...
On Thu, 2006-11-16 at 08:03 -0800, [EMAIL PROTECTED] wrote:
@atexit.register
def goodbye():
print Goodbye, terminating...
However, there is one fundamental problem with this: atexit.register()
returns None. Since the above code corresponds to::
def goodbye():
print
On Wed, 2006-11-15 at 09:13 -0800, Mateuszk87 wrote:
Hi.
may someone explain yield function, please. how does it actually work
and when do you use it?
[There is probably a much better explanation of this somewhere on the
net already, but I feel like writing this out myself.]
yield is a
On Tue, 2006-11-14 at 09:33 -0600, Kevin Kelley wrote:
import time
FORMAT='%Y%m%d'
time.strftime(FORMAT,time.gmtime(time.time()+8380800))
output = '20070219'
While the above works, the following variation using datetime is more
readable:
import datetime
someday = datetime.date.today() +
On Mon, 2006-11-13 at 18:34 +0100, Stefan Behnel wrote:
Honestly, how many important Python modules do still run on 2.2?
InformixDB still compiles on 2.2 except when I accidentally temporarily
break backwards compatibility.
Of course it's a matter of opinion whether it qualifies as an important
On Mon, 2006-11-13 at 10:14 -0800, Dan Lenski wrote:
lennart wrote:
So i ask myself is python the language I'm looking for?
Yep! Python is very much a jack-of-all-trades language.
I'll run the risk of being nitpicky, but the full phrase is Jack of all
trades, master of none, which doesn't
On Sat, 2006-11-11 at 23:14 -0800, Doug wrote:
Fredrik Lundh wrote:
Doug wrote:
Fredrik Lundh wrote:
Fredrik Lundh wrote:
cannot all you clueless trolls who cannot think of a single useful thing
to contribute to Python start your own newsgroup?
and before anyone complains;
On Sat, 2006-11-11 at 23:18 -0800, Doug wrote:
Michael Hobbs wrote:
I think the colon could be omitted from every type of compound
statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything?
Thanks,
- Mike
It is a very good idea as the colon is technically redundant (not
On Wed, 2006-11-08 at 12:37 -0800, John Henry wrote:
I must be very thick. I keep reading about what decorators are and I
still don't have a good feel about it. See, for example:
http://alex.dojotoolkit.org/?p=564
and:
http://soiland.no/software/decorator
What exactly do I use
On Thu, 2006-11-02 at 12:28 -0800, JohnJSal wrote:
Can someone explain to me why the first version of this method works,
but the second one doesn't? All I've changed (I think) is how the
information is nested. The error I'm getting is that the call to
xrc.XRCCTRL is not working in the second
On Thu, 2006-11-02 at 13:14 -0800, JohnJSal wrote:
JohnJSal wrote:
JohnJSal wrote:
Peter Otten wrote:
...the above is not a 1-tuple, but an ordinary string. You forgot the
trailing comma:
('notes',)
Right you are! Now it works! :)
Thanks!
Oh great, now
On Tue, 2006-10-24 at 11:31, Gabriel Genellina wrote:
At Tuesday 24/10/2006 04:35, Cameron Walsh wrote:
c = set(B)
a.sort(key=c.__contains__, reverse=True)
Tim Delaney
Depressingly simple. I like it.
...and fast!
...and not guaranteed to be correct:
On Tue, 2006-10-24 at 11:41, Carsten Haese wrote:
On Tue, 2006-10-24 at 11:31, Gabriel Genellina wrote:
At Tuesday 24/10/2006 04:35, Cameron Walsh wrote:
c = set(B)
a.sort(key=c.__contains__, reverse=True)
Tim Delaney
Depressingly simple. I like it.
...and fast
On Fri, 2006-10-20 at 10:57, John Salerno wrote:
[EMAIL PROTECTED] wrote:
you should rethink it as
[id] [university] [yearStart] [yearEnd] [degreeEarned]
1 U of I 19711975 BS
1 U of I 19751976 MS
1 U of I 19761977
On Fri, 2006-10-20 at 10:53, Fredrik Lundh wrote:
if you want to become a good Python programmer, you really need to get
over that I need a oneliner idea.
+1 QOTW
-Carsten
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 2006-10-20 at 15:14, John Salerno wrote:
I'm a little confused, but I'm sure this is something trivial. I'm
confused about why this works:
t = (('hello', 'goodbye'),
('more', 'less'),
('something', 'nothing'),
('good', 'bad'))
t
(('hello', 'goodbye'),
On Fri, 2006-10-20 at 15:37, Carsten Haese wrote:
for x in t:
y,z = t
# do something with y and z
Typo here, of course I mean y,z = x.
-Carsten
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2006-10-17 at 08:43, kevin evans wrote:
Hi,
I'm trying to convert some code from Ruby to Python, specifically..
timestamp = %08x % Time.now.to_i
Make a hex version of the current timestamp. Any ideas how best to do
this in python gratefully received..
import time
timestamp = %08x
On Tue, 2006-10-17 at 08:49, hg wrote:
import time
%08X% (int)(time.mktime(time.localtime()))
Have you not had your coffee yet or are you trying to win an obfuscated
python programming competition? ;)
-Carsten
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 2006-10-17 at 09:30, abcd wrote:
x = None
result = (x is None and or str(x))
print result, type(result)
---
OUTPUT
---
None type 'str'
The condition and result1 or result2 trick only works if result1 is an
expression with a True boolean value. The empty
On Tue, 2006-10-17 at 09:48, Tim Chase wrote:
[...]
Either of the following should suffice:
# return a non-empty string
x is None and None or str(x)
This one can be optimized to just str(x) since str(None)==None.
[...]
There are more baroque ways of writing the terniary
On Mon, 2006-10-16 at 10:51, Steven D'Aprano wrote:
On Mon, 16 Oct 2006 07:26:05 -0700, abcd wrote:
class Foo:
def __init__(self, name, data=[]):
The binding of the name data to the empty list happens at compile time,
not runtime.
I think this statement needs to be clarified. The
On 14 Oct 2006 20:33:13 -0700, Chris wrote
from math import *
sin(0)
0.0
sin(pi)
1.2246063538223773e-016
sin(2*pi)
-2.4492127076447545e-016
cos(0)
1.0
cos(pi)
-1.0
cos(2*pi)
1.0
The cosine function works fine, but I'm getting weird answers for sine.
Is this a bug? Am I
On Thu, 2006-10-05 at 16:15, John Salerno wrote:
But I think SQL has other recommended methods. At least with SQLite, it
is recommended you not use Python's %s formatter but instead the ?
formatter.
While I wholeheartedly agree with the sentiment, calling the ? a
formatter only blurs the
On Tue, 2006-10-03 at 18:19, Samuel wrote:
Thanks, that's what I was looking for.
m = __import__( StringIO )
x = getattr( m, StringIO )()
x
StringIO.StringIO instance at 0x00A47710
For the records: If the module is already loaded, this also works:
if
.
* EXECUTE PROCEDURE erroneously attempted to open a results cursor for
procedures that don't return results.
* Date columns were read incorrectly on 64 bit platforms due to mixup
of int4 versus long.
Downloads and info at http://informixdb.sourceforge.net
Best regards,
Carsten Haese
On Tue, 2006-09-26 at 07:08, Lawrence D'Oliveiro wrote:
So yes, there should be two separate functions, one for escaping
non-wildcard specials, and one for escaping wildcards.
You only need the first one, since every database interface that
follows PEP 249.
You still need the second
On 23 Sep 2006 12:24:58 -0700, mistral wrote
No, something is wrong there. what I need is just compile one python
file which will generate html page, with parameters:
exec python -O $0 $@
This is not a python script. It appears to be a Unix shell script that calls a
python script.
Maybe it
501 - 600 of 682 matches
Mail list logo