Larry Bates <[EMAIL PROTECTED]> writes:
> I had occasion to look back at a project I did over a year ago
> and needed to make one small change. I use py2exe to package
> it for distribution via Inno Setup. After making my change
> I tried to run my setup script that worked fine before and
> get
"Johan Kohler" <[EMAIL PROTECTED]> wrote:
>
>I'm using CGIHTTPServer (via its test() method) to test some CGI on my
>Windoze 98 box. I find that the execution is very slow. Is there
>anything I can do to make sure I'm getting the best performance out of
>CGIHTTPServer?
Compared to what, and on w
Frans Englich wrote:
> Apparently, cleanPath /requires/ a boolean argument, but the C++
> function definition says:
>
> void cleanPath(bool cleanDirSeparator = true);
Most likely that cleanPath's default parameter hasn't been declared to
*Python*. If so, I expect this is a KURL bug. Raise a bu
Steven Bethard wrote:
>> If you ask: why do you choose these names? The answer is: they need
>> to be conformable with other functions, parameter names.
Is this a style guide thing?
>> I have a function that pretty much like:
>>
>> def output(output=''):
>> print output
>>
>> and now in anot
Hello,
I've stumbled over a behavior related to default function arguments which
appears to be a bug, from what I can tell. See this snippet:
>>> from kdecore import KURL
>>> u = KURL( "http://www.example.org/test/../"; )
>>> u.cleanPath()
Traceback (most recent call last):
File "", line 1,
In mid-October 2004, Jeff Epler helped me here with this string iterator:
def chars(s):
"""
This generator function helps iterate over the characters in a
string. When the string is unicode and a surrogate pair is
encountered, the pair is returned together, regardless of whether
Bo Peng wrote:
Dear list,
If you ask: why do you choose these names? The answer is: they need to
be conformable with other functions, parameter names.
I have a function that pretty much like:
def output(output=''):
print output
and now in another function, I need to call output function, with a
Coral Snake wrote:
I am having problems with programming even simple "Hello World"
programs from books and tutorials that use Python GUI libraries. Such
Programs cause python to throw "Attribute Errors" even when the
"attributes" being asked for by the errors exist in the source code.
This has happ
Tony Meyer wrote:
[a for a in list] (or a[:]) makes a copy of a list.
or list(a)
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
I am having problems with programming even simple "Hello World"
programs from books and tutorials that use Python GUI libraries. Such
Programs cause python to throw "Attribute Errors" even when the
"attributes" being asked for by the errors exist in the source code.
This has happened to me in both
Dear list,
If you ask: why do you choose these names? The answer is: they need to
be conformable with other functions, parameter names.
I have a function that pretty much like:
def output(output=''):
print output
and now in another function, I need to call output function, with again
keyword p
On Monday 07 March 2005 11:09 pm, gf gf wrote:
> I'd like to associate certain lists with keywords, and
> retrieve them. But this is not possible as lists are
> not hashable.
>
> What is the best workaround? I don't mind making my
> lists immutable. Is there a way to tupelize them?
> I tried my
> I'd like to associate certain lists with keywords, and
> retrieve them. But this is not possible as lists are
> not hashable.
A dictionary's values don't have to be hashable, so if the keywords are the
keys in the dictionary, this would work.
>>> d = {}
>>> d['key1'] = [1,2,3]
>>> d['key2'] =
gf gf wrote:
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
Do you want
mydict[mylist] = mykey
or
mydict[mykey] = mylist
?
The former is not possible with lists for the reason you noted. The
latter, however, works just
gf gf wrote:
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
You can convert them to tuples with the `tuple' function:
aDictionary[tuple(aList)] = aKeyword
> What is the best workaround? I don't mind making my
> lis
I'd like to associate certain lists with keywords, and
retrieve them. But this is not possible as lists are
not hashable.
What is the best workaround? I don't mind making my
lists immutable. Is there a way to tupelize them?
I tried mydict[mykey]=([a for a in list]) but it
didn't seem to work.
Hello Everyone,
I have been using this piece of code to start an
exec and "process" its stdout/stderror
import sysimport popen2
executable = r'execfile -arg1 -arg2'r, w, e =
popen2.popen3(executable)r.flush()w.flush()e.flush()
x=0
# just print the 1000 first lineswhile
x<1000:
sys.std
Martin v. Löwis wrote:
> There are several solutions, but one is to install Visual Studio .NET
> 2003 (which is different from Visual Studio .NET, also referred to
> as VS.NET 2002). Microsoft managed to rename the C library (CRT)
between
> 2002 (msvcr7.dll) and 2003 (msvcr71.dll), and you need to
[The HTML version of this Summary is available at
http://www.python.org/dev/summary/2005-02-15_2005-02-28.html]
=
Summary Announcements
=
Status of the candidates
It looks like all three candidates for taking
On Mon, 07 Mar 2005 19:24:43 -0500, "Grant Olson" <[EMAIL PROTECTED]> wrote:
>I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
>backslash+n+backslash+0. I.E. a repr of the string from python would be
>"foo\\n\\0". I'm trying to convert this string into one that contain
Tony Meyer wrote:
How can I select a random entry from a dictionary, regardless of its
key-values?
a = random.choice(d.keys())
a, d[a]
Or even:
key, value = random.choice(d.items())
or:
value = random.choice(d.values())
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailm
When I'm using pyunit and want to stop in a point during the test
(skipping all the framework initialization), I just start the debugger:
import pdb
pdb.set_trace()
You'll get the debugger prompt.
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 07 Mar 2005 16:20:30 -0600, Larry Bates <[EMAIL PROTECTED]> wrote:
> I had occasion to look back at a project I did over a year ago
> and needed to make one small change. I use py2exe to package
> it for distribution via Inno Setup. After making my change
> I tried to run my setup script
import random
print d[d.keys()[int(random.random()*len(d.keys()))]]
HTH
-c
--
http://mail.python.org/mailman/listinfo/python-list
>From the Python 2.4 quickreference:
d.popitem() Removes and returns an arbitrary (key, value) pair from
d
If this isn't random enough, then you can generate a random number in
range(len(d))
--
http://mail.python.org/mailman/listinfo/python-list
> How can I select a random entry from a dictionary, regardless of its
> key-values?
>>> import random
>>> d = {1:'a', 2:'b', 3:'c'}
>>> a = random.choice(d.keys())
>>> a, d[a]
(2, 'b')
(etc)
=Tony.Meyer
--
http://mail.python.org/mailman/listinfo/python-list
Hi
How can I select a random entry from a dictionary, regardless of its
key-values?
regards tores
--
http://mail.python.org/mailman/listinfo/python-list
Leeds, Mark wrote:
I have a string variable say “8023 “ and
I want to get rid of the beginning
And ending quotes.
I’ve tried different things
But haven’t had any success.
I’m definitely a python hacker and
Not an expert. Thanks.
>>> x = '"This is a quoted string"'
>>> print x
"This is a
If you simply wanted to get rid of quotes entirely, you could use:
"\"Hello!\"".replace( "\"" , "" )
However, since you only want the beginning and ending quotes removed:
>>> string = "\"If thou wert my fool, nuncle...\""
>>> print string
"If thou wert my fool, nuncle..."
>>> if string.startswi
There is very likely a more reasonable solution than this, but it was
the first one that came to mind:
IDLE 1.0.3
>>> string = "foo\\n\\0"
>>> string = string.replace( "\\n" , "\n" )
>>> string = string.replace( "\\0" , "\0" )
>>> string
'foo\n\x00'
>>> print string
foo
Hope this helps.
-
Francis Girard wrote:
Well, no text files can't be concatenated ! Sooner or later, someone will use
"cat" on the text files your application did generate. That will be a lot of
fun for the new unicode aware "super-cat".
Well, no. For example, Python source code is not typically concatenated,
nor
Grant Olson wrote:
I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
backslash+n+backslash+0. I.E. a repr of the string from python would be
"foo\\n\\0". I'm trying to convert this string into one that contains
actual newlines and whatnot.
r"foo\n\0".decode("string_escap
I have a data file that has lines like "foo\n\0" where the \n\0 is acutally
backslash+n+backslash+0. I.E. a repr of the string from python would be
"foo\\n\\0". I'm trying to convert this string into one that contains
actual newlines and whatnot. I feel like there has to be a better and safer
wa
djw wrote:
c.l.p-
I am having trouble understanding how one is supposed to correctly
utilize try:...except:...finally: in real code. If I have a block of
code like:
def foo():
try:
... some code that can raise an exception ...
finally:
... do some cleanup ...
retu
c.l.p-
I am having trouble understanding how one is supposed to correctly
utilize try:...except:...finally: in real code. If I have a block of
code like:
def foo():
try:
... some code that can raise an exception ...
finally:
... do some cleanup ...
Leif K-Brooks wrote:
> from IndexedCatalog.Shelf import Shelf
> shelf = Shelf(('localhost', 1234), [Class1, Class2])
Is it also possible to connect via socket instead of port? I've tried to
pass '/tmp/zeosocket' instead of ('localhost', 1234), but it isn't
successfull. Is is any way to do that?
I have a string variable say “8023 “ and
I want to get rid of the beginning
And ending quotes.
I’ve tried different things
But haven’t had any success.
I’m definitely a python hacker and
Not an expert. Thanks.
Mark
--
http://mail.
What does this command print?
gcc -c -I/usr/Python-2.3.3/Include -x c -o /dev/null \
/usr/Python-2.3.3/Include/pymem.h
If it prints an error like the one you included in this message, then
the set of header files in /usr/Python-2.3.3/Include is damaged,
incomplete, or wrong for your com
I have installed Python-2.3.3 in the SUSE Linux 9.1 system and am
trying to rebuild an application rpm that was implemented in Python, I
got the following error when compiling the application extension
module,
/usr/Python-2.3.3/Include/pymem.h: In function '__declspec'
/usr/Python-2.3.3/Include/py
[EMAIL PROTECTED] wrote:
> 2) added to MakeFile after config:
> EXTRA_CFLAGS=-DEAPI
You can do this, but it should be to "src/Makefile" and added
to "CFLAGS" and not "EXTRA_CFLAGS" as the latter doesn't exist.
--
http://mail.python.org/mailman/listinfo/python-list
You most likely need to construct your script using OOP. Can give you
give an example of code you're using when you get this error? This
helps a lot.
Regards,
Harlin
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Mar 07, 2005 at 11:51:20PM +0100, M.-A. Lemburg wrote:
[EMAIL PROTECTED] wrote:
I'm trying to get mxDateTime working on a Mac so that I can use pyscopg
and cx_Oracle. The Egenix base package builds and installs quite
happily, but then when I try to import it I get
import mx.DateTime
Fatal
On Mon, Mar 07, 2005 at 11:56:57PM +0100, Francis Girard wrote:
> BTW, the python "unicode" built-in function documentation says it returns a
> "unicode" string which scarcely means something. What is the python
> "internal" unicode encoding ?
The language reference says farily little about unic
On Monday 07 March 2005 17:51, M.-A. Lemburg wrote:
> [EMAIL PROTECTED] wrote:
> > I'm trying to get mxDateTime working on a Mac so that I can use
pyscopg
> > and cx_Oracle. The Egenix base package builds and installs quite
> > happily, but then when I try to import it I get
> >
> >
> >>>import
Steven Reddie wrote:
Hi,
Thanks, that seems to be what I was missing. I'm having some further
related trouble though. I want to do something like this:
MODULES = [ 'module1', 'module2' ]
def libinfo():
for m in MODULES:
__import__('libinfo.'
I have installed Python-2.3.3 in the SUSE Linux 9.1 system and am
trying to rebuild an application rpm that was implemented in Python, I
am getting the following error,
/usr/Python-2.3.3/Include/pymem.h In function '__declspec'
/usr/Python-2.3.3/Include/pymem.h:51: error: parse error before
'__dec
Le lundi 7 Mars 2005 21:54, "Martin v. LÃwis" a ÃcritÂ:
Hi,
Thank you for your very informative answer. Some interspersed remarks follow.
>
> I personally would write my applications so that they put the signature
> into files that cannot be concatenated meaningfully (since the
> signature simp
[EMAIL PROTECTED] wrote:
I'm trying to get mxDateTime working on a Mac so that I can use pyscopg
and cx_Oracle. The Egenix base package builds and installs quite
happily, but then when I try to import it I get
import mx.DateTime
Fatal Python error: Interpreter not initialized (version mismatch?)
A
I had occasion to look back at a project I did over a year ago
and needed to make one small change. I use py2exe to package
it for distribution via Inno Setup. After making my change
I tried to run my setup script that worked fine before and
get the following message:
F:\SYSCON\WTS\HTMLmenu>pyth
The pyconfig.h file (/usr/include/python2.3/pyconfig.h) should begin
something like this
/* pyconfig.h. Generated by configure. */
/* pyconfig.h.in. Generated from configure.in by autoheader. */
and shouldn't cause problems.
If it starts in a wildly different way than that, then it's p
I see lots of others have made suggestions, but here is a method
that I use frequently:
define a dictionary that contains references to your functions:
def foo():
.
. whatever it does
.
def bar():
.
. whatever it does
.
xfer={'foo', foo, 'bar', bar}
Then you can write
for fname in fnames:
[Joerg Schuster]
> I am looking for a method to "shuffle" the lines of a large file.
>
> I have a corpus of sorted and "uniqed" English sentences that has been
> produced with (1):
>
> (1) sort corpus | uniq > corpus.uniq
>
> corpus.uniq is 80G large.
Since the corpus is huge, the python portion s
Earl Eiland wrote:
> How does one make a Python program auto-execute in Windows?
>
> Earl
You need to have files with .py or .pyo or .py registered to open with
the python interpreter. In Windows Explorer, choose the menu item
Tools->Folder Options and select the File Types tab to see how
registe
> Heiko wrote:
> SETUP = object()> ELSE =
object()> BREAK = object()
>
> machine = {"WAITING FOR ACTION":>
{customer_drops_coin:"COIN HAS BEEN DROPPED",>
customer_selects_beverage:"ORDER RECEIVED",>
customer_cancels_order:"ACCOUNT CLOSURE IS
[EMAIL PROTECTED] wrote:
> Sheesh... I didn't actually pull the type(None) comparison out of my
> code.
Sheesh yourself. Newsgroup readers can't do inspect.hasaclue('J. Random
Poster'); they rely on duck-typing or goose-typing.
> I was simply throwing together a possible situation. Had I
> thou
In article <[EMAIL PROTECTED]>,
"Bob Swerdlow" <[EMAIL PROTECTED]> wrote:
> We have some users of our application getting error messages like:
> IOError: zipimport: can not open file
> /Volumes/MyApp/MyApp.app/Contents/Resources/Modules.zip
> This only happens on our Mac version - the Window
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> Michael Hoffman wrote:
> > Joe wrote:
> >
> >> I want the script to decide whether to fall back to the interactive
> >> prompt. You solution makes it ALWAYS fall back to the interactive prompt.
> >
> >
> > Actually, usi
There's a bug in the tokenizer that's triggered by the long
lines generated by makepy. See
http://sourceforge.net/tracker/index.php?func=detail&aid=1085454&group_id=78018&atid=551954
and
www.python.org/sf/1089395
Roger
"Tim N. van der Leeuw" <[EMAIL PROTECTED]> wrote in message
news:
M.N.A.Smadi grads.ece.mcmaster.ca> writes:
> I need to have a varaible that will contain a value that will be
> modified in one file, and when coming back to the same file it
> should retain the same value.
You must import the module in which the variable lives and qualify it
appropriately.
"Serge Orlov" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> I've never used tkinter, but I heard good things about it. Are you
> sure it's not you who made it to return byte string sometimes?
Yes, I used a Tkinter.StringVar to keep track of the contents of an
Entry widget; a
rbt wrote:
> How do I enable the hidden attribute when creating files on Windows
> computers? I'd *really* prefer to do from the standard Python
installer
> (no win32 extensions). Any tips?
>
> Thanks
Breaking your problem down a bit:
1. How is that done from the command line in Windows?
2. How t
O.K. I stand corrected. "auto-execute is the wrong term.
Earl
On Mon, 2005-03-07 at 14:03, rbt wrote:
> Earl Eiland wrote:
> > How does one make a Python program auto-execute in Windows?
> >
> > Earl
> >
>
> No program (python or other) can just arbitrarily execute. A user has to
> click it
Earl Eiland wrote:
How does one make a Python program auto-execute in Windows?
Use any of the mechanisms to make an arbitrary program auto-execute
(do you want on boot, on login, or what?), and use
c:\pythonXY\python.exe as the executable name; use the script name
as the first argument.
Regards,
Ma
Earl Eiland wrote:
In Linux, if I make the first line #!/path/to/Python, all I have to do
to execute the program is type ./FileName (assuming my pwd is the same
as FileName). what's the Windows equivalent?
Earl
On Mon, 2005-03-07 at 13:36, F. Petitjean wrote:
Le Mon, 07 Mar 2005 13:25:35 -0700, Ea
rbt wrote:
How do I enable the hidden attribute when creating files on Windows
computers? I'd *really* prefer to do from the standard Python installer
(no win32 extensions). Any tips?
With pure Python and just the standard installer, you need to invoke
attrib.exe, as
attrib.exe +H
Use os.system
Earl Eiland wrote:
How does one make a Python program auto-execute in Windows?
Earl
No program (python or other) can just arbitrarily execute. A user has to
click it or a cron-like utility (Task Scheduler) has to execute it at a
set time. registry entries (such as run) can execute programs too. A
thanks Aaron
i've changed that, but this time, even worse...
when i press F5, the pop-up windows appears, and then, it disppears
very quickly...(less than 1 second)
i cant see anything~ :(
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
I have Visual Studio .NET Professional installed.
Can anyone point me in the right direction?
There are several solutions, but one is to install Visual Studio .NET
2003 (which is different from Visual Studio .NET, also referred to
as VS.NET 2002). Microsoft managed to renam
Francis Girard wrote:
If I understand well, into the UTF-8 unicode binary representation, some
systems add at the beginning of the file a BOM mark (Windows?), some don't.
(Linux?). Therefore, the exact same text encoded in the same UTF-8 will
result in two different binary files, and of a slightl
I have installed Python-2.3.3 in the SUSE Linux 9.1 system and am
trying to rebuild an application rpm that was implemented in Python,
the defines in the pyconfig.h seem to be related to Microsoft 32-bit
and 64-bit environment, do I need these defines in the linux
environment? what is the purpose o
In Linux, if I make the first line #!/path/to/Python, all I have to do
to execute the program is type ./FileName (assuming my pwd is the same
as FileName). what's the Windows equivalent?
Earl
On Mon, 2005-03-07 at 13:36, F. Petitjean wrote:
> Le Mon, 07 Mar 2005 13:25:35 -0700, Earl Eiland a Ãcri
rbt wrote:
> How do I enable the hidden attribute when creating files on Windows
> computers? I'd *really* prefer to do from the standard Python installer
> (no win32 extensions). Any tips?
You could do
os.system('attrib +h hidethis.txt')
but that only works if hidethis already exists.
--
"Cod
Le Mon, 07 Mar 2005 13:25:35 -0700, Earl Eiland a écrit :
> How does one make a Python program auto-execute in Windows?
>
> Earl
>
write a virus ? :-)
What do you mean by « auto-execute » ?
Regards
--
http://mail.python.org/mailman/listinfo/python-list
Reinhold Birkenfeld wrote:
> or with a default function argument:
>
>
> class Dummy: pass
>
> def myFun(globe=Dummy()):
> try:globe.globe += 1
> except: globe.globe = 1
>
> return globe.globe
A quicker way:
def myFun(globe=[0]):
globe[0] += 1
return globe[0]
Reinhold
How does one make a Python program auto-execute in Windows?
Earl
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I've installed Python 2.4 on Windows XP and walked through the Alex
Martelli ASPN cookbook example at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66509
This is a recipe for a simple extension type for Python. When I try to
build and install it, however, I get an error:
c:\t
QOTW: "Really, of course, the only things you need to make explicit are the
ones that readers don't understand." -- Steve Holden
"Working with unicode objects in Python is so transparent, it's easy to
forget about what a C extension would likely want." -- Kevin Dangoor
"You take leadership in a
Michael Hoffman wrote:
Joe wrote:
I want the script to decide whether to fall back to the interactive
prompt. You solution makes it ALWAYS fall back to the interactive prompt.
Actually, using sys.exit() means the program can exit even if python -i
is used.
You can use:
import code
code.interact()
[Heiko Wundram]
> Replying to oneself is bad, [...]
Not necessarily. :-)
--
François Pinard http://pinard.progiciels-bpi.ca
--
http://mail.python.org/mailman/listinfo/python-list
[Joerg Schuster]
> I am looking for a method to "shuffle" the lines of a large file.
If speed and space are not a concern, I would be tempted to presume that
this can be organised without too much difficulty. However, looking for
speed handling a big file, while keeping equiprobability of all po
[EMAIL PROTECTED] wrote:
l = Undoable(list)
l = [1, 2, 3]
You just rebound l, so it no longer refers to an Undoable, it
refers to a list. This design won't work, you need something
more like:
l = Undoable([1, 2, 3])
There were a few other pitfalls in your design... Here,
try something like this ins
How do I enable the hidden attribute when creating files on Windows
computers? I'd *really* prefer to do from the standard Python installer
(no win32 extensions). Any tips?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
For the first time in my programmer life, I have to take care of character
encoding. I have a question about the BOM marks.
If I understand well, into the UTF-8 unicode binary representation, some
systems add at the beginning of the file a BOM mark (Windows?), some don't.
(Linux?). Therefo
I'd like to know how scripts are processed, whether
they are compiled into bytecode, how memory is
allocated for variables, how scripting languages
perform compared to each other, etc.
--- Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Peter Hansen <[EMAIL PROTECTED]
We have some users of our application getting error messages like:
IOError: zipimport: can not open file
/Volumes/MyApp/MyApp.app/Contents/Resources/Modules.zip
This only happens on our Mac version - the Windows version seems fine.
Our build is still using bundlebuilder, which creates Modules
>[EMAIL PROTECTED] wrote:
>> I have run into some cases where I would like to run a class method
>> anytime any class method is invoked.
>
>Perhaps you want __getattribute__ on a new-style class?
>--
>Michael Hoffman
Perhaps I do. The docs say that __getattribute__ is called on all
attribute refer
hi;
i have a project with multiple files in it. I need to have a varaible
that will contain a value that will be modified in one file, and when
coming back to the same file it should retain the same value. The way
am doing it right now, python is complaining about the variable being
non-glob
In regards to mod_python, I keep getting this warning when I do
apachectl configtest:
[warn] Loaded DSO libexec/mod_python.so uses plain Apache 1.3 API, this
module might crash under EAPI! (please recompile it with -DEAPI)
So I googled what I can, and have read various responses. Most say you
Steven Bethard said unto the world upon 2005-03-07 11:55:
Warren Postma wrote:
Michael Hoffman wrote:
The fact that True and False are not constants?
Yowza.
a = True
b = False
False = a
True = b
if (1==2)==True:
print "Doom"
Why stop there when you can really cause some doom:
py> import __bui
[EMAIL PROTECTED] wrote:
I have run into some cases where I would like to run a class method
anytime any class method is invoked.
Perhaps you want __getattribute__ on a new-style class?
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
I have run into some cases where I would like to run a class method
anytime any class method is invoked.
That is, if I write
x.foo
then it will be the same as writing
x.bar
x.foo
for any method in class x (with the possible exception of 'bar').
The first few times I wanted to print out a data st
[EMAIL PROTECTED] wrote:
uhm i'm trying to make a very simple but large database:
Let's say I want these fields : |name|age|country|
Then I can't do this because I use the same key
db["name"] = 'piet'
db["age"] = '20'
db["country"] = 'nl'
#same keys so it wil overwrite
db["name"] = 'jan'
db["ag
Title: RE: shuffle the lines of a large file
[Joerg Schuster]
#- Thanks to all. This thread shows again that Python's best feature is
#- comp.lang.python.
QOTW! QOTW!
. Facundo
Bitácora De Vuelo: http://www.taniquetil.com.ar/plog
PyAr - Python Argentina: http://pyar.decode.com.ar/
Joerg Schuster wrote:
Thanks to all. This thread shows again that Python's best feature is
comp.lang.python.
+1 QOTW
STeVe
--
http://mail.python.org/mailman/listinfo/python-list
Warren Postma wrote:
Michael Hoffman wrote:
The fact that True and False are not constants?
Yowza.
a = True
b = False
False = a
True = b
if (1==2)==True:
print "Doom"
Why stop there when you can really cause some doom:
py> import __builtin__ as bltin
py> bltin.True, bltin.False = bltin.False, b
Thanks to all. This thread shows again that Python's best feature is
comp.lang.python.
Jörg
--
http://mail.python.org/mailman/listinfo/python-list
Learning Ruby to use Rails is tempting.
Iwan van der Kleyn wrote:
> Gary Nutbeam wrote:
>> needing to learn Ruby.
>
> But why wouldn't you just use Rails and learn Ruby in the process? The
> "effort" required to learn Ruby pales in comparisson to the advantages
> using Ruby on Rails might give y
John J. Lee wrote:
I know mono runs on linux but I want nothing to do with it unless absolutely
necessary.
> Gary Nutbeam <[EMAIL PROTECTED]> writes:
>> D H wrote:
> [...]
>> > Check out Castle on Rails for .NET/Mono. It is still in early
>> > development, but you can use it with C#, VB, or boo,
Michael Hoffman wrote:
The fact that True and False are not constants?
Yowza.
a = True
b = False
False = a
True = b
if (1==2)==True:
print "Doom"
--
http://mail.python.org/mailman/listinfo/python-list
ChaosKCW wrote:
> def resultset_functional_generator(cursor):
> for rec in iter(lambda: cursor.fetchone(), None):
> yield rec
This can be simplified to
def resultset_functional_generator(cursor):
return iter(cursor.fetchone, None)
It should be a bit faster, too.
Peter
--
htt
1 - 100 of 164 matches
Mail list logo