nelson - wrote:
>i want to build up a simple 3d interactive geometry application in
> python. Since i want to run it without 3D acceleration (a scene will
> be quite simple)
the scene is simple so I don't want to use a well-supported and widely
used standard API because it might use hardware
"notejam" <[EMAIL PROTECTED]> Top posted:
> Thanks everyone for the help. I got a simple two line program to work
> from a text file.
> Can not figure out how to write more than one line in interpreter mode.
> Is that all interpreter is good for, testing one liners? I have it
> run the progra
I am populating a listbox from a directory that looks like this:
variable_dict = {"funny_long_or_short_variable_name_as_key": (2,45),..
the tuple represents a "card, line" pair.
medf is a font object and a forward reference here.
I write:
for x in variable_dict:
txt = x
while medf.m
hi!
i want to build up a simple 3d interactive geometry application in
python. Since i want to run it without 3D acceleration (a scene will
be quite simple) I was wondering if there was a library in python that
allow me to build 3D graphic without the need to use OpenGL I
google but i can't
Thanks a lot for all the answers!
Ray
Frederic Rentsch wrote:
> Rares Vernica wrote:
>> Hi,
>>
>> How can I unescape HTML entities like " "?
>>
>> I know about xml.sax.saxutils.unescape() but it only deals with "&",
>> "<", and ">".
>>
>> Also, I know about htmlentitydefs.entitydefs, but not only
Snor wrote:
> I'm attempting to create a lobby & game server for a multiplayer game,
> and have hit a problem early on with the server design. I am stuck
> between using a threaded server, and using an event driven server. I've
> been told time and time again that I should use an event driven serve
HYRY wrote:
> I want to add some simple search function for my homepage. It need to
> search through all the html files of my homepage (about 300 pages), and
> highlight the search words.
>
> I made some test with HTMLParser, it works but slow. So, my question is
> how can I improve its speed?
>
J. Clifford Dyer wrote:
> Alistair King wrote:
>
>> Hi,
>>
>> is there a simple way of creating global variables within a function?
>>
>> ive tried simply adding the variables in:
>>
>> def function(atom, Xaa, Xab):
>> Xaa = onefunction(atom)
>> Xab = anotherfunction(atom)
>>
>> if i c
Jeffrey Barish wrote:
> I am trying to use PIL to add a comment to an image. I have never used PIL
> before, but I discovered that it is possible to print an existing comment
> with the following:
>
> im = PIL.Image.open('filename.jpg')
> print im.app['COM']
>
> I figured that I could write a c
J. Clifford Dyer wrote:
> Alistair King wrote:
>
>> Hi,
>>
>> is there a simple way of creating global variables within a function?
>>
>> ive tried simply adding the variables in:
>>
>> def function(atom, Xaa, Xab):
>> Xaa = onefunction(atom)
>> Xab = anotherfunction(atom)
>>
>> if i ca
James Stroud wrote:
> Steve Holden wrote:
> > How could you end up marrying
> > someone who counts from one and not zero? ;-)
>
> She's the only other person I've ever met who used vi key binding at the
> command line.
>
Wow. Now I see!
It's only Python. Just add one to indices where appropriate,
I want to add some simple search function for my homepage. It need to
search through all the html files of my homepage (about 300 pages), and
highlight the search words.
I made some test with HTMLParser, it works but slow. So, my question is
how can I improve its speed?
from HTMLParser import HTM
SpreadTooThin wrote:
> J. Clifford Dyer wrote:
>> SpreadTooThin wrote:
>>> Steven D'Aprano wrote:
On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote:
>>> I seems that some of the objects in the list don't get along well with
>>> deep copy..
>>> See my second example post that us
Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes:
> "Robert Brewer" <[EMAIL PROTECTED]> writes:
>> 2. Dynamic languages naturally more lang-maven oriented?
>>See http://osteele.com/archives/2004/11/ides
>
> Not sure what you mean by this, even after reading that (interesting)
> article. The
Can I ask question about zope here?
I started Zserver but could not connect to it using firefox.The runzope
gave message:
/usr/bin/zope/instance/bin/runzope -X debug-mode=on
2006-10-31 12:50:45 INFO ZServer HTTP server started at Tue Oct 31
12:50:45 2006
Hostname: 0.0.0.0
Port: 80
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > Is there any reason not to change the behavior of the indices() method
> > so it gives indices that can be used in range (to give indices
> > corresponding to elements that would be extracted by a given slice)
> > *and* used as arguments for sl
kath wrote:
> Hello, sorry about the lengthy message.
>
> I finding difficult to execute this program. The wx.Notebook i created
> is coming on the splitted frame(self.p2). How do I that. I am started
> to learn wxPython, and when I run the code, the code doesnot close
> gracefully, it throughs m
I am trying to use PIL to add a comment to an image. I have never used PIL
before, but I discovered that it is possible to print an existing comment
with the following:
im = PIL.Image.open('filename.jpg')
print im.app['COM']
I figured that I could write a comment by reversing this procedure:
im
It seems clear that the import lock does not include fully-executing
the module contents. To fix this, just import cookielib before the
threads are spawned. Better yet, use your own locks around the
acquisition of the opener instance (this code seems fraughtfully
thread-unsafe--fix that and you s
Jens Theisen wrote:
> python uses gc only where refcounts alone haven't yet done the
> job. Thus, the following code
> class Foo:
> def __del__(self):
>print "deled!"
... In c++, this is a central technique used for all sorts of tasks,
whereas in garbage collected languages
notejam wrote:
> Thanks everyone for the help. I got a simple two line program to work
> from a text file.
> Can not figure out how to write more than one line in interpreter mode.
> Is that all interpreter is good for, testing one liners? I have it
> run the program everytime I hit return, and
Dear all,
I found this nifty article on how to record your favourite radio show
using cron and mplayer:
http://grimthing.com/archives/2004/05/20/recording-streaming-audio-with-mplayer/
Because I couldn't get the date in the filename (and was too lazy to
look into sh/bash manuals), I decided to us
P.S. I have run 'depends', and all the dll's are there, the only error
its throwing up is:
"Warning: At least one module has an unresolved import due to a missing
export function in a delay-load dependent module."
The offending file is mpr.dll in c:\windows\system32\
Any ideas?
Toby
Toby wrote
Mark Elston <[EMAIL PROTECTED]> writes:
> * James Stroud wrote (on 10/30/2006 4:39 PM):
> > She's the only other person I've ever met who used vi key binding
> > at the command line.
>
> Well, there's your problem. You need to C-x C-f a new mate. :)
I don't have the commitment for that. What if
> notejam wrote:
> Thanks everyone for the help. I got a simple two line program to work
> from a text file.
> Can not figure out how to write more than one line in interpreter mode.
> Is that all interpreter is good for, testing one liners? I have it
> run the program everytime I hit return, an
>I downloaded the Windows exe, ran it and a small blank message window poped
>up and that was it.
> I am still running 2.3.
I assume you mean Python 2.3, not Leo 2.3 :-) I know for sure that Leo
works with Python 2.3. In the future, please report problems to one of Leo's
forums. And when repo
At Monday 30/10/2006 21:15, notejam wrote:
Thanks everyone for the help. I got a simple two line program to work
from a text file.
Can not figure out how to write more than one line in interpreter mode.
Is that all interpreter is good for, testing one liners? I have it
run the program everyt
Try this, assuming you're in IDLE.
http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html
You can enter as many lines as you want in the interpreter. Then press
ENTER twice to get the result.
Or try here if you're looking for some tutorials.
http://tinyurl.com/w7wgp
rd
--
http://mai
At Monday 30/10/2006 20:37, Nick Vatamaniuc wrote:
In Python all the primitives are copied and all other entities are
references.
What do you mean?
primitives==builtin classes?
entities==objects?
In Python, objects are never automatically copied, either builtin or
user-defined. Even 123 is a
* James Stroud wrote (on 10/30/2006 4:39 PM):
> Steve Holden wrote:
>> How could you end up marrying someone who counts from one and not
>> zero? ;-)
>
> She's the only other person I've ever met who used vi key binding at the
> command line.
>
> James
>
>
Well, there's your problem. You ne
Steve Holden wrote:
> How could you end up marrying
> someone who counts from one and not zero? ;-)
She's the only other person I've ever met who used vi key binding at the
command line.
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
ht
Hi, I've managed to get my hands on the ms 2003 toolkit, and have
successfully (i think) created a .pyd file in win xp (setup.py is
provided intersystems cache):
C:\CacheSys\Dev\python>setup.py install
enter directory where you i
J. Clifford Dyer wrote:
> SpreadTooThin wrote:
> > Steven D'Aprano wrote:
> >> On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote:
> >>
> > How do I specify or create deep copies of objects that may contain
> > other objects that may contain other object that may contain other
> >
Thanks everyone for the help. I got a simple two line program to work
from a text file.
Can not figure out how to write more than one line in interpreter mode.
Is that all interpreter is good for, testing one liners? I have it
run the program everytime I hit return, and can not figure out how t
I could use help with my project. It should be very popular when more
of it is done and credit may be a good way to build your resume
https://sourceforge.net/projects/dex-tracker
ArdPy wrote:
> Hi there, these days I am desperately searching everywhere on the
> Internet for part time python job
[EMAIL PROTECTED] writes:
> So, I have a module with an arbitrary file name and I want to load it,
> and later access its function definitions.
> How can I do this ? In my example, the last line will obviously not
> work.
If you want a solution that gives you an actual module object, here's
what
I am not familiar with SQLite driver, but a typical Pythonic way to
check if you can do something is to just try it, and see what happens.
In more practical terms: try to just use the cursor or the connection
and see if an exception will be raised.
Nick V.
John Salerno wrote:
> John Salerno wr
When you use PyDoc,
either with -w to generate a static web page or with -p to run as a web server,
the generated pages have a link in the upper right corner to the source code for
the referenced module. I can never get this link to work. I think
part of the problem is that MS-IE doesn't kn
Alistair King <[EMAIL PROTECTED]> writes:
> heavy = raw_input("\n\n@@\n\nPlease enter the heaviest
> atom for which you obtained percentage values for, but not Oxygen, eg,
> 'C', 'N', 'S', 'Br'...: ")
>
> print DSvalues
>
> def updateDS1v(Fxas, x):
> if Fxas != 0:
> value = DSvalue
Hello, sorry about the lengthy message.
I finding difficult to execute this program. The wx.Notebook i created
is coming on the splitted frame(self.p2). How do I that. I am started
to learn wxPython, and when I run the code, the code doesnot close
gracefully, it throughs me an error.
"pythonw.ex
James Stroud wrote:
> Diez B. Roggisch wrote:
>
>>>Okay, I've googled "leaky abstractions" (as was probably your intended
>>>affect with your silence), read the famous essay, and still
>>>don't know what you mean and how it applies to what I have described.
>>>
>>>Do you plan to justify your state
I think you are afraid of references because you are not trusting your
own code. You are afraid it will do "magic" behind the scenes and mess
everything up. One way around that is to simply write better code and
test often.
If everything was copied when passed around it would be pretty awful --
i
Diez B. Roggisch wrote:
>> Okay, I've googled "leaky abstractions" (as was probably your intended
>> affect with your silence), read the famous essay, and still
>> don't know what you mean and how it applies to what I have described.
>>
>> Do you plan to justify your statement or emptily accuse peo
SpreadTooThin wrote:
> Steven D'Aprano wrote:
>> On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote:
>>
> How do I specify or create deep copies of objects that may contain
> other objects that may contain other object that may contain other
> objects
See the `copy` module
Steven D'Aprano wrote:
> On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote:
>
> >> > How do I specify or create deep copies of objects that may contain
> >> > other objects that may contain other object that may contain other
> >> > objects
> >>
> >> See the `copy` module especially `cop
On Mon, 30 Oct 2006 13:10:47 -0800, SpreadTooThin wrote:
>> > How do I specify or create deep copies of objects that may contain
>> > other objects that may contain other object that may contain other
>> > objects
>>
>> See the `copy` module especially `copy.deepcopy()`.
>>
>
> This appears t
Alistair King wrote:
> have tried:
>
> def monoVarcalc(atom):
> a = atom + 'aa'
> Xaa = a.strip('\'')
> m = atom + 'ma'
> Xma = m.strip('\'')
> global Xma
> global Xaa
> Xaa = DS1v.get(atom)
> Xma = pt.get(atom)
> print Xma
> print Xaa
>
> monoVarcalc('C')
>
notejam wrote:
> I am trying to get started with a interactive version of Python for
> windows and need some help.
> I have played with the tutorial, and now want to write a program.
>
> In basic language, I could write something like
> 10 print "hello"
> 20 print "Jim"
>
> and if I run it I woul
Wojciech Muła wrote:
> Alistair King wrote:
>
>>is there a simple way of creating global variables within a function?
>
>
> def foo(name):
> globals()[name] = "xxx"
> globals()[name + 'aa'] = "yyy"
> globals()[name + 'ab'] = "zzz"
Please note that this is a terrible programmin
"notejam" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am trying to get started with a interactive version of Python for
> windows and need some help.
> I have played with the tutorial, and now want to write a program.
>
> In basic language, I could write something like
> 10 prin
[EMAIL PROTECTED] schrieb:
> I am trying to compile py2.4.3/2.5 on a Solaris 10x86 machine, but
> cannot get it to build an SSL enabled version. I have added the
> relevant sfw directories into the path/crle, with no success. I've
> even explicitly added ssl via the --with-libs directive, yet an
[EMAIL PROTECTED] schrieb:
> Can anyone point me to new location of this version of manual,
> or tell me why this format is no longer supported ... ?
It's on the download page itself:
http://www.python.org/download/releases/2.5/
http://www.python.org/ftp/python/2.5/Python25.chm
Regards,
Martin
-
> How do I do sometihing simple like that in python?
print "hello"
print "Jim"
> How do I enter line numbers, or if none, what do I do.
no line numbers needed
> Can the interpreter load a text file with my program in it?
read in a text file:
data = open("something.txt").read()
> How do I list
[EMAIL PROTECTED] wrote:
> Thanks for your help. Actually my idea was that command1 and command2
> would be defined within the program, not the module, as I would have
> different choices in different programs. Should I pass them in as a
> parameter too?
>
It would seem to be the only way to tell
edit a plain text file, just type one line
print "hello, world"
Now save that one-line text file as "hello.py". From the command line,
in the same directory, type:
python hello.py
And it should run your script. Python doesnt require line numbers.
Happy coding.
--
http://mail.python.org/
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, SpreadTooThin
> wrote:
>
> > I'm really worried that python may is doing some things I wasn't
> > expecting... but lets see...
>
> Expect that Python never copies something if don't ask explicitly for a
> copy.
>
> > if I pass a list to a f
一首诗 wrote:
> Oh, I didn't make myself clear.
>
> What I mean is how to convert a piece of html to plain text bu keep as
> much format as possible.
>
> Such as convert " " to blank space and convert to "\r\n"
>
> Gary Herron wrote:
>
>> 一首诗 wrote:
>>
>>> Is there any simple way to solve thi
On Oct 30, 3:47 pm, John Salerno <[EMAIL PROTECTED]> wrote:
>I noticed that one object you refer to is
> self.textPane, is that supposed to be self.textPanel?
no, self.textPane is the actual wx.TextCtrl.
I used a GUI Builder to the layout stuff...perhaps that's my problem :)
is there a good site
I am trying to get started with a interactive version of Python for
windows and need some help.
I have played with the tutorial, and now want to write a program.
In basic language, I could write something like
10 print "hello"
20 print "Jim"
and if I run it I would get
hello
Jim
How do I do some
We have a GCC in /usr/rcf that was not built with --disable-shared.
As such, there is a /usr/rcf/lib/libgcc_s.so.
We also have a (preferred) GCC in /afs/rcf/lang/gcc/current that
was built with --disable-shared. As such, there is no
/afs/rcf/lang/gcc/current/lib/libgcc_s.so and binaries built
wit
[EMAIL PROTECTED] wrote:
> dakman> This is great! A excellent tutorial for somone who has prior
> dakman> experience in programming and is starting out in python. My
> dakman> friend keeps wanting me to teach him python, I think this would
> dakman> be the perfect link for him.
>
>
abcd wrote:
>> But one question that comes to mind is, do you not add sizerTextPanel to
>> sizerMainPanel? I think all sub-sizers should be added to the main
>> sizer, unless there's some weird reason I don't know of.
>
> well i set the sizer on the textPanel and then I add the textPanel to
> size
> But one question that comes to mind is, do you not add sizerTextPanel to
> sizerMainPanel? I think all sub-sizers should be added to the main
> sizer, unless there's some weird reason I don't know of.
well i set the sizer on the textPanel and then I add the textPanel to
sizerMainPanel
--
http:
[EMAIL PROTECTED] wrote:
> I'm not trying to minimize Jeremy's efforts in any way, but how is his
> tutorial a significant improvement over the original
> (http://www.python.org/doc/current/tut/)?
don't forget the community-enhanced edition over at:
pytut.infogami.com
--
http://mail.pyth
[EMAIL PROTECTED] wrote:
> I'm not trying to minimize Jeremy's efforts in any way, but how is his
> tutorial a significant improvement over the original
> (http://www.python.org/doc/current/tut/)?
It's not intended as a replacement, but what I wanted to do was write a
quick 2 hour course for peop
abcd wrote:
> sizerMainPanel.Add(self.textPanel, 3, wx.ALL|wx.EXPAND, 0)
Your best bet may be to post to [EMAIL PROTECTED]
But one question that comes to mind is, do you not add sizerTextPanel to
sizerMainPanel? I think all sub-sizers should be added to the main
sizer, unless there's s
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, SpreadTooThin
> wrote:
>
> > I'm really worried that python may is doing some things I wasn't
> > expecting... but lets see...
>
> Expect that Python never copies something if don't ask explicitly for a
> copy.
>
> > if I pass a list to a f
On Oct 30, 2:52 pm, John Salerno <[EMAIL PROTECTED]> wrote:
Don't know for sure, but you can try calling the Refresh() method on
the
> text control and see if that fixes it.
Didn't make a difference. Not sure what the problem is, I am wondering
if it is a layout issue since that is my weak spot w
SpreadTooThin wrote:
> I'm really worried that python may is doing some things I wasn't
> expecting... but lets see...
>
> if I pass a list to a function def fn(myList):
>
> and in that function I modify an element in the list, then does the
> callers list get modied as well.
>
> def fn(list):
abcd wrote:
> I have a TextCtrl which is set to be multi-line. I have a function
> say, updateText(msg), which takes some string and appends it to the
> text control...
>
> txtControl.AppendText(msg)
>
> however, if the text that I am appending would cause the scroll
> bars to appear/or scro
John Salerno wrote:
> Is there a way to check if a SQLite connection and cursor object are
> still open? I took a look at the docs and the DB API but didn't see
> anything like this.
>
> Thanks.
Well, I might have somewhat solved this problem. Since SQLite allows you
to use execute* methods di
> Okay, I've googled "leaky abstractions" (as was probably your intended
> affect with your silence), read the famous essay, and still
> don't know what you mean and how it applies to what I have described.
>
> Do you plan to justify your statement or emptily accuse people of violating
> esoteric
I have a TextCtrl which is set to be multi-line. I have a function
say, updateText(msg), which takes some string and appends it to the
text control...
txtControl.AppendText(msg)
however, if the text that I am appending would cause the scroll
bars to appear/or scroll since the text is long th
I am no Python guru - just an ordinary user.
There is nothing "scary" about this. There are (many) situations where
this is actually *desirable* but of course there are (many) situations
where this is an unwelcomed side-effect.
In situations where I don't want this to happen, I simply pass down
On 2006-10-30, SpreadTooThin <[EMAIL PROTECTED]> wrote:
> def fn(list):
>list[1] = 0
>
> myList = [1, 2, 3]
> print myList
> fn(myList)
> print myList
>
[1,2,3]
[1,0,3]
>
> How can I avoid this? In this case this is a really simplified
> example but the effects are the same... How do
In <[EMAIL PROTECTED]>, SpreadTooThin
wrote:
> I'm really worried that python may is doing some things I wasn't
> expecting... but lets see...
Expect that Python never copies something if don't ask explicitly for a
copy.
> if I pass a list to a function def fn(myList):
>
> and in that function
I'm really worried that python may is doing some things I wasn't
expecting... but lets see...
if I pass a list to a function def fn(myList):
and in that function I modify an element in the list, then does the
callers list get modied as well.
def fn(list):
list[1] = 0
myList = [1, 2, 3]
print
Hi Stani,
Not able to reach Berlios. The SourceForge page does not have the
Windows installer. Any ideas when it will be available?
Thanks.
Chris
Bernard wrote:
> thanks Stani!
>
> SPE - Stani's Python Editor wrote:
> > This is a maintenance release (mostly bug fixing) to prove that SPE is
> >
>> os.system("make -C %s" % build_dir)
>> OP specified GNU make, so that works fine, but make sure you're not
>> going to need to use it with another make before settling on that
>> alternative. Frederik's works with more versions of make.
Understood. That was the only reason I
dakman> This is great! A excellent tutorial for somone who has prior
dakman> experience in programming and is starting out in python. My
dakman> friend keeps wanting me to teach him python, I think this would
dakman> be the perfect link for him.
I'm not trying to minimize Jeremy's
[EMAIL PROTECTED] wrote:
> Fredrik> build_dir = "path/to/makefile"
>
> Fredrik> cwd = os.getcwd() # get current directory
> Fredrik> try:
> Fredrik> os.chdir(build_dir)
> Fredrik> os.system("make")
> Fredrik> finally:
> Fredrik> os.chdir(cwd)
>
> Or even:
>
>
Wojciech Muła wrote:
>> is there a simple way of creating global variables within a function?
>
> def foo(name):
> globals()[name] = "xxx"
> globals()[name + 'aa'] = "yyy"
> globals()[name + 'ab'] = "zzz"
that kind of coding is punishable by law in some jurisdictions.
--
ht
一首诗 wrote:
> Is there any simple way to solve this problem?
corresponds to a non-breaking space, chr(160). if you're only
dealing with this specific XML/HTML entity, you can do
text = text.replace(" ", " ")
or
text = text.replace(" ", chr(160))
to handle arbitrary entities and c
On Oct 30, 6:44 pm, "一首诗" <[EMAIL PROTECTED]> wrote:
> Oh, I didn't make myself clear.
>
> What I mean is how to convert a piece of html to plain text bu keep as
> much format as possible.
>
> Such as convert " " to blank space and convert to "\r\n"
>
Then you can explore the parser,
http://doc
[EMAIL PROTECTED] wrote:
> This is great! A excellent tutorial for somone who has prior experience
> in programming and is starting out in python. My friend keeps wanting
> me to teach him python, I think this would be the perfect link for him.
I'm glad you think it is useful. It needs a bit of c
(warning: LONG reply)
thanks to those above for the kind remarks. tackling comments
and questions, not quite in chronological order. :-)
> Who would you say the book is aimed at? Advanced programmers?
this book is targeted towards technical professionals already
literate in another high-level
Alistair King wrote:
> Hi,
>
> is there a simple way of creating global variables within a function?
>
> ive tried simply adding the variables in:
>
> def function(atom, Xaa, Xab):
> Xaa = onefunction(atom)
> Xab = anotherfunction(atom)
>
> if i can give something like:
>
> function('C
This is great! A excellent tutorial for somone who has prior experience
in programming and is starting out in python. My friend keeps wanting
me to teach him python, I think this would be the perfect link for him.
Thanks.
Jeremy Sanders wrote:
> Here is a brief simple introduction to Python I wro
Oh, I didn't make myself clear.
What I mean is how to convert a piece of html to plain text bu keep as
much format as possible.
Such as convert " " to blank space and convert to "\r\n"
Gary Herron wrote:
> 一首诗 wrote:
> > Is there any simple way to solve this problem?
> >
> >
> Yes, strings have
I had to do something like this a while back for a modular IRC bot that
I wrote.
__import__() will do the trick, however to avoid getting a cache of the
module I recomend doing something like...
mod = reload( __import__("%s-%s-%s" % ( t[0], t[1], t[2] ) ) )
[EMAIL PROTECTED] wrote:
> Hi all,
>
>
一首诗 wrote:
> Is there any simple way to solve this problem?
>
>
Yes, strings have a replace method:
>>> s = "abc def"
>>> s.replace(' ',' ')
'abc def'
Also various modules that are meant to deal with web and xml and such
have functions to do such operations.
Gary Herron
--
http://mail.py
Is this what you want?
py> s = 'This string contains two times - end'
py> print s.replace(' ', ' '*6)
This string containstwo times- end
see http://docs.python.org/lib/string-methods.html
On Oct 30, 6:26 pm, "一首诗" <[EMAIL PROTECTED]> wrote:
> Is there any simple way to solve
一首诗 wrote:
> Is there any simple way to solve this problem?
>>> myString = " "
>>> myString = myString.replace(" ", "")
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney wrote:
>
> >>> def obstinate_economist_enumerate(items):
> ... enum_iter = iter((i+1, x) for (i, x) in enumerate(items))
> ... return enum_iter
iter is redundant here.
def natural_enumerate_improvement(items, start=0):
return ((i+start, x) for (i, x) in enumer
Is there any simple way to solve this problem?
--
http://mail.python.org/mailman/listinfo/python-list
Gary Herron wrote:
> Alistair King wrote:
>
>> Hi,
>>
>> is there a simple way of creating global variables within a function?
>>
>>
>>
> Use the "global" statement within a function to bind a variable to a
> global.
>
> See http://docs.python.org/ref/global.html for details.
>
>
>
>
Alistair King wrote:
> is there a simple way of creating global variables within a function?
def foo(name):
globals()[name] = "xxx"
globals()[name + 'aa'] = "yyy"
globals()[name + 'ab'] = "zzz"
--
http://mail.python.org/mailman/listinfo/python-list
Alistair King wrote:
> Hi,
>
> is there a simple way of creating global variables within a function?
>
#module global:
def f(atom):
global a
a=1
globals()[atom+'var']=2
def f():
a=b=1
globals().update(locals())
_global=sys.modules[__name__]
def f(atom):
_global.a = 1
Alistair King wrote:
> Hi,
>
> is there a simple way of creating global variables within a function?
>
>
Use the "global" statement within a function to bind a variable to a
global.
See http://docs.python.org/ref/global.html for details.
>>> def x():
... global g
... g = 12
BartlebyScrivener wrote:
> Found fix for this at Mozilla:
>
> http://kb.mozillazine.org/Default_browser
>
> Apparently, even though it LOOKS and ACTS like Firefox is still your
> default browser after an IE7 upgrade, it's not.
>
> To fix, you must run:
>
> firefox.exe -silent -nosplash -setDefaultB
1 - 100 of 176 matches
Mail list logo