Mike Meyer wrote:
> Bryan Olson <[EMAIL PROTECTED]> writes:
> > The issue here is whether to confuse reality with what one might
> > wish reality to be.
>
> Let's see. Reality is that writing correct programs is hard. Writing
> correct programs that use concurr
Whenever I ask a match in a string for(a{3,}b and match for (a{1,}, the
first is implicit second: ab is implicit in a.*;automatically
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I'm writing a program which needs to change various format features
of a specific pattern ("remote_user" for example) withing a Text
widget. This pattern could potentially be anywhere within the widget.
I'm unsure of how to implement the various tag methods, so a little
push in the right direc
is there a way to embed common lisp programs in python?
--
http://mail.python.org/mailman/listinfo/python-list
Chris Spencer wrote:
> Is there any library for Python that implements a kind of universal
> number object. Something that, if you divide two integers, generates a
> ratio instead of a float, or if you take the square root of a negative,
> generates a complex number instead of raising an exception
Steven Bethard wrote:
> Adam Tomjack wrote:
> > Steven Bethard wrote:
> > ...
> >> Using a two element list to store a pair of counts has a bad code
> >> smell to me.
> > ...
> >
> > Why is that?
>
> Note that "code smell"[1] doesn't mean that something is actually wrong,
> just that it might be.
Much more useful stuff for beginners is here:
http://wiki.python.org/moin/BeginnersGuide
--
http://mail.python.org/mailman/listinfo/python-list
basically, what I'm looking to do is use python as a bridge between C
and Common Lisp to create a virtual city that contains Artificial life.
--
http://mail.python.org/mailman/listinfo/python-list
Your best bet is probably to look into your LISP environment's FFI
(Foreign Function Interface). Most LISP environments have some way to
call C code directly. Insofar as going back the other way... that I'm
a little more sketchy on. Guile (the Scheme compiler from GNU) is a
strong contender, tho
Hi,
I have to create a ListBox in which I have to move items up and down
using DnD. How to create drag and drop call backs in wxListCtrl.
I can see EVT_LIST_BEGIN_DRAG but I could not find any
EVT_LIST_END_DRAG.
So, how can I achieve DnD with ListCtrl?
Thanks in advance for the suggestions.
Reg
Bengt Richter wrote:
> On 28 Aug 2005 18:54:40 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> >Steven Bethard wrote:
> >> Adam Tomjack wrote:
> >> > Steven Bethard wrote:
> >> > ...
> >> >> Using a t
n00m wrote:
> When I double-click on "some.py" file console window appears just for a
> moment and right after that it's closed. If this script is started from
> inside of IDLE (F5 key) then it executes as it should be (e.g.
> executing all its print statements).
>
> Any ideas? OS: Windows; Python
I am trying to embed images into a wxPython app (created using Boa
Constructor), but have not been able to do so. I know how to embed
plots, but images seem to be a problem. I've tried using code analogous
to the example given at the Matplotlib website to no avail. If anybody
has been successful at
but the 'expect' gives you more details about the failure... read the
documentation on telnet objects here:
"http://docs.python.org/lib/telnet-objects.html";.
It says this specifically:
"If end of file is found and no text was read, raise EOFError.
Otherwise, when nothing matches, return (-1, None,
Steve, can I quote you on that?
"You can lead an idiot to idioms, but you can't make him think!" --
Steve Holden 2005
--
http://mail.python.org/mailman/listinfo/python-list
Well, to answer my own question, the problem turned out to be that I
was using the 'wx' backend and not the 'wxagg' one. Attempting to use
the former typically resulted in a not implemented error upon the call
to imshow. I was working from an older set of matplotlib example files
which didn't inclu
It's not clear to me from the Python docs whether waitflag
is treated as a boolean or as a number.
Running on Windows, I get two different behaviors from
the following calls to acquire:
aLock = threading.Lock()
...
# Thread 0
# This one often succeeds
aLock.acquire(1)
...
#
I named this tool - FarPy GUIE, and is available at:
http://farpy.holev.com/
This is a quote from the site:
"GUIE (GUI Editor) provides a simple WYSIWYG GUI editor for wxPython.
The program was made in C# and saves the GUI that was created to a XML
format I called GUIML. This GUIML is a pretty st
phil hunt wrote:
> Some times concurrency is the best (or only) way to do a job. Other
> times, it's more trouble than its worth. A good programmer will know
> which is which, and will not use an overly complex solution for the
> project he is writing.
Also, a good programmer won't conflate concur
_option("-u", "--url", action="store", dest="url",
help = "enter an url")
py>
py>(options, args) = parser.parse_args()
py>if not options.name and not options.url:
py> parser.error('specify both name and url')
py>
Your best bet would be to use "pexpect" module. Code may look something
like:
import pexpect
import sys
child = pexpect.spawn ('ftp ftp.site.com')
child.expect ('Name .*: ')
child.sendline ('username')
child.expect ('Password:')
child.sendline ('password')
child.expect ('ftp> ')
child.sendline ('
then you are using a regex expression that is a wildcard match, and
that is non-deterministic.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I've been having some problems trying some basic plotting commands with
gnuplot.py. My setup is the Python 2.3 Enthought edition and my script
looks as:
from scipy import *
from scipy import gplt
import scipy.io.array_import
#import Gnuplot
filename = ('Default.PL1')
data = scipy.io.array_im
Thank you all for the advice, I think I'll be writing my lisp code in
python.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the response Varun,
I guess I still not sure the distingtion betweein gnuplot.py and its
implentation in scipy.
--
http://mail.python.org/mailman/listinfo/python-list
Still having some issues plotting:
In attempting as explained above:
import Gnuplot,Numeric
filename = ('Default.PL1')
data = scipy.io.array_import.read_array(filename)
y = data[:,1]
x = data[:,0]
z = data[:,2]
//I think u need to take the transpose of this column before
plotting..
x=Numeric.t
Has anyone else felt a desire for a 'nochange' value
resembling the 'Z'-state of a electronic tri-state output?
var1 = 17
var1 = func1() # func1() returns 'nochange' this time
print var1 # prints 17
It would be equivalent to:
var1 = 17
var2, bool1 = func1()
if bool1:
var1 = var2
Thanks for the suggestions, although I'll probably continue to use:
var1 = 17
var1 = func1(var1)
print var1
and have func1 return the input value if no change is required.
It's *almost* as nice as if there was a Nochange value available..
BR /CF
--
http://mail.python.org/mailman/listinfo/py
Oh, right I see you also thought of that.
(Sorry, didnt read your entire mail.)
--
http://mail.python.org/mailman/listinfo/python-list
Use the pervasive client. You'll need the SDK to actually access any
data though.
--
http://mail.python.org/mailman/listinfo/python-list
You'll need a watchdog thread that handles the other threads. The
watchdog thread just builds a table of when threads were started, and
after a certain # of seconds, expires those threads and kills them.
--
http://mail.python.org/mailman/listinfo/python-list
http://www.pervasive.com/developerzone/access_methods/oledbado.asp
--
http://mail.python.org/mailman/listinfo/python-list
Python the programming language
is reviled for its indentage.
Although it's the norm,
to code in free form
makes sources no better than garbage.
--
http://mail.python.org/mailman/listinfo/python-list
HI, I am new to python graphics. I want to have a scale(tkinter) or
slider(wxpython), on which I can have more than one pointers. Using it
I want to have single slider for different parameters of an entity. Can
anyone help me to look for it OR make it.
Thanks in adwance.
--
http://mail.python.org
python 2.4.1
numarray 1.3.1
works ok here. I'd try numarray 1.3.1 and see if it is unique to your
version. Also, if you built it yourself, you might make sure you have
sane CFLAGS.
[EMAIL PROTECTED] ~ $ python
Python 2.4.1 (#1, Sep 3 2005, 16:55:52)
[GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.
I coded a solution that can compute the ordering numbers for
random.shuffle(range(1, 101)) in 2.5 seconds (typical, Win 2K Pro,
Pentium 4 2.40GHz 785Meg RAM)
Are you sure that this is not a homework problem?
--
http://mail.python.org/mailman/listinfo/python-list
No there is not. Hey, you could write one though.
--
http://mail.python.org/mailman/listinfo/python-list
I second that. NSIS works better than MSI, Inno, or even InstallShield.
I highly recommend it. Of course, a second choice is Inno, third is
MSI, and last resort is InstallShield. Another option is to make an
installer using "AutoIT" but that can get kind of tricky.
--
http://mail.python.org/mailm
> ... and let me reveal the secret:
> http://spoj.sphere.pl/problems /SUPPER/
your question is different than the question on this website.
also, what do you consider to be the correct output for this
permutation? (according to your original question)
[4, 5, 1, 2, 3, 6, 7, 8]
Manuel
--
http:/
So, this has no real world use, aside from posting it on a website.
Thanks for wasting our time. You are making up an arbitrary problem and
asking for a solution, simply because you want to look at the
solutions, not because your problem needs to be solved. Clearly, this
is a waste of time.
--
ht
spawn() works on QNX, fork() does not.
--
http://mail.python.org/mailman/listinfo/python-list
Working on this allowed me to avoid some _real_ (boring) work at my
job.
So clearly it served a very useful purpose! ;)
Manuel
--
http://mail.python.org/mailman/listinfo/python-list
> That's easy to follow, although their use of a Van Emde-Boas set as a
> given hides the most challenging part (the "efficient data structure"
> part).
The "efficient data structure" is the easy part.
Obviously, it is a dict of lists.
...or is it a list of dicts?...
...or is it a tuple of gene
>>unless you are going many levels deep
(and that's usually a design smell of some kind)
No, its not a bug. its a feature! See the discussion in the recursive
generator thread below:
http://groups.google.com/group/comp.lang.python/browse_frm/thread/4c749ec4fc5447fb/36f2b915eba66eac?q=recursive+ge
I wasn't sure of what itertools.groupby() is good for. But it serves
your purpose.
>>> lst = [1,1,1,1,3,5,1,1,1,1,7,7,7]
>>>
>>> import itertools
>>> i = 0
>>> groups = []
>>> for k, g in itertools.groupby(lst):
... l = len(list(g))
... if l == 1:
... groups.append(i)
... else:
I'm not really worry that much over O(n^2) performace (especially
having optimized some O(n^3) SQL operations :-o !)
The things is this really should be an O(n) operation. Having a yield
all statement or expression is useful in its own right and also
potentially a way to optimized away the O(n^2)
Looking at the email package, it seems all the MIMExxx classes takes
string but not file object as the payload. I need to handle very large
MIME messages say up to 100M. And possibly many of them. Is email
package sufficient. If not is it possible to extend it?
Looking at a previous thread it seem
Scott David Daniels wrote:
> In article:
> http://humorix.org/articles/2005/08/notice/
>
> ... 6. The use of semantically significant whitespace in Python®
> programs might be protected by intellectual property laws in
> five (5) countries,
>
&g
HI,
It may be a very elementry question, but I need to know that how can I
get text of a label.
--
http://mail.python.org/mailman/listinfo/python-list
= None:
break
print Envelope.getallmatchingheaders("from")[0]
Match=AddressRE.search(
Envelope.getallmatchingheaders("from")[0])
if Match:
Set=Match.groups()
if "[EMAIL PROTECTED]&quo
Why do you want to encrypt just the numbers?
--
http://mail.python.org/mailman/listinfo/python-list
richard wrote:
> I'd like to have an array in which the elements are various data types.
> How do I do this in Python?
>
> For example:
>
> array[0].artist = 'genesis'
> array[0].album = 'foxtrot'
> array[0].songs = ['watcher', 'time table', 'friday']
> array[1].artist = 'beatles'
> array[1].album
That is a great example Gustavo...
One way that Richard's error of array[0] equaling array[1] could be
introduced would be by accidentally appending the 'music' class object
onto his list, rather than creating a new instance of music each time.
Changing the code:
array.append(music())
array.appen
Had the same reaction as everyone when I saw theses puzzles a month or
so ago, so here is my solution...
the solve function is recursive, so it can also solve the 'deadlock
set' (example3). find_cell looks for an empty cell with the most filled
cells in it's row and column, so the search tree doesn
Consider also dateutil written by Gustavo Niemeyer
and found at:
https://moin.conectiva.com.br/DateUtil
>>> from dateutil.rrule import *
>>> list(rrule(WEEKLY, byweekday=MO, dtstart=date(2005,1,1),
>>> until=date(2005,12,31)))
The library may be a little intimidating at first it is worth learnin
James H. wrote:
> Greetings! I'm new to Python and am struggling a little with "and" and
> "or" logic in Python. Since Python always ends up returning a value
> and this is a little different from C, the language I understand best
> (i.e. C returns non-zero as true, and zero as false), is there
The problem may be something to do with using "threading" as identifier
name. It is name of a module and definitely what you want it done
anyway. You are better off having another variable as counter (with a
different name).
Raghu.
--
http://mail.python.org/mailman/listinfo/python-list
I am not interested in doing your homework.
--
http://mail.python.org/mailman/listinfo/python-list
After recently getting excited about the possibilities that stackless
python has to offer
(http://harkal.sylphis3d.com/2005/08/10/multithreaded-game-scripting-with-stackless-python/)
and then discovering that the most recent version of stackless
available on stackless.com was for python 2.2 I am wo
hello,
I wonder if anyone used spe stani, I'm looking for how to collapse all
code fold, but can't find.
pujo
--
http://mail.python.org/mailman/listinfo/python-list
Neal Becker wrote:
> Like a puzzle? I need to interface python output to some strange old
> program. It wants to see numbers formatted as:
>
> e.g.: 0.23456789E01
>
> That is, the leading digit is always 0, instead of the first significant
> digit. It is fixed width. I can almost get it with '
[EMAIL PROTECTED] wrote:
> Neal Becker wrote:
> > Like a puzzle? I need to interface python output to some strange old
> > program. It wants to see numbers formatted as:
> >
> > e.g.: 0.23456789E01
> >
> > That is, the leading digit is always 0, instead
I've have an idea for a personal project. I want to access my car's
OBD-II port via serial to query engine paramters and represent them on
my PC monitor. The various methods to represent them would be any of
the following: analog gauge (speedometer), digital readout, and X Y
Plots/Charts (HP vs RPM
Traditionally, one part of the expression has to be a float for the
result to be a float (this is a holdover from C). So 100/3.0 will give
you the result you want. Alternatively, you can put "from __future__
import division" at the top of your script, and then 100/3 will return
a float.
http://www
Hi !
My problem is that: I have a program that copy pictures from Notes NSF file.
The format is METAFILE or METAFILEPICT.
I can save these pictures with this code:
import win32api
import win32con
import win32gui
...
mode=0
if mode==0:
import win32clipboard, win32con
win32clipboard.OpenClipboard
code like below willprint all files ending on 'par2', except tose not
containong 'vol' from the 5th position. is that what you need?
-import glob
-for nuke in glob.glob(r"""c:\temp\*.par2"""):
-try:
-nuke.index('vol', 5)
-print nuke
-except ValueError, e:
-print e
-
How can python connect to server which use SSH protocol?
Is it easy since my python has to run third party vendor, write data,
read data inside the server (supercomputer).
Any suggestion?
Sincerely Yours,
Pujo Aji
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Is anyone has experiance in running python code to run multi thread
parallel in multi processor. Is it possible ?
Can python manage which cpu shoud do every thread?
Sincerely Yours,
Pujo
--
http://mail.python.org/mailman/listinfo/python-list
Hello Pierre,
That's a pity, since when we have to run parallel, with single
processor is really not efficient. To use more computers I think is
cheaper than to buy super computer in developt country.
Sincerely Yours,
pujo aji
--
http://mail.python.org/mailman/listinfo/python-list
os.walk gives an object with all files in a tree, e.g.
f = os.walk('c:\\temp')
for i in f:
print i
--
http://mail.python.org/mailman/listinfo/python-list
btw, 'isnot' is not pronounced "is-not" but rather "i-snot". :-)
S
--
http://mail.python.org/mailman/listinfo/python-list
Irmen de Jong wrote:
> Pickle and marshal are not safe. They can do harmful
> things if fed maliciously constructed data.
> That is a pity, because marshal is fast.
I think marshal could be fixed; the only unsafety I'm aware of is that
it doesn't always act rationally when confronted with incorrec
Thanks a lot!
Matej
--
http://mail.python.org/mailman/listinfo/python-list
n
import xmlrpclib
from xmlrpclib import *
test =
Server('http://3tier:My&[EMAIL PROTECTED]/Forecast')
print test.ReturnSimpleInt()
Returns the following error:
Traceback (most recent call last):
File "./testCondon.py", line 8, in ?
print test.ReturnSimpleInt()
File
I'm a newbie to pthyon and I am creating an app with wxPython.
I have 7 tables (more on the way... they are feed from a database) that
need to be formatted in a certain way (DataTable() does this) and I am
just looking for a cleaner way to pass all of the Grids (grid_1,
grid_2, etc) through the sam
add just below the procedure declaration 'global t2' as you're
referring to a global variable ...
--
http://mail.python.org/mailman/listinfo/python-list
I wrote a COM server in Python where all the clients use the same
global object(test_obj). So far it works, but when the last client is
closed the Python COM enviornment is closed and the global object is
lost. How can I prevent that?
I need that new clients use the same global object and not a new
I have implemented a local COM Server with win32com framework where all
clients
use the same global object (test_obj). So far it works, but when the
last client
is closed the gobal object is deleted because the pythonw.exe is
closed. When I
create a new client a new pythonw process is started. I ne
Hi,
why can't I do this:
dummy = self.elements[toy][tox]
self.elements[toy][tox] = self.elements[fromy][fromx]
self.elements[fromy][fromx] = dummy
after initialising my nested list like this:
self.elements = [[0 for column in range(dim)] for row in
range(dim) ]
, 2005 at the
Lawrenceville Library (Room #2). We will be reviewing the Python
Tutorial at http://www.python.org/doc/2.4/tut/tut.html
and then open discussion about Python will be encouraged. Anyone
interested in the Python language is invited to attend.
Contact Jon Fox at [EMAIL PROTECTED] for
Diez B. Roggisch wrote:
> [EMAIL PROTECTED] wrote:
>
> > Hi,
> >
> > why can't I do this:
> >
> > dummy = self.elements[toy][tox]
> >
> > self.elements[toy][tox] = self.elements[fromy][fromx]
> > self.elements[from
Thanks for the code.
What I want to do is this:
I want to solve the block puzzle problem. The problem is as follows:
You have a nxn Array of Numbers and one empty space. Now you there are
up to four possible moves: up, right, down and left, so that each
neighbour of the empty slot can be moved the
Allright. What difference in runtime and space would it make using
dictionaries instead?
Do you have a pointer for me concerning runtime of standard
manipulations in Pythons?
Thanks for tip.
--
http://mail.python.org/mailman/listinfo/python-list
Allright. What difference in runtime and space would it make using
dictionaries instead?
Do you have a pointer for me concerning runtime of standard
manipulations in Pythons?
Thanks for the tip.
--
http://mail.python.org/mailman/listinfo/python-list
In trying to construct a good object model in a recent project of mine,
I ran across the following peculiarity in python 2.3.4 (haven't tried
any newer versions):
Say you have a base class that has an attribute and an accessor
function for that attribute (just a simple get). Then you inherit that
The problem is that I actually do need them to be private to the
outside world... but not to subclasses. I guess what I actually need
is something like "protected" in C++ but I don't think I'm going to
get that luxury.
I think what's happening in my example is
Thanks guys for all your input! I really appreciate the prompt
replies!
As you can tell I'm having a bit of trouble throwing out old habits...
I'm not new to loosely typed languages (I'm a big PHP fan) but learning
a new object model has been a little tough... I'm trying to make my old
ideas fit
every object in os.walk() returns a 3-tuple, like below, it seems your
code assumes it returns only a list of files.
for d in os.walk('c:\\temp'):
(dirpath, dirnames, filenames) = d
print dirpath
print dirnames
print filenames
--
http://mail.python.org/mailman/lis
That's an easy one: fs_objects is not modified by your ode, so you get
it back as created by os.walk
--
http://mail.python.org/mailman/listinfo/python-list
Adam wrote:
> "Adam" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > "BOOGIEMAN" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> On Tue, 15 Feb 2005 21:22:43 GMT, Adam wrote:
> >>
Hi,
thanks, I 'll post the problem in python-win32@python.org ...
Frank
--
http://mail.python.org/mailman/listinfo/python-list
if you want to send the value '1000' over a socket connection in a
socket object do something like sock.send(str(1000)) if socket is a
socket.socket object.
--
http://mail.python.org/mailman/listinfo/python-list
and every
man/woman/elf/alien/cyborg/whatelse who is capable to do some basic
(sometimes advanced) Python tasks.
Interested? Contact me at [EMAIL PROTECTED] or
[EMAIL PROTECTED]
Regards,
BiFacial
P. S. Sorry for crappy English. I am Russian, after all :)
--
http://mail.python.org/mailman/listinfo
Hello,
Can python be installed on a win98 system ? if so, how do I control a
qbasic program from python ?
the qbasic program controls input to an RS-232 so I am enclined to
follow the win98 system + qbasic route in order to be quick, or I guess
the question could be, can I control a device throug
I got an error as following. The Server/cllient program was written by
somebody else and supposed to be working before. Whenever I start a
new client to load xml data from server, the program will fail as:
File "ShowAllData.py", line 157, in ?
main(sys.argv)
File "ShowAllData.py", line 1
Hello all,
The displayed string looks like some wierd chars (unreadable to human
being at all), when I tried to display the received message by socket.
I read by this line:
body = self.io.blockingRead (int(header.getFieldCN
('Content-Length')))
print "socket content: " + body
I am new to pyth
As Felix pointed out, of course link should read
http://sourceforge.net/projects/pywrath
Sorry to everyone who tried to follow crappy link :)
--
http://mail.python.org/mailman/listinfo/python-list
great thanks
--
http://mail.python.org/mailman/listinfo/python-list
I was interested in playing around with Decimal and
subclassing it. For example, if I wanted a special
class to permit floats to be automatically converted
to strings.
from decimal import Decimal
class MyDecimal(Decimal):
def __init__(self, value):
if isinstance(value
STeVe,
Thanks for the response. Very clear.
yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly
y'rs,
-Jeff
--
http://mail.python.org/mailman/listinfo/python-list
801 - 900 of 4917 matches
Mail list logo