Max M wrote:
> >>> a_hash_is_a_dict = {'key':'value'}
> >>> a_hash_is_a_dict['key2'] = 'value 2'
> >>> a_hash_is_a_dict['key']
> 'value'
Thank you very much.
This is I was looking for :-)
--
http://mail.python.org/mailman/listinfo/python-list
Andrew Trevorrow wrote:
> Surely that's a bug that should be fixed. There should be some way
> to tell Python "release all the memory you've ever allocated and
> start again with a clean slate".
This bug cannot be fixed in any foreseeable future.
> I've been told that the next version of Python
Hi,
I have a scope related question that I haven't been able to find an
answer to anywhere. Is there a way to have a function in an imported
module add variables to the scope of the calling script? Basically,
can I have the following:
#root.py
import some_module.py
some_module.afunction() # <==
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote:
> So another question arise. Is it possible to make function a method (so
> it will receive calling object as first argument)?
Sure, impor types then call types.MethodType:
f = types.MethodType(f, obj, someclass)
(f.__get__ is also fine for Python-c
Michal Kwiatkowski <[EMAIL PROTECTED]> wrote:
...
> The problem is I have an instance of a given class (say BaseClass) and I
> want it to implement some attribute accesses as method calls. I'm not a
> creator of this object, so changing definition of BaseClass or
> subclassing it is not an optio
Alex Martelli <[EMAIL PROTECTED]> wrote:
> John <[EMAIL PROTECTED]> wrote:
>
> > Thanks a lot,
> >
> > This works but is a bit slow, I guess I'll have to live with it.
> > Any chance this could be sped up in python?
>
> Sure (untested code):
>
> def count_with_overlaps(needle, haystack):
>
Hi,
I've got a question about your python license. For the (lgpl'd) kdewin32 -
layer (some unix functions for kdelibs4/win32) I need a mmap implementation.
Can I use your code within kdewin32-lib? I don't think that the resulting
code will contain a lot of similarities with your code (apart from t
flamesrock wrote:
> whats the best way to pop a random item from a list??
import random
def popchoice(seq):
# raises IndexError if seq is empty
return seq.pop(random.randrange(len(seq)))
--Ben
--
http://mail.python.org/mailman/listinfo/python-list
John <[EMAIL PROTECTED]> wrote:
> Thanks a lot,
>
> This works but is a bit slow, I guess I'll have to live with it.
> Any chance this could be sped up in python?
Sure (untested code):
def count_with_overlaps(needle, haystack):
count = 0
pos = 0
while True:
where = haystack.
John wrote:
> This works but is a bit slow, I guess I'll have to live with it.
> Any chance this could be sped up in python?
Sure, to a point. Instead of:
def countoverlap(s1, s2):
return len([1 for i in xrange(len(s1)) if s1[i:].startswith(s2)])
Try this version, which takes smaller sl
"John" <[EMAIL PROTECTED]> writes:
> This works but is a bit slow, I guess I'll have to live with it.
> Any chance this could be sped up in python?
Whoops, I meant to say:
len([1 for i in xrange(len(s1)) if s1.startswith(s2,i)])
That avoids creating a lot of small strings.
If s1 is large you
On Thu, 2006-03-09 at 21:59 -0800, flamesrock wrote:
> Hi,
>
> It's been a while since I've played with python.
>
> My question is... whats the best way to pop a random item from a list??
import random
# ...
item = mylist.pop(random.randint(0,len(mylist)))
--
http://mail.python.org/mailman/l
i'm having some trouble this code which i hope someone can help me with. the
following client side code works correctly if the length of the message being
sent in the POST request is 16384 (1024 * 16) chars or less. if the length of
message is greater than 16384 an
OpenSSL.SSL.SysCallError: (
Thanks a lot,
This works but is a bit slow, I guess I'll have to live with it.
Any chance this could be sped up in python?
Thanks once again,
--j
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
It's been a while since I've played with python.
My question is... whats the best way to pop a random item from a list??
-Thanks
--
http://mail.python.org/mailman/listinfo/python-list
rh0dium wrote:
> Basically there are multiple combinatories here - I was hoping someone
> could point me to a general approach. Writing the actual funtion is
> not necessary - as you pointed out I can certainly do that. Here is my
> problem - I did exactly as you and said OK I can
>
> if Foundry
"John" <[EMAIL PROTECTED]> writes:
> if S1 = ""
> and S2 = "AA"
>
> then the count is 3. Is there an easy way to do this in python?
> I was trying to use the "count" function but it does not do
> overlapping counts it seems.
len([1 for i in xrange(len(s1)) if s1[i:].startswith(s2)])
--
http:
[EMAIL PROTECTED] wrote:
> I could reproduce a memory leak with the code
>
> #include
> int main()
> {
> while(1){
> Py_Initialize();
> PyRun_SimpleString("execfile('foo.py')");
> Py_Finalize();
> }
> }
>
> However, I could not reproduce a memory leak with the code
>
> #include
Hallöchen!
[EMAIL PROTECTED] (Andrew Trevorrow) writes:
> Torsten Bronger <[EMAIL PROTECTED]> wrote:
>
>> [EMAIL PROTECTED] (Andrew Trevorrow) writes:
>>
>>> [...]
>>>
>>> I couldn't get the PyRun_*File* calls to work on Windows,
>>> presumably because of the FILE* problem mentioned in the docs.
I have two strings S1 and S2. I want to know how many times
S2 occurs inside S1.
For instance
if S1 = ""
and S2 = "AA"
then the count is 3. Is there an easy way to do this in python?
I was trying to use the "count" function but it does not do
overlapping counts it seems.
Thanks,
--j
--
ht
Steven Bethard napisał(a):
>> Is there any method of making descriptors on per-object basis?
>
> I'm still not convinced that you actually want to, but you can write
> your own descriptor to dispatch to the instance object (instead of the
> type):
Ok, this works for attributes I know a name of at
Torsten Bronger <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Andrew Trevorrow) writes:
>
> > [...]
> >
> > I couldn't get the PyRun_*File* calls to work on Windows, presumably
> > because of the FILE* problem mentioned in the docs.
>
> Which compiler do you use?
MSVC++ (version 6 from memory
I made a logic error in that. Must be tired :-( Alas, there is no
undo on usenet.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 2006-03-09 at 19:42 -0800, Tuvas wrote:
> Thanks, that's exactly what I wanted!
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
You may also want to check out Pmw (Python Megawidgets)
Pmw has a nifty Prompt Dialog.
See http://pmw.sourceforge.net/doc/PromptDialog.html
Help please with a URLError. Invoking a url that works in Firefox and
IE results in a "urlerror 7, no address ..." in python. I need to debug
why.
Traceback is below. There's a redirect when the url is invoked (it's
part of a chain) - you can see it using liveheaders in firefox. What is
the best w
"Dr. Pastor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Installed Python 2.4.2 on Windows XP.
> Activated IDLE.
> Loaded the following to the Edit window:
> ---
> print "hello world"
> for i in range(10):
> print i,
>
> print "Done"
> ---
> It prints as: 0 1 2 3 4 5 6 7
Michal Kwiatkowski wrote:
> Code below shows that property() works only if you use it within a class.
Yes, descriptors are only applied at the class level (that is, only
class objects call the __get__ methods).
> Is there any method of making descriptors on per-object basis?
I'm still not convi
Thanks, that's exactly what I wanted!
--
http://mail.python.org/mailman/listinfo/python-list
"Dr. Pastor" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Installed Python 2.4.2 on Windows XP.
> Activated IDLE.
> Loaded the following into the Edit window:
> Why I do not get any output?
> Thanks for any guidance.
When you run code from an edit window, IDLE saves the file to
"Tuvas" <[EMAIL PROTECTED]> writes:
> I want to write a GUI program (Preferably in Tkinter) that will allow
> for the entering of passwords, stared out like a normal program does.
> Is that possible? Thanks!
http://blogs.translucentcode.org/oisin/2003/09/04/tkinter_password_entry/
--
http://mail.
Hi,
Code below shows that property() works only if you use it within a class.
class A(object):
pass
a = A()
a.y = 7
def method_get(self):
return self.y
a.x = property(method_get)
print a.x # =>
A.x = property(method_get)
print a.x # =>
BECOME A DOT.COM MILLIONAIREInvest $1,000. Get back up to
$3,000 a day ,$100,000 monthly. for 1 year. Silent Partners. Do no
work.www.vosar.net416-903-5685775-333-1125[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
The parsing is good; the structure can be transformed after the parsing
is done.
The basic problem with the "reverse lookup" search is that you need to
iterate over lots of things. If you're only doing one search, that's
not too horrible But if you're going to perform multiple searches, you
can
Thank you! I can see only your reply.
But indeed google prints three.
The mind boggles.
Nick Smallbone wrote:
> Dr. Pastor wrote:
>
>>Any reply?
>>
>
>
> ahem. three replies, when i counted:
> http://groups.google.com/group/comp.lang.python/browse_frm/thread/ab0c8455251e616c/
>
--
http://ma
[EMAIL PROTECTED] wrote:
>> Can I make an executable with just the standard distribution, or do I
>> need a separate module?
>
> Check out py2exe: http://www.py2exe.org/
>
Thanks. Been meaning to look into that one anyway, now I get a chance. :)
--
http://mail.python.org/mailman/listinfo/python
Many thanks to you all.
--
http://mail.python.org/mailman/listinfo/python-list
Hey thanks - OK how would you arrange the data structure? I think that
is my problem - I can arrange in any order - I just want something
which makes sense - this "seemed" logical but can you point me in a
better method.. Basically I am parsing a directory structure:
TECHROOT/
130nm/
ts
pyregex is a command line tools for constructing and testing Python's
regular expression. Features includes text highlighting, detail break
down of match groups, substitution and a syntax quick reference. It is
released in the public domain.
Screenshot and download from
http://tungwaiyip.info/soft
"André" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Terry Reedy wrote:
>> It appears that s[i:j:-1] is s[(j+1):(i+1)] .reverse()'ed. For
>> 'numbers',
>> this is 10, 9, 8, 7, 6, 5, 4, 3, 2]. Then take every other item. Why
>> the
>> +1? Don't know and not my intuitive expe
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> I write a lot of code that looks like this:
>
> for myElement, elementIndex in zip( elementList,
> range(len(elementList))):
> print "myElement ", myElement, " at index: ",elementIndex
>
>
> My question is, is there a better, clean
Thanks!!
I got all of this. The problem that I was trying to figure out was
this.
Basically there are multiple combinatories here - I was hoping someone
could point me to a general approach. Writing the actual funtion is
not necessary - as you pointed out I can certainly do that. Here is my
pr
Russ wrote:
> I'd like to get output formatting for my own classes that mimics the
> built-in output formatting. For example,
>
>
x = 4.54
print "%4.2f" % x
>
> 4.54
>
> In other words, if I substitute a class instance for "x" above, I'd
> like to make the format string apply to an elem
Here's the illegible gibberish version of your function. Once you
understand completely the following line of code, you will be well on
your way to Python nirvana:
getNodes = lambda Foundry=None,Process=None: [node for node,foundries
in dict.iteritems() if ((Foundry is None) and ((Process is None
I'd like to get output formatting for my own classes that mimics the
built-in output formatting. For example,
>>> x = 4.54
>>> print "%4.2f" % x
4.54
In other words, if I substitute a class instance for "x" above, I'd
like to make the format string apply to an element or elements of the
instance.
On Thu, 2006-03-09 at 15:51 -0800, rh0dium wrote:
> Hi all,
>
> I have a dict which looks like this..
>
> dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']},
> '180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc':
> ['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']},
> '250nm': {'umc': ['2p6m_1.8-3.
"Steve Holden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
This thread was great entertainment at the end of today reading down the
screen with a beer going down on the side. Here's my penny's worth:
Over this side of the pond the good old British Post Office changed its name
[EMAIL PROTECTED] wrote:
> I write a lot of code that looks like this:
>
> for myElement, elementIndex in zip( elementList,
> range(len(elementList))):
> print "myElement ", myElement, " at index: ",elementIndex
>
>
> My question is, is there a better, cleaner, or easier way to get at the
>
[EMAIL PROTECTED] wrote:
> I write a lot of code that looks like this:
>
> for myElement, elementIndex in zip( elementList,
> range(len(elementList))):
> print "myElement ", myElement, " at index: ",elementIndex
>
>
> My question is, is there a better, cleaner, or easier way to get at the
>
Dr. Pastor wrote:
> Any reply?
>
ahem. three replies, when i counted:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/ab0c8455251e616c/
--
http://mail.python.org/mailman/listinfo/python-list
I write a lot of code that looks like this:
for myElement, elementIndex in zip( elementList,
range(len(elementList))):
print "myElement ", myElement, " at index: ",elementIndex
My question is, is there a better, cleaner, or easier way to get at the
element in a list AND the index of a loop t
>Installed Python 2.4.2 on Windows XP.
>Activated IDLE.
>Loaded the following to the Edit window:
>---
>print "hello world"
>for i in range(10):
> print i,
>
>print "Done"
>---
>It prints as: 0 1 2 3 4 5 6 7 8 9 Done
>Should not Done be printed on a new line alone?
>Thanks for any guidance
Python is a friendly name, like Mickey Mouse. If you saw a real mouse
(or worse, a rat), you wouldn't likely fall in love with it; but Mickey
is about as good a marketing icon as any in history.
Python also has staying power. Snakes may be scary and even dangerous,
but they get respect; think abou
[EMAIL PROTECTED] wrote:
>> nested and hided inside a class.
>
> Hidden, sorry :-)
>
>
>> Can a "sub-function" be called directly from outside the defining function?
No, and each call to scramble_text defines a new function "scramble".
Further, there is no way to unit test "scramble".
--Scott D
> I agree that names are very important -- Java would never have caught
> on the way that it did if Sun had left the name as "Oak". I think
> you're wrong about the name "Python", though. Snakes are cool and
> have street cred. That's why there are cars with names like "Cobra"
> and "Viper".
>
>
Konrad Mühler wrote:
> Hi,
>
> are there predefinded chances to use hashtables in python? How can I use
> Hashtable in python? Or do I have to implement this on my own?
>
> Thanks
A Java Hashtable/Hashmap is equivalent to a Python dictionary, which is
a builtin objects (and not a second-class c
Dr. Pastor wrote:
> Installed Python 2.4.2 on Windows XP.
> Activated IDLE.
> Loaded the following to the Edit window:
> ---
> print "hello world"
> for i in range(10):
> print i,
>
> print "Done"
> ---
> It prints as: 0 1 2 3 4 5 6 7 8 9 Done
> Should not Done be printed on a new line al
On Thu, 09 Mar 2006 20:21:59 +0100
Magnus Lycka <[EMAIL PROTECTED]> wrote:
> It's not too late to rename the cheese shop though.
> (We don't need even more stink...)
I love cheese, so no problem on that score. But the
problem is, if you actually know where "Python" comes
from, you are likely to su
On 9 Mar 2006 07:21:00 -0800
"msoulier" <[EMAIL PROTECTED]> wrote:
> > (and if you don't, you can quickly comment out regions
> > by putting them inside a triple-quoted string.)
>
> Although that will use up memory, as opposed to a comment.
Not really. Unless it is the first string in the block
(
Any reply?
Dr. Pastor wrote:
> Installed Python 2.4.2 on Windows XP.
> Activated IDLE.
> Loaded the following into the Edit window:
> ---
> # dates are easily constructed and formatted (Tutorial 10.8)
>
> from datetime import date
> now = date.today()
> now
>
> now.strftime("%m-%d-%y. %d %b %Y i
Installed Python 2.4.2 on Windows XP.
Activated IDLE.
Loaded the following to the Edit window:
---
print "hello world"
for i in range(10):
print i,
print "Done"
---
It prints as: 0 1 2 3 4 5 6 7 8 9 Done
Should not Done be printed on a new line alone?
Thanks for any guidance.
--
http://
Hi all,
I have a dict which looks like this..
dict={'130nm': {'umc': ['1p6m_1.2-3.3_fsg_ms']},
'180nm': {'chartered': ['2p6m_1.8-3.3_sal_ms'], 'tsmc':
['1p6m_1.8-3.3_sal_log', '1p6m_1.8-3.3_sal_ms']},
'250nm': {'umc': ['2p6m_1.8-3.3_sal_ms'], 'tsmc':
['1p6m_2.2-3.5_sal_log', '1p6m_1.8-3.3_sal_ms'
In <[EMAIL PROTECTED]>, david.humpherys
wrote:
> how can i copy text to the linux clipboard?
>
> I've seen a number of posts explain how to do it with tk
> is this the only way?
>
> (i'm not using tk as my gui tool kit.)
So what are you using instead?
Ciao,
Marc 'BlackJack' Rintsch
"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ben Cartwright wrote:
>> BartlebyScrivener wrote:
>>> What about a console beep? How do you add that?
>>>
>>> rpd
>>
>> Just use ASCII code 007 (BEL/BEEP):
>>
>> >>> import sys
>> >>> sys.stdout.write('\007')
>>
>> O
A new version of the Python config module has been released.
What Does It Do?
The config module allows you to implement a hierarchical configuration
scheme with support for mappings and sequences, cross-references
between one part of the configuration and another, the ability to
f
> HTMLTemplate + ElementTree works for me too. Additionally I use CSS
> (Cascading Style Sheets) to add style (e.g. fonts, colors and spacing). The
> CSS also allows for different styles for display/print (e.g. not printing
> menus). If you want to see artistic CSS google for "css Zen Garden" .
>
Thanks for the links, especially for the pure Python implementation.
That provides a good model for similar classes.
I am just wondering why your implementation of complex numbers does not
have "assignment operators" such as "__iadd", etc.
By the way, I suppose my original post (where I wrote, "
>Can I make an executable with just the standard distribution, or do I
>need a separate module?
Check out py2exe: http://www.py2exe.org/
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
On Thu, 09 Mar 2006 09:20:17 -0800, Russ wrote:
> "Why don't you show us your complex class?"
>
> Because I don't have a complex class. I merely used the complex class
> as an example to test the referencing behavior. Please read more
> carefully next time.
Or why don't you explain yourself more
Jarek Zgoda wrote:
> I use HTMLTemplate + ElementTree combo to generate static HTML documents
> from data in XML files. Other way might be using "object oriented XSL",
> as ll-xist is often advertized.
HTMLTemplate + ElementTree works for me too. Additionally I use CSS
(Cascading Style Sheets) to
Sullivan WxPyQtKinter a écrit :
> Hi, everyone. Simply put, what I need most now is a python lib to
> generate simple HTML.
>
> I am now using XML to store my lab report records. I found python
> really convinient to manipulate XML, so I want to make a small on-line
> CGI program to help my colle
"mh" wrote:
> So on most modules I import, I can access the .__file__ attribute to
> find the implementation. ie:
> >>> import time
> >>> time.__file__
> '/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'
> >>> import socket
> >>> socket.__file__
> '/data1/virtualpython/lib/python2.3/
On Thu, Mar 09, 2006 at 02:04:45PM -0800, mh wrote:
> So on most modules I import, I can access the .__file__ attribute to
> find the implementation. ie:
> >>> import time
> >>> time.__file__
> '/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'
> >>> import socket
> >>> socket.__file__
Kay Schluehr wrote:
>
> This evening we talked at the Hofbraeuhaus at Munich about Michelangelo
> whose sixtine chapel images where once overpainted because his figures
> appeared naked "as god created them".
That's why Michelangelo didn't design the new Python web site: because
Google wouldn't
On Thu, 09 Mar 2006 15:45:13 +, Duncan Booth wrote:
> Like it or not, Python uses exceptions for normal loop flow control. That's
> a fact of life, live with it: every normal termination of a for loop is an
> exception. Real exceptions don't get masked: for loops terminate with
> StopIterat
Well, now that I can time my laundry, I need to make it runnable. I
tried looking for info on the freeze module in the help file, but it
didn't seem to come up with much. According to the Python wiki, freeze
is for making executables for Unix.
Can I make an executable with just the standard dis
So on most modules I import, I can access the .__file__ attribute to
find the implementation. ie:
>>> import time
>>> time.__file__
'/data1/virtualpython/lib/python2.3/lib-dynload/timemodule.so'
>>> import socket
>>> socket.__file__
'/data1/virtualpython/lib/python2.3/socket.pyc'
This doesn't wor
On Thu, 09 Mar 2006 13:44:25 +0100, bruno at modulix wrote:
> Steven D'Aprano wrote:
> (snip)
>
>> I say "think you want" because I don't know what problem you are trying to
>> solve with this messy, self-referential, piece of code.
>
> This messy piece of code is mine, thanks !-)
You're welcom
On Thu, 09 Mar 2006 13:23:22 +0100, Brian Elmegaard wrote:
> Steven D'Aprano <[EMAIL PROTECTED]> writes:
>
>> Can you explain more carefully what you are trying to do? If you want the
>> square of the maximum value, just do this:
>
> I want to get the value of another attribute of the instance w
Sullivan WxPyQtKinter wrote:
> Hi, everyone. Simply put, what I need most now is a python lib to
> generate simple HTML.
>
> I am now using XML to store my lab report records. I found python
> really convinient to manipulate XML, so I want to make a small on-line
> CGI program to help my colleag
That lib can help.
But still, I have to code a lot using that lib. Maybe my program is
quite strange, far from common.
Thank you, after all~!
--
http://mail.python.org/mailman/listinfo/python-list
Hashtables (dictonaries) and ArrayLists(lists) are integral parts of
modern languages (for example: Python, Ruby, OCaml, D). They are
builtin data types unlike say, Java or C++, where they are added to the
library as an afterthought.
--
http://mail.python.org/mailman/listinfo/python-list
Sorry I am completely a green-hand in HTML. What is HTMLTemplate and
ElementTree? Would you please post some source code as an example?
Of course I would Google them to find out more.
Thank you so much.
--
http://mail.python.org/mailman/listinfo/python-list
Sullivan WxPyQtKinter wrote:
> Hi, everyone. Simply put, what I need most now is a python lib to
> generate simple HTML.
>
> I am now using XML to store my lab report records. I found python
> really convinient to manipulate XML, so I want to make a small on-line
> CGI program to help my colleagu
Sullivan WxPyQtKinter napisał(a):
> Hi, everyone. Simply put, what I need most now is a python lib to
> generate simple HTML.
>
> I am now using XML to store my lab report records. I found python
> really convinient to manipulate XML, so I want to make a small on-line
> CGI program to help my co
> Will XSTL be useful? Is my problem somewho related with XML-SIG?
> Looking forward to your precious suggestion.
>
XSLT is powerful but a royal pain in the arse. Just writing some Python
to generate your HTML would probably be a lot easier for you.
--
Michael McGlothlin, tech monkey
Tub Monk
> nested and hided inside a class.
Hidden, sorry :-)
>Can a "sub-function" be called directly from outside the defining function?
I don't think you can access a nested function in a clean&nice way (and
you can nest classes too, etc). With a little of Python magic maybe
there is a way to do it..
Felipe Almeida Lessa wrote:
> Em Qui, 2006-03-09 às 09:51 +, Steve Holden escreveu:
>
>>I've been thinking (and blogging) about python evangelism since PyCon,
>>as a result of which I created a squidoo lens:
>>
>> http://www.squidoo.com/pythonlogy
>>
>>Imagine my surprise at discovering tha
[EMAIL PROTECTED] schrieb:
> popS = string.join(pop.readlines())
Why not popS = pop.read()?
> The output from the second popen is:
>
> SNMPv2-SMI::enterprises.9.9.168.1.2.1.1.13.51858 = Hex-STRING: 00 00 00
> 26
>
>
> I need to get the Hex-STRING into the following format: 0.0038
Hi, everyone. Simply put, what I need most now is a python lib to
generate simple HTML.
I am now using XML to store my lab report records. I found python
really convinient to manipulate XML, so I want to make a small on-line
CGI program to help my colleagues to build their lab report records
into
This is different too, but maybe a little better than my last version:
from random import shuffle
from itertools import groupby
def scramble_text(text):
"""Return the words in input text string scrambled,
except for the first and last letter."""
def scramble(word):
if len(word
Douglas Alan wrote:
> Ruby didn't start catching on until Ruby on Rails came out. If Python
> has a naming problem, it's with the name of Django, rather than
> Python. Firstly, Django doesn't have "Python" in the name, so it
> doesn't popularize the language behind it, even should Django become
>
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Window's command processor doesn't recognise single quote marks as
> meaning anything special, so your command is passing 4 separate arguments
> to timeit.py instead of the 1 argument that a unix shell would be passing.
>
Magnus Lycka wrote:
> I want an re that matches strings like "21MAR06 31APR06 1236",
> where the last part is day numbers (1-7), i.e it can contain
> the numbers 1-7, in order, only one of each, and at least one
> digit. I want it as three groups. I was thinking of
>
> r"(\d\d[A-Z]\d\d) (\d\d[A-Z]
Robert Boyd wrote:
> And re Cheeseshop, yes, it's a poor name when you consider that the
> point of the skit was that the cheeseshop _had no cheese_, whose only
> purpose was to "deliberately waste your time." Not a great name for a
> package library, especially for those in the know of Python humo
[EMAIL PROTECTED] wrote:
> My version is similar to Just one:
>
> from random import shuffle
>
> def scramble_text(text):
> """Return the words in input text string scrambled
> except for the first and last letter."""
> def scramble_word(word):
Nice. You can have functions inside funct
[EMAIL PROTECTED] wrote:
> Just:
>> [previous post, hand inserted]
>>> def scramble_text(text):
>>> def scramble_word(word):
>>
>> Btw. I find the use of a nested function here completely bogus: you
>> don't need the surrounding scope.
>
> I don't agree, nested functions are useful to better st
Just wrote:
> In article <[EMAIL PROTECTED]>,
> Pedro Graca <[EMAIL PROTECTED]> wrote:
>
[snip: very un-pythonic code]
>
> def curious(text):
> """ Return the words in input text scrambled except for the
> first and last letter. """
> new_text = ""
> word = ""
>
When I call:
pythoncom.PumpMessages()
...it blocks at that line. According to the docs, it says it will run
until it receives a WM_QUITso I try to create a separate thread and
do
import win32api
win32api.PostQuitMessage()
...but the code is still blocking at PumpMessages. Any ideas? othe
When I call:
pythoncom.PumpMessages()
...it blocks at that line. According to the docs, it says it will run
until it receives a WM_QUITso I try to create a separate thread and
do
import win32api
win32api.PostQuitMessage()
...but the code is still blocking at PumpMessages. Any ideas? othe
1 - 100 of 270 matches
Mail list logo