Dan Bishop wrote:
>> def itoa(n, base):
>>assert 2 <= base <= 16
>
> Why have the restriction base <= 16? int() allows up to 36. All you
> need to do is
>
> BASE36_DIGITS = string.digits + string.lowercase
For no other reason than carelessness. I have not yet seen anything beyond
base-16 in t
Davor <[EMAIL PROTECTED]> wrote:
> no one ever had to document structured patterns - which definitely
> exist - but seem to be obvious enough that there is no need to write a
> book about them...
You _gotta_ be kidding -- what do you think, e.g., Wirth's "Algorithms
plus Data Structures Equals Pr
Thanks for the script. I haven't been on ebay for a while.
Wasn't aware of the Favorite searches. Favorite Search is
probably the way to go. Thanks for the info.
Lance
On Tue, 25 Jan 2005 22:57:54 -0800, Kamilche wrote:
> This script works. But why not make a 'Favorite Search' in ebay, and
>
On Tue, 25 Jan 2005 15:46:30 +, Stephen Kellett <[EMAIL PROTECTED]> wrote:
>In message <[EMAIL PROTECTED]>, Bengt Richter
><[EMAIL PROTECTED]> writes
>>I believe that is quite wrong as a general statement.
>
>Actually my initial statement should have been written
>"accessing a resource, the a
Nick Coghlan wrote:
> Huh - you remind me that I forgot to put the "show_base" Bengt and I came
> up with into the ASPN cookbook. . .
>
> Py> def show_base(val, base, min_digits=1, complement=False,
> ... digits="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
> ... if base > len(digits):
Jarek Zgoda wrote:
> Fuzzyman wrote:
>
> > I'm looking to implement a plugin spell checker.
> >
> > I'm probably going to go with PyEnchant, as it looks to be the most
> > promising currently maintained spell checker.
> >
> > I just wondered if anyone knew what happened to snakespell and
myspell.
Grant Edwards
> LookupError: no codec search functions registered: can't find encoding
> Googling for the error message will find you the answer.
http://starship.python.net/crew/theller/moin.cgi/Py2Exe
carries within "encodings" and "encodings again" receipes to get it
working.
A software d
On Wed, 26 Jan 2005 02:03:12 +, Bob Parnes wrote:
> In its default configuration, my version of pylint (0.5.0) sets the
> maximum number of class attributes at 7. This seems low to me, but I can
> see how an excessive number might make maintenance more difficult. Is this
> indeed the best valu
Joh wrote:
>> def gen(iterable, start, end):
>>it = iter(iterable)
>>while True:
>>it, a = tee(it)
>>a = tuple(islice(a, end-1))
>>for sz in xrange(start, len(a)+1):
>>yield a[:sz]
>>it.next()
>>
>> if __name__ == "__main__":
>>print list(gen(range(1, 5), 2, 4))
>
> please, this one looks interes
Dennis Lee Bieber wrote:
On Tue, 25 Jan 2005 20:43:54 +, Daniel Bowett
<[EMAIL PROTECTED]> declaimed the following in
comp.lang.python:
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with a mix of text and numbers
- its a produ
There are quite a few hosts who offer Python support, no? Maybe you
could change hosts. Pair offers Python, AFAIK.
On Tue, 25 Jan 2005 13:15:45 -0500, Daniel Bickett <[EMAIL PROTECTED]> wrote:
> I've been trying to convince my host to install python/mod_python on
> his server for a while now, how
Hi Brane,
I was wondering about the same thing some days
ago. I found the following alternatives:
* Curses for Windows for Python (It was previously
mentioned on a follow-up. there are some missing
features):
http://flangy.com/dev/python/curses/
* PDCurses (It looks promissing):
http://pdcurses.sou
I can't resist to point here to the
Re: How to input one char at a time from stdin?
posting in this newsgroup to demonstrate, what
this thread is about.
Claudio
> >On Tue, 25 Jan 2005 12:38:13 -0700, Brent W. Hughes
> ><[EMAIL PROTECTED]> wrote:
> >> I'd like to get a character from stdin, perf
"Xah Lee" <[EMAIL PROTECTED]> writes:
[snip]
> Following is a tutorial on Python's classes.
[snip]
Please stop posting this to comp.lang.c. I'm sure the folks in most
of the other newsgroup aren't interested either -- or if they are,
they can find it in comp.lang.python.
Followups redirected.
-
> "XL" == Xah Lee <[EMAIL PROTECTED]> writes:
XL> I've used the Python tutorial's chapter on class as
XL> an example. I've indicated that proper tutorial should be
XL> simple, covering just common cases, be self-contained, and be
XL> example based.
"Correct" is not in your li
Jeff Shannon wrote:
So, what problem is it, exactly, that you think you'd solve by making
tuple slices a view rather than a copy?
I think views are good for
1) saving memory
2) saving time (as you don't have to copy the elements into the new tuple)
And they are worth it. However, (as in other
On Wed, 26 Jan 2005 11:31:18 +0800, mep wrote:
> Hi,all
> Is there anybody trying to release a modification version to current
> python source code with no significant whitespace, say replacing whitespace
> by {}
> like C or java. I do *NOT* mean whitespace is good or bad, just
> want to know.
On behalf of the Python development team and the Python community, I'm
happy to announce the release of Python 2.3.5 (release candidate 1).
Python 2.3.5 is a bug-fix release. See the release notes at the website
(also available as Misc/NEWS in the source distribution) for details of
the bugs squi
It's perfectly possible to write good python code without using
classes. (and using functions/normal control flow).
You will have a problem with terrminology though - in python everything
is an object (more or less). Common operations use attributes and
methods of standard objects.
For example :
On Tue, 25 Jan 2005 19:25:55 -0500, "George Sakkis" <[EMAIL PROTECTED]> wrote:
>"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
>> George Sakkis wrote:
>>
>> > An iterator is perfectly ok if all you want is to iterate over the
>> > elements of a view, but as you noted, i
> How many indices?
Just the primary key (id).
--
http://mail.python.org/mailman/listinfo/python-list
Harald Massa <[EMAIL PROTECTED]> writes:
> Grant Edwards
>
>> LookupError: no codec search functions registered: can't find encoding
>> Googling for the error message will find you the answer.
>
> http://starship.python.net/crew/theller/moin.cgi/Py2Exe
>
> carries within "encodings" and "encodi
Hi,
I have a class with attributes that are string, integer and list. eg.
class person:
name =""
age = 0
friends=[]
comment=""
me = person()
I want to save a whole bunch of instances to a file, a classic "records"
file I/O.
To write the file, I can do f.write
On 25 Jan 2005 13:49:48 -0800, Davor <[EMAIL PROTECTED]> wrote:
> Is it possible to write purely procedural code in Python, or the OO
> constructs in both language and supporting libraries have got so
> embedded that it's impossible to avoid them? Also, is anyone aware of
> any scripting language t
Daniel Bowett wrote:
I have just started playing around with MySQLdb for a project I am
planning.
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with a mix of text and numbers
- its a product table for a website eg UPC, ProductNam
Erik Johnson schrieb:
I am trying to upgrade my Python installation. After downloading
sources and building Python 2.3.4, I am unable to use the command
history editing feature in the interactive interpreter (where the
up-arrow would previously give you the last command line to edit,
it now jus
Hello Davor,
> Also, is anyone aware of any scripting language that could be considered
> as "Python minus OO stuff"?
Maybe Lisp (http://clisp.cons.org/, http://www.paulgraham.com/onlisp.html)
or Scheme (http://www.plt-scheme.org/software/mzscheme/,
http://mitpress.mit.edu/sicp/full-text/book/boo
On Wed, 26 Jan 2005 11:55:59 -0800, jfj <[EMAIL PROTECTED]> wrote:
>Jeff Shannon wrote:
>
>>
>>
>> So, what problem is it, exactly, that you think you'd solve by making
>> tuple slices a view rather than a copy?
>>
>
>I think views are good for
> 1) saving memory
> 2) saving time (as you don
Aahz wrote:
In article <[EMAIL PROTECTED]>,
Tim Daneliuk <[EMAIL PROTECTED]> wrote:
Given an arbitrary string, I want to find each individual instance of
text in the form: "[PROMPT:optional text]"
I tried this:
y=re.compile(r'\[PROMPT:.*\]')
Which works fine when the text is exactly "[PROMPT:w
On Wed, 26 Jan 2005 08:58:45 +0100, rumours say that Peter Otten
<[EMAIL PROTECTED]> might have written:
>By the way, does anyone know the Greek name for 36?
triakontahexadecimal would be a nice compromise of greek and the
"hexadecimal" convention of having six before ten -- "ÎÎÎ" ("hexi") is
six
Davor wrote:
Is it possible to write purely procedural code in Python, or the OO
constructs in both language and supporting libraries have got so
embedded that it's impossible to avoid them? Also, is anyone aware of
any scripting language that could be considered as "Python minus OO
stuff"? (As you
jfj wrote:
Jeff Shannon wrote:
So, what problem is it, exactly, that you think you'd solve by making
tuple slices a view rather than a copy?
I think views are good for
1) saving memory
2) saving time (as you don't have to copy the elements into the new tuple)
1. Applies only if you are making
On Wed, 26 Jan 2005 02:10:44 +0100, rumours say that "Fredrik Lundh"
<[EMAIL PROTECTED]> might have written:
>Mike Moum wrote:
>> s.atoi('4',3) should result in 11
>>
>> s.atoi('13',4) should result in 31
>>
>> s.atoi('12',4) should result in 30
>>
>> s.atoi('8',4) is legitimate, but it generates
Peter Otten wrote:
> def itoa(n, base):
> assert 2 <= base <= 16
> if n < 0:
> digits = ["-"]
> n = -n
> else:
> digits = []
> while n:
> n, m = divmod(n, base)
> digits.append(string.hexdigits[m])
> digits.r
Christos TZOTZIOY Georgiou wrote:
> On Wed, 26 Jan 2005 08:58:45 +0100, rumours say that Peter Otten
> <[EMAIL PROTECTED]> might have written:
>
>>By the way, does anyone know the Greek name for 36?
>
> triakontahexadecimal would be a nice compromise of greek and the
> "hexadecimal" convention o
jfj wrote:
Actually, i think that slices with step, is a bad feature in general
and i think I will write a PEP to suggest their removal in python3k.
I wouldn't bother. Extended slicing was added to support those doing serious
numerical work in Python, and it won't get removed for all the reasons i
I would like to load image from a directory right into an image list.
I wrote a simple library that loads the images in the directory and
resizes them as needed before adding to the wx.ImageList.
This is not the same code but some snippets.
I resize the image this way (using Python Imaging Library)
> Date: Wed, 26 Jan 2005 00:10:31 -0500
> From: Tim Peters <[EMAIL PROTECTED]>
> The most common cause for "impossible exceptions"
> is flawed C code in an extension that fails to
> check a Python C API call for an error return.
Yes, I use a lot of C modules which I wrote. It could certainly be on
On Tue, 25 Jan 2005 23:19:01 +0200, Pro Grammer <[EMAIL PROTECTED]> wrote:
> Hello, all,
> I am not sure if this is the right place to ask, but could you kindly
> tell me how to "load" a shared object (like libx.so) into python, so
> that the methods in the .so can be used? That too, given that the
Johan Kohler schrieb:
class person:
name =""
age = 0
friends=[]
comment=""
me = person()
Otherwise, what is the best "Python" way to write and read this data
structure?
import pickle
class person:
name =""
age = 0
friends=[]
comment=""
me = person()
# store
> If you want only "search and found" element, look dictionnary ; if you
> want also to have the order, see the module set.
Erg - no. Sets are mathematically defined as having no order.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
Christos TZOTZIOY Georgiou wrote:
>>the function's named "atoi", not "atoitoa".
>
>
cool. can I have a copy of your script?
reminds me that I have a few patches in the inqueue. I wonder
what this one does? ;-)
hmm ;-) guess I can tune that later ;-) and what about that other
patch? ;-) let
> However, i know for a fact that phr is _not_ a user at
> sextans.lowell.edu.
>
> Is this a problem with my dns?
Most probably - he shows up as [EMAIL PROTECTED] for me.
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> > Is this a problem with my dns?
>
> Most probably - he shows up as [EMAIL PROTECTED] for me.
It's my news client configuration. Normally I post from a different
machine but that one is temporarily down. I haven't bothered to
configure this one p
What's the simplest way to write an FTP Server in Python?
A short research on the newsgroup and on the Cookbook did not
bring out anything relevant (but I hear a little voice in the
back of my head saying Twisted, Twisted! ...)
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-l
robert wrote:
Hello,
Anybody knows if it's possible to execute python code from an db.
db=MySQLdb.connect(host="localhost",user="r",passwd="j",db="v")
c=db.cursor()
c.execute("""SELECT * FROM table
WHERE id = %s""", (id,))
for python_code in c.fetchall():
execute (python_code)
Maybe f
> for python_code in c.fetchall():
> execute (python_code)
>
> Maybe feed python with stdin??.
eval
--
damjan
--
http://mail.python.org/mailman/listinfo/python-list
Davor schrieb:
so initially I was hoping this is all what Python is about, but when I
started looking into it it has a huge amount of additional (mainly OO)
stuff which makes it in my view quite bloated now.
So you think f.write('Hello world') is bloated and file_write(f,'Hello
world')
is not? T
[EMAIL PROTECTED] wrote:
If you're after a simple FTP server, have a look at medusa.
Uhm ... Medusa does not seem actively maintained nowadays.
M.S.
AFAIK, it's maintained to the extent, that if you find bugs/enhance it
and let the medusa-dev list know, it more than likely will get fi
I felt very evil after trying to figure out why my py program wouldn't work
when I began a year ago:
I do Delphi at work, and at home I was missing the () after the functions.
I was ready to sell my sou.. well nevermind.. it's all good now.
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTE
In message <[EMAIL PROTECTED]>, Bengt Richter
<[EMAIL PROTECTED]> writes
>>QueryPerformanceCounter is 47 times slower to call than clock() on my
>>1Ghz Athlon.
>That really makes me wonder. Perhaps the Athlon handles RDTSC by way of
>an illegal instruction trap and faking the pentium instruction?
If you're after a simple FTP server, have a look at medusa.
Regards
John
[EMAIL PROTECTED] wrote:
What's the simplest way to write an FTP Server in Python?
A short research on the newsgroup and on the Cookbook did not
bring out anything relevant (but I hear a little voice in the
back of my head say
Hello,
Anybody knows if it's possible to execute python code from an db.
db=MySQLdb.connect(host="localhost",user="r",passwd="j",db="v")
c=db.cursor()
c.execute("""SELECT * FROM table
WHERE id = %s""", (id,))
for python_code in c.fetchall():
execute (python_code)
Maybe feed pyt
Anybody out there who knows if the 4suite implementation of XSLT are a
threadsafe one?
--
--
Ola Natvig <[EMAIL PROTECTED]>
infoSense AS / development
--
http://mail.python.org/mailman/listinfo/python-list
Do you have a code snippet/pointer so I have an idea of how to use it?
M.S.
--
http://mail.python.org/mailman/listinfo/python-list
> If you're after a simple FTP server, have a look at medusa.
Uhm ... Medusa does not seem actively maintained nowadays.
M.S.
--
http://mail.python.org/mailman/listinfo/python-list
robert wrote:
Hello,
Anybody knows if it's possible to execute python code from an db.
db=MySQLdb.connect(host="localhost",user="r",passwd="j",db="v")
c=db.cursor()
c.execute("""SELECT * FROM table
WHERE id = %s""", (id,))
for python_code in c.fetchall():
execute (python_code)
Maybe
Thanks... works like a charm :-)
On Wed, 26 Jan 2005 12:55:38 +0100, Peter Maas <[EMAIL PROTECTED]> wrote:
Johan Kohler schrieb:
class person:
name =""
age = 0
friends=[]
comment=""
me = person()
Otherwise, what is the best "Python" way to write and read this data
structure
Pythonistas:
If you have been putting off your registration, stop putting it off!
Last year the early bird deadline was extended because we were a little
late getting the program together. This year the program was published
two weeks in advance of the deadline for early bird registrations, which
first problem:
With Idle environnement under Win32, all freeze after with bunch of
code:
#!/usr/bin/python
import threading,time
class T (threading.Thread) :
def __init__(self,_a,_b) :
threading.Thread.__init__(self)
self.a = _a
self.b = _b
def run(self) :
Ola Natvig wrote:
> Anybody out there who knows if the 4suite implementation of XSLT are a
> threadsafe one?
What do you mean by that? You can of course transform xml using xslt in as
many threads as you like - but what do you want with two or more threads in
_one_ transformation? You start it, a
Hello,
what is the fastest way to determine whether list l (with
len(l)>3) contains a certain element?
Klaus
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 26 Jan 2005 06:45:29 -0800 (PST), Klaus Neuner
<[EMAIL PROTECTED]> wrote:
> what is the fastest way to determine whether list l (with
> len(l)>3) contains a certain element?
If the list isn't sorted, I doubt you'll do better than
if an_element in my_list:
# do whatever
If the lis
Diez B. Roggisch wrote:
What do you mean by that? You can of course transform xml using xslt in as
many threads as you like
It is not unthinkable that some parts of the library would not be
threadsafe. They could have some internal shared global variable
that keeps track of an intermediate state.
Diez B. Roggisch wrote:
Ola Natvig wrote:
Anybody out there who knows if the 4suite implementation of XSLT are a
threadsafe one?
What do you mean by that? You can of course transform xml using xslt in as
many threads as you like - but what do you want with two or more threads in
_one_ transformat
Klaus Neuner <[EMAIL PROTECTED]> wrote:
> what is the fastest way to determine whether list l (with
> len(l)>3) contains a certain element?
"if thecertainelement in l:"
is the fastest way unless there are properties of l which you're not
telling us about, or unless what you need is not just
Istvan Albert wrote:
Diez B. Roggisch wrote:
What do you mean by that? You can of course transform xml using xslt
in as
many threads as you like
It is not unthinkable that some parts of the library would not be
threadsafe. They could have some internal shared global variable
that keeps track of
> It is not unthinkable that some parts of the library would not be
> threadsafe. They could have some internal shared global variable
> that keeps track of an intermediate state.
> Some C string processing functions are not thread safe either.
While the only one how can answer this is Uche himsel
what is the fastest way to determine whether list l (with
len(l)>3) contains a certain element?
Either a sorted list (in conjunction with the bisect-module) or a
dictionary is your friend...
Regards,
Marco
--
http://mail.python.org/mailman/listinfo/python-list
Klaus Neuner wrote:
Hello,
what is the fastest way to determine whether list l (with
len(l)>3) contains a certain element?
If you can use a set or dict instead of a list this test will be much
faster.
Kent
--
http://mail.python.org/mailman/listinfo/python-list
> If a thread that are using a XSLT processor looses the GIL within the
> transformation process and another one starts processing on the same
> processor will this work?
>
> Will the half-way finished thread be in the way of the one starting the
> processing before the stoped thread are done.
>
My broswser stoped working when I posted, and I tought it didn't work,
so I tried a more times until did not report an error.
Bye
--
http://mail.python.org/mailman/listinfo/python-list
> While the only one how can answer this is Uche himself, I'm confident that
> this is not the case - modern OO-style apis associate state usually on a
> per-object base. And 4suite is heavily OO-styled.
I should have added that this means that using a api like 4suite where you
can get a processor
Stephen Kellett wrote:
that time.clock() is inaccurate. The problem is that the "time.clock()"
statement takes several hundred microseconds to execute.
The statement is incorrect. clock() itself isn't slow, but it is
accessing a resource, the accuracy of which is no better than 1ms.
There are va
In matplotlib using the tkagg backend, the tk mainloop is started at
the end of a python script by issuing a call to a "show" function,
which realizes all the created figure windows and the calls
Tkinter.mainloop(). This can cause problems if the mainloop was
started by another module (eg idle).
I'm writing a test script in python for pulling web pages from a web
server using urllib2 and cookielib. Since the main thing I am testing is
what happens when concurrent requests are made to the web server, I need
to make several requests concurrently, which I'll do from different
threads in m
Steve Christensen wrote:
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
thank Peter, elbert, for the suggestions. I hadn't thought of using
telnet to try to connect to the SMTP server. and when I do try, telnet
can't connect either, at least on port 25. On port 110, it has no
problem.
"Davor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > On the other hand, this does beggar for a reason to bother with Python
at
> > all. It seems you could be happy doing BASH scripts for Linux or DOS
batch
> > files for Windows. Both are "nice&simple" scripting languages free
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> On Wed, 26 Jan 2005 11:55:59 -0800, jfj <[EMAIL PROTECTED]> wrote:
>
> >Jeff Shannon wrote:
> >
> >>
> >>
> >> So, what problem is it, exactly, that you think you'd solve by making
> >> tuple slices a view rather than a c
Michele -
Listen to your inner voice :-)
If simple is all you want, try twisted. You can use mktap to create a
simple ftp server and be ready to serve in a few minutes. And if you
are upto it, get buried in the documents and you can customize your ftp
server.
If you are looking for something sim
Hello,
I'm new to python,
How can I access private field in python.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
Input is this:
SET1_S_W CHAR(1) NOT NULL,
SET2_S_W CHAR(1) NOT NULL,
SET3_S_W CHAR(1) NOT NULL,
SET4_S_W CHAR(1) NOT NULL,
;
.py says:
import re, string, sys
s_ora = re.compile('.*S_W.*')
lines = open("y.sql").readlines()
for i in range(len(lines)):
try:
if s_ora.search(lines[i]): del lines[i]
e
I am currently taking a course to learn Python and was looking for
some help. I need to write a Python statement to print a comma-
separated repetition of the word, "Spam", written 511 times ("Spam,
Spam,
Spam").
Can anybody help me get started? I am completely new to programming!
Thanks in
That is clever, gives a lot of insight into how the __dict__ == the
object.
This is somewhat like the solution I am using from the Cookbook, an
Empty object copy. This is cleaner and very much more concise.
Thank you!
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Hello,
I'm new to python,
How can I access private field in python.
thanks
In python there realy are not private fields. There are those fields
that you start with a double underline (__) theese are translated to
___
Withouth the < and > markers, but there are not good p
wrote:
> Input is this:
>
> SET1_S_W CHAR(1) NOT NULL,
> SET2_S_W CHAR(1) NOT NULL,
> SET3_S_W CHAR(1) NOT NULL,
> SET4_S_W CHAR(1) NOT NULL,
> ;
>
> .py says:
>
> import re, string, sys
> s_ora = re.compile('.*S_W.*')
> lines = open("y.sql").readlines()
> for i in range(len(lines)):
> try:
>
Am Wed, 26 Jan 2005 15:55:28 + schrieb Judi Keplar:
>
> I am currently taking a course to learn Python and was looking for
> some help. I need to write a Python statement to print a comma-
> separated repetition of the word, "Spam", written 511 times ("Spam,
> Spam,
Spam").
>
> Can anyb
Judi Keplar schrieb:
I am currently taking a course to learn Python and was looking for
some help. I need to write a Python statement to print a comma-
separated repetition of the word, "Spam", written 511 times ("Spam,
Spam, … Spam").
Can anybody help me get started? I am completely new to pr
<[EMAIL PROTECTED]> wrote:
> but output is:
>
> SET2_S_W CHAR(1) NOT NULL,
> SET4_S_W CHAR(1) NOT NULL,
>
> It should delete every, not every other!
for i in range(len(lines)):
try:
if s_ora.search(lines[i]): del lines[i]
except IndexError:
...
when you loop over a range,
Hi Torsten,
If you want to use other methods to import (other than good ole file
system), yes, you can create an importer class and register it as an
importer module, that import will use to search and import.
For example, it is possible to use zip imports (this functionality is
already builtin)
On Tue, 25 Jan 2005 22:08:01 +0100, I wrote:
sys.safecall(func, maxcycles=1000)
> could enter the safe mode and call the func.
This might be even enhanced like this:
>>> import sys
>>> sys.safecall(func, maxcycles=1000,
allowed_domains=['file-IO', 'net-IO', 'devices', 'gui'
On Wed, 26 Jan 2005 15:55:28 -, Judi Keplar
<[EMAIL PROTECTED]> wrote:
> I am currently taking a course to learn Python and was looking for
> some help. I need to write a Python statement to print a comma-
> separated repetition of the word, "Spam", written 511 times ("Spam,
> Spam, â Spam").
[EMAIL PROTECTED] wrote:
Input is this:
SET1_S_W CHAR(1) NOT NULL,
SET2_S_W CHAR(1) NOT NULL,
SET3_S_W CHAR(1) NOT NULL,
SET4_S_W CHAR(1) NOT NULL,
;
.py says:
import re, string, sys
s_ora = re.compile('.*S_W.*')
lines = open("y.sql").readlines()
for i in range(len(lines)):
try:
if s_ora.search(lin
Judi Keplar wrote:
I am currently taking a course to learn Python and was looking for
some help. I need to write a Python statement to print a comma-
separated repetition of the word, "Spam", written 511 times ("Spam,
Spam, … Spam").
Can anybody help me get started? I am completely new to prog
Sara Fwd wrote:
Hi all
Is there a module for processing & handling '.po'
files in python?
If you want to do anything beyond standard gettext (which is handled by
the gettext module) there's lots of code at translate.sourceforge.net ...
David
--
http://mail.python.org/mailman/listinfo/python-lis
Hi *,
I have just started to learn python and I am having a problem with
an python client connecting to a perl server using ssl (I tried this
with pyOpenSSL and with the build in SSL Module).
I don't want to check a cerificate, so i simply tried a
from OpenSSL import SSL
s = socket.socket(so
>>> print "Spam, " * 510 + "Spam"
Or if you have 2.4..
>>> print ", ".join( "Spam" for _ in xrange( 511 ) )
Although, the replys with links will ultimately be more helpful!
Will McGugan
--
http://mail.python.org/mailman/listinfo/python-list
Py>>> print "Spam, " * 115
Spam, Spam, Spam, Spam, Spam, . Spam,
Multiplies (repeats) the string 115 times.
To eliminate the last ", " (that is, a comma followed by space), you
can do it using the slice notation and say:
Py>>> print ("Spam, " * 115) [:-2]
Spam, Spam, Spam, Spam, S
Thomas Guettler wrote:
Am Wed, 26 Jan 2005 15:55:28 + schrieb Judi Keplar:
I am currently taking a course to learn Python and was looking for
some help. I need to write a Python statement to print a comma-
separated repetition of the word, "Spam", written 511 times ("Spam,
Spam, ï Spam").
Thomas Guettler wrote:
# No comma at the end:
mylist=[]
for i in range(511):
mylist.append("Spam")
or just
mylist = ["Spam"] * 511
Kent
print ", ".join(mylist)
Thomas
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 246 matches
Mail list logo