Thanks for providing me with all those informative links about NLTK nad
CNL. I'll certainly look into it.
--
http://mail.python.org/mailman/listinfo/python-list
Hugh Macdonald wrote:
PyMethodDef *callbackFunctionDef = new PyMethodDef;
callbackFunctionDef-ml_name = doLoadCallback;
callbackFunctionDef-ml_meth = myPython_doLoadCallback;
callbackFunctionDef-ml_flags = 1;
I think this gives a memory leak. I was rather thinking of
static
On 7/13/05, Jorey Bump [EMAIL PROTECTED] wrote:
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
The larch!
IT'S A TREE
... not a shrubbery?
--
http://mail.python.org/mailman/listinfo/python-list
Thomas Lotze wrote:
It's definitely no help that file-like objects are iterable; I do want
to get a character, not a complete line, at a time.
Hi,
if i did understand what you mean, what about using mmap? Iterating over
characters in a file like this:
# -*- coding: iso-8859-1 -*-
import os
Steven Bethard [EMAIL PROTECTED] writes:
$ python -m timeit for x in (i for i in xrange(10)): y = x
10 loops, best of 3: 4.75 usec per loop
Yowza! One of the features I really liked in Perl has shored Python island
somewhere in the 2.4'ies, it seems[1]. Thanks for the tip!
PS. In case it
Suppose one wants to fetch the following data from given network interface,
say, eth0:
Ethinf('eth0').addr()
'192.168.1.42/24'
Ethinf('eth0').route('default')
'192.168.1.1'
Ethinf('eth0').duplex()
'full'
Ethinf('eth0').speed()
100
Some statistics:
Ethstat('eth0').rx_bytes()
14325235341223
Thomas Lotze wrote:
I think I need an iterator over a string of characters pulling them out
one by one, like a usual iterator over a str does. At the same time the
thing should allow seeking and telling like a file-like object:
from StringIO import StringIO
class frankenstring(StringIO):
Alex Dempsey wrote:
Recently I tried to slice every element of a list of strings. First I tried:
f = open(export.xls, r)
http://www.python.org/doc/2.4.1/lib/module-csv.html
(snip, see other posts in this thread)
--
bruno desthuilliers
python -c print '@'.join(['.'.join([w[::-1] for w in
Thanks for making me aware of the security loophole of the web app i am
planning.
Godwin Burby
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen [EMAIL PROTECTED] writes:
first make it work, then make it right, then make it fast
...
The expression describes (most recently, if not originally) the practice in
Test-Driven Development (TDD) of making your code pass the test as quickly as
possible, without worrying about how
Am Montag, den 04.07.2005, 20:25 -0400 schrieb Roy Smith:
Steven D'Aprano [EMAIL PROTECTED] wrote:
Should we *really* be encouraging newbies to mess with globals() and
locals()? Isn't that giving them the tools to shoot their foot off before
teaching them how to put shoes on?
Why risk
Am Montag, den 04.07.2005, 15:36 -0400 schrieb Jeffrey Maitland:
Hello all,
Ok, first thing to consider is that time.sleep in Python does in reality
(on Debian Linux, Python2.3) a select syscall with 3 NULLs to wait the
time. (The real sleep POSIX call might have stupid interactions with
Am Dienstag, den 05.07.2005, 08:37 -0700 schrieb Jonathan Ellis:
In many ways, Python is an incredibly bad choice for deeply
multithreaded applications. One big problem is the global interpreter
lock; no matter how many CPUs you have, only one will run python code
at a time. (Many people
Am Donnerstag, den 07.07.2005, 22:56 + schrieb Grant Edwards:
Oh. I assumed that CPython used Posix threads on Posix
It does.
platforms. At least in my experience under Linux, libpthread
always creates an extra manager thread. Though in our case
It probably does. But it will probably
Am Mittwoch, den 06.07.2005, 04:00 + schrieb Dennis Lee Bieber:
{I'm going to louse up the message tracking here by pasting part of
your
follow-up into one response}
2 Upon further thought, that just can't be the case. There has
2 to be multiple instances of the intepreter because the
Am Mittwoch, den 06.07.2005, 14:38 + schrieb Grant Edwards:
Unfortunately that means you've got to debug a number cruncher
that's written in C.
If one is careful, one can use Pyrex :)
Andreas
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
--
Am Mittwoch, den 06.07.2005, 12:27 -0700 schrieb Jonathan Ellis:
Your sarcasm is cute, I suppose, but think about it for a minute. If
the opposite of what I assert is true, why would even the mainstream
press be running articles along the lines of multicore CPUs mean
programming will get
Bengt Richter wrote:
lotzefile.py --
Thanks.
[...]
byte = self.buf[self.pos]
This is the place where the thing is basically a str whose items are
accessed as sequence elements. It has some iterator behaviour and file
management
Dear all,
Is there any php equivalent
move_uploaded_file($source_path, $upload_dir/$name);
function in python to
upload a file to server? Kindly give me
answer.
regards
Prabahar
__
How much free photo storage do
Where I could find the TWAIN python interface ? I'm quite interested :)12 Jul 2005 08:44:49 -0700, Peter Herndon [EMAIL PROTECTED]:
Document Management Software is a little vague.What do you want itto do?In general though, when someone says content management and
Python, the general response is
Roland Heiber wrote:
class MmapWithSeekAndTell(object):
def __init__(self, m, size):
.. where m is a mmap-object and size the filesize ... sorry.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I have written simple code using DocXMLRPCServer. How do I log method
name on the console after invoking registered
method on server. On the console it just prints message as [hostname -
date/time and POST /RPC2 HTTP/1.0 200 -]
code is:
from DocXMLRPCServer import DocXMLRPCServer
def
Tim Peters [EMAIL PROTECTED] writes:
[Michael Hudson]
I doubt anyone else is reading this by now, so I've trimmed quotes
fairly ruthlessly :)
Damn -- there goes my best hope at learning how large a message gmail
can handle before blowing up wink. OK, I'll cut even more.
Heh.
Hiho,
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y', 200)))
the right way to have it executed?
If dothat is def'd in another module:
3.
All your **kwargs are belong to us.
*args is documented in the Tutorial. I reckon **kwargs represents a
dictionary of arguments. But I don't quite get the semantics of **x.
Undefined length tuple of undefined length tuples? Are there other
practical use cases for ** (common enough please, I
Francois De Serres wrote:
Hiho,
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Not the best (not at all) but one way:
def dothat(x,y):
print Called with:, x, y
c = (1,2)
locals().get(dothat)(*c)
Called with: 1 2
Francois De Serres wrote:
All your **kwargs are belong to us.
*args is documented in the Tutorial. I reckon **kwargs represents a
dictionary of arguments. But I don't quite get the semantics of **x.
Undefined length tuple of undefined length tuples? Are there other
practical use cases
Roland Heiber wrote:
Francois De Serres wrote:
Hiho,
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Not the best (not at all) but one way:
Still pretty interesting, thx.
def dothat(x,y):
print Called with:, x, y
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
I'm interested in various metadata
extraction/prosessing/distribution/something tools(including ways of
differentiating between files, eg hashing etc) and especially python
enabled ones. I'm also considering content-recognition/differentiating
eg.
Roland Heiber wrote:
Not the best (not at all) but one way:
def dothat(x,y):
print Called with:, x, y
c = (1,2)
locals().get(dothat)(*c)
As you say, not the best, but in fact not really advisable under any
circumstances. locals() returns module level stuff only when executed
_at_
Francois De Serres wrote:
All your **kwargs are belong to us.
*args is documented in the Tutorial. I reckon **kwargs represents a
dictionary of arguments. But I don't quite get the semantics of **x.
Undefined length tuple of undefined length tuples? Are there other
practical use cases
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y', 200)))
the right way to have it executed?
If dothat is
Peter Hansen wrote:
Francois De Serres wrote:
*args is documented in the Tutorial. I reckon **kwargs represents a
dictionary of arguments. But I don't quite get the semantics of **x.
Undefined length tuple of undefined length tuples? Are there other
practical use cases for ** (common
praba kar enlightened us with:
Is there any php equivalent move_uploaded_file($source_path,
$upload_dir/$name); function in python to upload a file to server?
move_uploaded_file does NOT upload a file to a server.
Kindly give me answer.
Kindly ask answerable question.
Sybren
--
The problem
Normally when I want to do what you describe I want to
do it for several functions not just a single one.
You can use a dictionary to hold the function names and
pointers to the functions themselves and then call them
by indexing into the dictionary. This works for me:
def dothat(x,y):
print
Jorey Bump wrote:
Monty Python's Flying Circus used to begin with It's... I had read at one
time that It's was one of the original names proposed for the
troupe/show, although I can't seem to find verification.
In fact, one of the titles of the show was 'It's', so he must have been
in
Peter Hansen wrote:
Roland Heiber wrote:
Not the best (not at all) but one way:
def dothat(x,y):
print Called with:, x, y
c = (1,2)
locals().get(dothat)(*c)
As you say, not the best, but in fact not really advisable under any
circumstances. locals() returns module level stuff
Duncan Booth wrote:
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y', 200)))
the right way to have it executed?
Michael Hoffman wrote:
Peter Hansen wrote:
Francois De Serres wrote:
*args is documented in the Tutorial. I reckon **kwargs represents a
dictionary of arguments. But I don't quite get the semantics of **x.
Undefined length tuple of undefined length tuples? Are there other
Hi all,
I am writing a script to visualize (and print)
the web references hidden in the html files as:
'a href=web reference underlined reference/a'
Optimizing my code, I found that an essential step is:
splitting on a word (in this case 'href').
I am asking if there is some alternative (more
I ended up using this code to solve my problem.
for a, b, c, d in s:
if not query.has_key((a,b)): query[(a,b)] = []
query[(a,b)].append(%s=%s % (c, d))
for (a,b), v in query.items():
print a, b, , .join(v)
I'm relatively new to python/programming in general. I usually write
in php
Peter Hansen wrote:
locals().get(dothat)(*c)
This was just meant as a quick example, not as production-level code ;)
Even with globals(), I think its a bit odd ..., but safer than using
eval() ...
HtH, Roland
--
http://mail.python.org/mailman/listinfo/python-list
Francois De Serres wrote:
Hiho,
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y', 200)))
the right way to have it executed?
If dothat is
[EMAIL PROTECTED] wrote:
Hi all,
I am writing a script to visualize (and print)
the web references hidden in the html files as:
'a href=web reference underlined reference/a'
Optimizing my code, I found that an essential step is:
splitting on a word (in this case 'href').
I am asking if
On Wed, 13 Jul 2005 06:16:54 -0700, Robert Kern wrote:
Duncan Booth wrote:
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
[snip]
No, none of this is a good place to use eval.
[snip]
import
Aloha,
Thomas Lotze wrote:
I think I need an iterator over a string of characters pulling them out
one by one, like a usual iterator over a str does. At the same time the
thing should allow seeking and telling like a file-like object:
f = frankenstring(0123456789)
for c in f:
... print c
Francois De Serres wrote:
Sorry, I was unclear about the fact that the args are formals. I'm
trying to do something like:
func = dothat
args = ('x','y')
localcontext = ()
r = None
while r is None:
try:
r = eval(dothat(x,y), None, localcontext) #how do I construct
Steven D'Aprano wrote:
On Wed, 13 Jul 2005 06:16:54 -0700, Robert Kern wrote:
Duncan Booth wrote:
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
[snip]
No, none of this is a
Duncan Booth wrote:
Francois De Serres wrote:
Sorry, I was unclear about the fact that the args are formals. I'm
trying to do something like:
func = dothat
args = ('x','y')
localcontext = ()
r = None
while r is None:
try:
r = eval(dothat(x,y), None, localcontext) #how do I
a good text indexer will help, look at lupy, pyndex, xapian etc
http://www.pypackage.org/packages/python-pyndex
http://www.divmod.org/Home/Projects/Lupy/
--
http://mail.python.org/mailman/listinfo/python-list
[rbt]
What is the appropriate way to break out of this while loop if the for
loop finds a match?
while 1:
for x in xrange(len(group)):
try:
mix = random.sample(group, x)
make_string = ''.join(mix)
n = md5.new(make_string)
match
On Wed, 13 Jul 2005 06:19:54 -0700, qwweeeit wrote:
Hi all,
I am writing a script to visualize (and print)
the web references hidden in the html files as:
'a href=web reference underlined reference/a'
Optimizing my code,
[red rag to bull]
Because it was too slow? Or just to prove what a
Requirement
==
A JAVA Server(RMI Sever) has to invoke some Python scripts.
These Python scripts in turn have to make some JAVA API calls. The JAVA APIs
will be provided by custom Java Classes and Interfaces.
I should be able to receive the Output from the Python script into my JAVA
Roland Heiber wrote:
Even with globals(), I think its a bit odd ..., but safer than using
eval() ...
Some would agree and claim that using an import is better:
c = (1, 2)
thisModule = __import__(__name__)
func = getattr(thisModule, 'dothat')
func(*c)
I don't generally find that more readable
praba kar wrote:
Is there any php equivalent
move_uploaded_file($source_path, $upload_dir/$name);
function in python to
upload a file to server?
As this is a Python forum, most will not know PHP. Perhaps describing
what you want in plain English would be more effective in getting
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
aaca
aaac
...
What is the most efficient way to do this?
--
http://mail.python.org/mailman/listinfo/python-list
Jacob Page wrote:
Oye, there's quite a number of set and frozenset features that aren't
well-documented that I now need to implement. What a fun chore!
It would be a great help if you could submit appropriate documentation
patches for the areas you don't think are well-documented:
Edvard Majakari wrote:
Steven Bethard [EMAIL PROTECTED] writes:
$ python -m timeit for x in (i for i in xrange(10)): y = x
10 loops, best of 3: 4.75 usec per loop
Yowza! One of the features I really liked in Perl has shored Python island
somewhere in the 2.4'ies, it seems[1]. Thanks for
On Wed, 13 Jul 2005 10:21:19 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
aaca
aaac
...
What is the most efficient way to do this?
i'll be straight with you and say that this is a homework assignment.
ive tried to figure it out on my own but am now out of time.
i need to go through a .txt file and get rid of all punctuation. also,
every time i see the work Fruitloops=1 or Hamburgers=x where x is
ANY number i need to get rid
On Thu, 2005-07-14 at 00:47 +1000, Steven D'Aprano wrote:
On Wed, 13 Jul 2005 10:21:19 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
im looking for some advice regarding DNS lookup using python
is it possible to give parameters like the IP of a DNS server and the
DNS query to a python program and obtain the response from the DNS
server ?
please reply if u hav some idea or interest
laksh
--
hey, i have this huge text file and i need to go through and remove all
punctuation and every instance of the phrase fruitloops=$ where $ is
any number 0-100 um, and yeah this is homework but i've tried to no
avail. thanks guys. cheerio :). jen
--
Use .replace function to replace punctuation (you didn't say
exactly what that means but just to get you started):
#
# Extend this list as needed
#
punctuations=',.;:()'
#
# Open input and output files
#
ifp=open(inputfilename,'r')
ofp=open(outputfilename,'w')
#
# Strip out the punctuation
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
aaca
aaac
...
What is the most efficient way to do this?
On 13 Jul 2005 07:49:02 -0700, Michael Jordan [EMAIL PROTECTED] wrote:
hey, i have this huge text file and i need to go through and remove all
punctuation and every instance of the phrase fruitloops=$ where $ is
any number 0-100 um, and yeah this is homework but i've tried to no
avail.
George What 'magic' ? The (x,y,z) notation is used only for 3D
George vectors. (x,y) is also common for 2D and perhaps (t,x,y,z) for
George 4D, with t for time.
Don't forget (w,x,y,z) for quaternions...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 13 Jul 2005 10:39:41 -0400, rbt wrote:
What is the most efficient way to do this?
Efficient for who? The user? The programmer? The computer? Efficient use
of speed or memory or development time?
The CPU
Ah, then that's easy. Sit down with pencil and paper, write out all 64
On 13 Jul 2005 07:44:41 -0700, laksh [EMAIL PROTECTED] wrote:
im looking for some advice regarding DNS lookup using python
is it possible to give parameters like the IP of a DNS server and the
DNS query to a python program and obtain the response from the DNS
server ?
Not using the built-in
On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
On Wed, 13 Jul 2005 11:09:25 -0400, rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
[snip]
Expanding this to 4^4 (256) to test the
rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
aaca
aaac
...
What is the most efficient way to do this?
Francois De Serres wrote:
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y', 200)))
the right way to have it
laksh wrote:
is it possible to give parameters like the IP of a DNS server and the
DNS query to a python program and obtain the response from the DNS
server ?
http://pydns.sf.net
http://www.dnspython.org/
http://www.google.com/search?hl=enq=python+dnsbtnG=Google+Search
Ciao, Michael.
--
I'm trying to open a text file, remove all instances of the words
f=x; and i=x; where x can be any number 0-14. Also, I want to
remove all {or ) or ( or ' } each time one of those characters
occurs respectively. This is what I've been able to piece together...
import os, string
x = (f=;)
rbt wrote:
On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
abaa
aaba
aaab
acaa
aaca
aaac
...
What
Hopefully someone can catch what im missing here. Ive googled this and I think
Ive got the filetypes arg written properly, but I get a traceback when calling
this function.
Heres the code followed by its traceback.
def do_ask_fn_1():
z = askopenfilename(title=TITLE, initialdir=Dst_Dir,
Yes, there's a lot of issues, cross-site scripting, session hijacking,
proper authentication, etc. Open Web App Security Project is useful
www.owasp.org
Also, before you start with NLP and full-on parsers, think about if you
can apply a text indexer, stemming and stopping both your user's
I have an executable
version of a script that I wrote, but my script and backups got erased. Is
it possible to get the python script back from an exe file created with
py2exe?
Joe Woodward
Phoenix Analysis Design
Technologies
7755 s. Research Drive - Suite
110
Tempe, Arizona 85284
On Wed, Jul 13, 2005 at 05:07:33PM +0100, Duncan Smith wrote:
rbt wrote:
On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of
Hi, I'm trying to use the AddPrinterDriver method of
Win32_PrinterDriver to create a new. print driver. I can't get my
head round how I need to do this. So far I have
import win32com.client
WBEM =
win32com.client.GetObject(rwinmgmts:{impersonationLevel=impersonate}!\\
+ . + r\root\cimv2)
Jack Diederich wrote:
On Wed, Jul 13, 2005 at 05:07:33PM +0100, Duncan Smith wrote:
rbt wrote:
On Wed, 2005-07-13 at 11:09 -0400, rbt wrote:
On Wed, 2005-07-13 at 10:21 -0400, rbt wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit
On Wed, 2005-07-13 at 09:00 -0700, [EMAIL PROTECTED] wrote:
I'm trying to open a text file, remove all instances of the words
f=x; and i=x; where x can be any number 0-14. Also, I want to
remove all {or ) or ( or ' } each time one of those characters
occurs respectively. This is what
For me this:
z = tkFileDialog.askopenfilename(title='Title',
filetypes=[
('AIFF Files','*.aiff'),
(TXT Files, *.txt),
],
Jeremy Sanders wrote:
fargo wrote:
I'm looking for some way to sort files by date.
you could do something like:
l = [(os.stat(i).st_mtime, i) for i in glob.glob('*')]
l.sort()
files = [i[1] for i in l]
Jeremy
If you have 2.4 or later:
def mtime(filename):
return
Scott David Daniels wrote:
Francois De Serres wrote:
Francois De Serres wrote:
Having a string: dothat
and a tuple: (x, y)
1. What's the best way to build a function call like: dothat(x,y)?
Assuming dothat is def'd in the same module,
2. is: eval(dothat(x,y), None, (('x', 100), ('y',
Thomas Lotze wrote:
Peter Otten wrote:
class frankenstring(StringIO):
... def next(self):
... c = self.read(1)
... if not c:
... raise StopIteration
... return c
Repeated read(1) on a file-like object is one of the ways of
SDXF is a Python library to generate DXF files. DXF is an abbreviation
of Data Exchange File, a vector graphics file format. It is supported
by virtually all CAD products (such as AutoCAD, Blender, 3Dstudio,
Maya,Vectorworks...) and vector drawing programs (such as Illustrator,
Flash, ...).
SDXF
Scott David Daniels wrote:
iter(elem in lst if elem[3] == x).next()
Does this look any better? At least it stops when the answer is found.
Next time you'll recommend
if (ab) == True:
# ...
Watch out, you're on a slippery slope here :-)
Peter
--
Ric Da Force [EMAIL PROTECTED] wrote:
I have a string such as 'C1, C2, C3'. Without assuming that each bit of
text is of fixed size, what is the easiest way to change this list so that
it reads:
'C1, C2 and C3' regardless of the length of the string.
import re
data = the first bit, then
I have the executable of a script that I wrote, that has been erased.
Is there any way to retrieve the uncompiled python script from the
executable that was created with py2exe?
Thank you,
Joe
--
http://mail.python.org/mailman/listinfo/python-list
You probably need to remove the SpawnInstance_() call.
An abstract WMI class as returned by WBEM.Get should work
for the DriverInfo parm, since the concrete Win32_PrinterDriver
instance is what the AddPrinterDriver call is trying to create.
hth
Roger
[EMAIL PROTECTED] wrote in
rbt [EMAIL PROTECTED] wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
It's actually 3^4 = 81 (3 candidates/choice ** 4 choices)
abaa
aaba
aaab
acaa
aaca
aaac
...
What is
Hi,
for punctuation in punctuations:
line=line.replace(punctuation,'')
I would use maketrans or even a regex instead. However, If you care
about speed, it is well known that in some cases regex take more
time than multiple replaces. Even the maketrans could take more time
(I don't
QOTW: The posts do share an erroneous, implied assumption that the
investment in learning each language is equal. Python has a strong
competitive advantage over Java and C++ in terms of learnability. A
person can get up to speed in a few days with Python. - Raymond Hettinger
You know, this is
reverse dns lookup is not really special compared to a regular dns lookup.
you just need to look up a special name:
http://www.dnsstuff.com/info/revdns.htm
to format the ip address properly use something like:
def rev_dns_string(ip_str):
nums = ip_str.split('.').reverse()
George Sakkis [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
rbt [EMAIL PROTECTED] wrote:
Say I have a list that has 3 letters in it:
['a', 'b', 'c']
I want to print all the possible 4 digit combinations of those 3
letters:
4^3 = 64
It's actually 3^4 = 81 (3
I recently upgraded from 2.2 to 2.4 (ActiveState for Windows).
I was accustomed to having the most recent 10 files that I had
edited show up under File menu under Recent. After upgrading
these don't seem to be saved after exiting. I tried changing
the number in the Preferences, but nothing seems
On Wed, 13 Jul 2005 15:22:35 -0400, Chris Lambacher [EMAIL PROTECTED] wrote:
reverse dns lookup is not really special compared to a regular dns lookup.
you just need to look up a special name:
http://www.dnsstuff.com/info/revdns.htm
to format the ip address properly use something like:
def
Hi,
Can somebody please explain to me why:
class SomeClass:
def __init__(self, contents=[]):
self.contents = contents[:]
def add(self, element):
self.contents.append(element)
when called a second time (i.e. to create a new instance of a SomeClass
object) results in
1 - 100 of 169 matches
Mail list logo