[...]
I have been using something like this:
_
while list[0] != O:
storage.append(list[0])
list.pop(0)
if len(list) == 0:
break
_
But this seems ugly to me, and using while give me the heebies. Is
there a better approach?
I observed something strange when I tried to compile the jython class:
D:\AUT_TEST\workspace\JyFIT\fitjythonc JyFitServer.py
processing JyFitServer
Required packages:
fitnesse.util
java.io
java.net
fitnesse.components*
Creating adapters:
Creating .java files:
JyFitServer module
Magnus Lycka wrote:
[EMAIL PROTECTED] wrote:
But using the free SDK compiler from MS? That seems elusive.
Have you seen this?
http://www.vrplumber.com/programming/mstoolkit/
I have, although I haven't tried it as I was able to get a GMPY
Windows binary from someone else. It may be that
everybody is making this way more complicated than it needs to be.
storage = list[:list.index(O)]
incidentally, list is the name of a type, so you might want to avoid
using it as a variable name.
--
http://mail.python.org/mailman/listinfo/python-list
Mark Fink wrote:
I observed something strange when I tried to compile the jython class:
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static void assert(PyObject test, PyObject message) {
Looks like
Ross Ridge wrote:
In general it's impossible to know how many display positions some
random Unicode character might use. For example, Chinese characters
normally take two display positions, but the terminal your using might
not support them and display a single width replacement character.
Can anyone tell me how complicated it might be to install Python on my
server so I can use it for web apps? Is it a one-time process, or
something to maintain?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno:
Can anyone tell me how complicated it might be to install Python on my
server so I can use it for web apps?
2 on a scale from 1 to 10.
Is it a one-time process, or something to maintain?
Both :-)
I installed Python 2.2 - 2.4 from source on Linux with no problem
whatsoever. I now
Rene Pijlman wrote:
John Salerno:
Can anyone tell me how complicated it might be to install Python on my
server so I can use it for web apps?
2 on a scale from 1 to 10.
Is it a one-time process, or something to maintain?
Both :-)
I installed Python 2.2 - 2.4 from source on Linux
Here's a curious hack I want to put up for discussion. I'm thinking of
writing a PEP for it.
Observation
-
I found myself using this construct for assembling multiple lists:
foo = []
qux = []
while some_condition:
a, b = calculate_something()
You could eliminate a few lines like this:
-
while list and list[0] != O:
storage.append(list.pop(0))
-
Adding the list and to the front of the logic test will catch when
there are 0 elements, so the if..break lines are not needed.
I'd like to write two generators: one is a min to max sequence number generator that rolls over to min again once the max is reached. the other is a generator that cycles throughN (say, 12)labels. currently, i'm using these generators in nested loops like this:seq_numbers =
Lonnie Princehouse wrote:
everybody is making this way more complicated than it needs to be.
storage = list[:list.index(O)]
the question is whether the old list is needed in the future or not
if not then it would be easer/mor efficient to use
del lst[lst.index(0):]
Regards, Daniel
--
MackS wrote:
Hello!
This question does not concern programming in python, but how to manage
python processes. Is there a way to name a python process? At least
on Linux, if I have two python programs running, they both run under
the name python
#pidof program1.py
[empty line]
#pidof
[EMAIL PROTECTED] wrote:
so. how do i make 200 occupy 4 bytes ?
Did you double-check that they didn't want 0200 in ascii
in the message?
As in:
STX0200ENX
Because that's always possible. And, if you're _lucky_, they designed
the innards of the message so that ENX can
I don't want to hijack the thread I was thinking
whether something like lst.remove(item = 0, all = True)
would be worth adding to Python?
it could have this signature
def remove(item, nItems = 1, all = False)
...
return how_many_deleted
lst.remove(item = 0, nItems = 1)
Magnus Lycka wrote:
Bryan Olson wrote:
Magnus Lycka wrote:
Bryan Olson wrote:
big_union = set()
for collection in some_iter:
big_union.update(t)
collection.clear()
I don't understand the second one. Where did 't' come from?
Cut-and-past carelessness. Meant
You mentioned using python for web apps: with which framework?
(TurboGears, CherryPy, Subway, Django, whatever) Or only for cgi?
With which web server? (Apache, Twisted, Zope, etc.)
On which linux platform? (Slackware, Debian, Fedora/RedHat, Suse, etc)
I think you'll have to think about other
On Tue, 07 Feb 2006 18:10:05 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote:
[...]
ernesto.py -
[...]
Just noticed:
substrings = line.split()
if substrings and isinstance(substrings, list) and substrings[0] ==
'Name:':
John Salerno:
Hmm, sounds easy, yet I don't know where to start.
try:
browser.browse(http://www.python.org/download/)
package = download(yourPlatform)
package.unpack()
exec(README.read())
except:
post specifics
--
René Pijlman
--
Incorporating Fredrik's fix (I learned something new reading
that), try using an endless loop even if there is an exception
like this:
def run(self):
while True:
try:
start an SMTP-Server
asyncore.loop()
except:
From: Kermit Rose
Date: 02/10/06 17:36:34
To: [EMAIL PROTECTED]
Subject: Arrays
Hello.
I want to write a program in python using integer arrays.
I wish to calculate formulas using 200 digit integers.
I could not find any documentation in python manual about declaring arrays.
I
Kermit Rose wrote:
From: Kermit Rose
Date: 02/10/06 17:36:34
To: [EMAIL PROTECTED]
Subject: Arrays
Hello.
I want to write a program in python using integer arrays.
I wish to calculate formulas using 200 digit integers.
I could not find any documentation in python manual
Hello,
If I have a string, what is the strongest way to assure the
removal of any line break characters?
Line break characters must always be the last character in a line, so
would
this:str = linestring[:-1]
work?
This is my first real 'learning python' project, and I don't want to
get
Lonnie Princehouse wrote:
Here's a curious hack I want to put up for discussion. I'm thinking of
writing a PEP for it.
Observation
-
I found myself using this construct for assembling multiple lists:
foo = []
qux = []
while some_condition:
a, b =
On Fri, 10 Feb 2006 09:08:28 -0800, Kamilche wrote:
I have a question for all you Pythoneers out there. I'm making a game
with Python, and have a need for fonts. I am currently using a free
TrueType font, but am considering switching to a bitmap font instead.
Let's say I own a font, and use
S Borg [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If I have a string, what is the strongest way to assure the
removal of any line break characters?
Line break characters must always be the last character in a line, so
would
this:str = linestring[:-1]
work?
Er, yes,
I want to write a program in python using integer arrays.
you can :)
I wish to calculate formulas using 200 digit integers.
no problem
I could not find any documentation in python manual about declaring arrays.
I searched the internet
read here
Renato [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
-snip-
On systems with package management (pretty much all of them, except
Slack) install is a matter of a few commands. And you can automate it,
obviously.
Slackware has package management, (pkgtool, installpkg, removepkg,
Thank you for the suggestion!bruno at modulix [EMAIL PROTECTED] wrote: limodou wrote: On 2/10/06, john peter wrote:(snip) what do i have to do if i want my application code to haveread-only attributes? I think you may consider property() built-in function: property( [fget[, fset[, fdel[,
I'd like some documentation on the cmd module, besides the regular
docs, in help() and docs.python.org...
Gerber
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger wrote:
The intersection step is unnecessary, so the answer can be simplified a
bit:
filter(set(l2).__contains__, l1)
[5, 3]
filter(set(l1).__contains__, l2)
[3, 5]
stand corrected.
--
http://mail.python.org/mailman/listinfo/python-list
Scott David Daniels wrote:
[EMAIL PROTECTED] wrote:
Problem:
You have a list of unknown length, such as this: list =
[X,X,X,O,O,O,O]. You want to extract all and only the X's. You know
the X's are all up front and you know that the item after the last X is
an O, or that the list ends with
has anyone had any success compiling matplotlib in cygwin? i had some
rebasing problems that i got around, but when i finally got everything
to install without any complaints and did import pylab i got dumped
out of python altogether without any errors.
some thing i did:
cd /usr/lib
ln -s
On Thu, 9 Feb 2006 10:07:49 +1100, Delaney, Timothy (Tim) [EMAIL PROTECTED]
wrote:
Steven D'Aprano wrote:
That's not a _reason_, it is just a (re-)statement of fact. We know
that defining a __call__ method on a module doesn't make it callable.
Why not? The answer isn't because defining a
Russ,
Thanks a ton for ending a 3 day headache.
S
--
http://mail.python.org/mailman/listinfo/python-list
I am relatively new to Python, and wanted to see if this is even
possible, and if so how to go about implementing it. What I'm looking
to do is create a client/server application that does the following:
1) System2 listens on port 1023
2) System1 connects to System2 and sends traffic to it -
On Sat, 11 Feb 2006 00:47:14 +0100, Gerber wrote:
I'd like some documentation on the cmd module, besides the regular
docs, in help() and docs.python.org...
Is this a trick question? You'd like some documentation apart from the
documentation?
Have you tried reading the source code to the
...with a twist.
I'm undertaking my first semi-substantial Python GUI application after a
long time dabbling with the language.
I'm fairly experienced with Tcl/Tk, so Tkinter seems the obvious choice
to reduce my Python learning curve. However, my Tcl applications
typically make use of a *lot*
On Fri, 10 Feb 2006 17:50:21 -0500, Kermit Rose wrote:
I want to write a program in python using integer arrays.
I wish to calculate formulas using 200 digit integers.
Must the integers have exactly 200 digits? If you multiply one of these
200-digit integers by ten, should it silently
On Fri, 10 Feb 2006 15:21:58 -0800, S Borg wrote:
Hello,
If I have a string, what is the strongest way to assure the
removal of any line break characters?
What do you mean strongest? Fastest, most memory efficient, least lines
of code, most lines of code, least bugs, or just a vague best?
Why did you want to customize is?
Well, mostly out of principle ;-)
But also because I'm wrapping a C library which passes around C structs
which are wrapped in shim C++ classes for a Boost.Python layer. Boost
Python does a marvelous job of translating between Python and C++ data
types; when a
Oh, don't tell me, I love playing guessing games!
Don't you mean No no... don't tell me. I'm keen to guess.
Sorry, I couldn't resist... :-)
(for those who just went huh?, see
http://www.aldo.com/sgt/CheeseShoppeSkit.htm)
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, 11 Feb 2006 01:37:59 +0100 in comp.lang.python, Schüle Daniel
[EMAIL PROTECTED] wrote:
Lonnie Princehouse wrote:
everybody is making this way more complicated than it needs to be.
storage = list[:list.index(O)]
the question is whether the old list is needed in the future or not
if
Yeah, that's what I'm thinking, as well. Showing all the text on an
image is one thing... using that image as the basis of a font engine is
something different.
Luckily, someone has sent me a link to a set of free TrueType fonts -
http://www.gnome.org/fonts , the 'Vera' family. I guess I'll turn
[EMAIL PROTECTED] wrote:
An example of what I am looking to use this for is for remote virus
scanning. So System2 listens, System1 connects and sends it the
Just found this through OSNews:
http://rpyc.sourceforge.net/
It actually seems to be a perfect fit for your job.
Lorenzo
--
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi list,
I'm writing a little module to calculate the size of given objects, I
just need a few little pointers to get the thing into a useful shape.
Code here: http://dev.gentoo.org/~port001/Code/PySizeof/
The points I'm confused about are:
1. My
On 2006-02-11, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I am relatively new to Python, and wanted to see if this is
even possible, and if so how to go about implementing it.
What I'm looking to do is create a client/server application
that does the following:
1) System2 listens on port
linda.s [EMAIL PROTECTED] writes:
where to download numpy for Python 2.3 in Mac?
Thanks!
Linda
I don't know if anybody's specifically compiled for 2.3; I think most
of the developers on mac are using 2.4 :-)
But (assuming you have the developer tools installed) it's really to
compile: python
Hello,
I'm reading Text processing in Python by David Mertz. In there he
defines a function
apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns))
I thought that this would be equivalent to:
apply_each = lambda fns, args=[]: [f(args) for f in fns]
Can anybody confirm this? If
Very close... it is equivalent to:
apply_each = lambda fns, args=[]: [f(*args) for f in fns]
The asterisk in f(*args) expands the sequence to fill the arguments to
f, where as f(args) would pass the args as only the first argument to
the function.
apply is deprecated, replaced by the
Got it! Thanks for your time.
--
http://mail.python.org/mailman/listinfo/python-list
Got it! Thanks for your time.
--
http://mail.python.org/mailman/listinfo/python-list
Using the (non-standard yet) path module
(http://www.jorendorff.com/articles/python/path/), your code can be
simplified to:
from path import path, copy
def copy_first_match(repository, filename, dest_dir):
try:
first_match = path(repository).walkfiles(filename).next()
except
Steven,
Thank you very much for your insights. They are quite helpful.
S
--
http://mail.python.org/mailman/listinfo/python-list
Thanks! Now, I'm a bit confused as to exactly how it works - will it
display the output of what it executes on the target system? I would
like to create a window in Tktinker to where a user can select options
(such as run scan on remote system) - it would then run the
command-line based scan and
I've used os.popen() before, but if I execute it on a remote system how
could I get the output back to the requesting machine?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
I am relatively new to Python, and wanted to see if this is even
possible, and if so how to go about implementing it. What I'm looking
to do is create a client/server application that does the following:
1) System2 listens on port 1023
2)
Jython 2.2 Alpha 1 supports Java 1.5
Frank.
Kent Johnson wrote:
Mark Fink wrote:
I observed something strange when I tried to compile the jython class:
'assert' is a keyword, and may not be used as an identifier
(try -source 1.3 or lower to use 'assert' as an identifier)
public static
On 2006-02-11, D [EMAIL PROTECTED] wrote:
I've used os.popen() before, but if I execute it on a remote
system how could I get the output back to the requesting
machine?
Write it to the socket?
--
Grant Edwards grante Yow! Where does it go when
On Fri, 10 Feb 2006 19:16:36 -0500,
Kevin Walzer [EMAIL PROTECTED] wrote:
For what it's worth, my application has to run on OS X and Windows,
and will be commercial, so this combination of requirements rules out
PyGTK/PyQt/just about every other cross-platform GUI toolkit.
According to their
Collin Winter wrote:
As always, feedback welcome!
Any specific reason flip only flip the first 2 arguments rather than
the whole tuple ?
That is, I would like to see:
assert(f(a,b,c, d) == flip(f)(d, c, b, a))
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
It is highly unlikely that any judge will be fooled by a mere change in
format (but Your Honour, I converted the TTF file into a bitmap).
If that were true, almost the entire X11 bitmap font collection would
be illegal. Fonts aren't subject copyright, just the hints in
Ross Ridge wrote:
Steven D'Aprano wrote:
It is highly unlikely that any judge will be fooled by a mere change in
format (but Your Honour, I converted the TTF file into a bitmap).
If that were true, almost the entire X11 bitmap font collection would
be illegal. Fonts aren't subject
Dan Sommers wrote:
On Fri, 10 Feb 2006 19:16:36 -0500,
Kevin Walzer [EMAIL PROTECTED] wrote:
For what it's worth, my application has to run on OS X and Windows,
and will be commercial, so this combination of requirements rules out
PyGTK/PyQt/just about every other cross-platform GUI
David M. Cooke [EMAIL PROTECTED] wrote:
linda.s [EMAIL PROTECTED] writes:
where to download numpy for Python 2.3 in Mac?
Thanks!
Linda
I don't know if anybody's specifically compiled for 2.3; I think most
of the developers on mac are using 2.4 :-)
However, what comes with MacOSX is
Renato wrote:
You mentioned using python for web apps: with which framework?
(TurboGears, CherryPy, Subway, Django, whatever) Or only for cgi?
With which web server? (Apache, Twisted, Zope, etc.)
On which linux platform? (Slackware, Debian, Fedora/RedHat, Suse, etc)
I think you'll have
dirvine [EMAIL PROTECTED] wrote:
Thanks but I am a bit unsure as to what error I have made by posting
this question. I am not trying to be funny but can you give me a
pointer to the issue.
The problem is that your question is quite unclear. I suggest that you
post your exact Python code, with
jeffhg582003 [EMAIL PROTECTED] wrote:
I am developing a python script which add records to
a microsoft access tables. All my tables have autogenerated number
fields. I am trying to capture the number generated from the insert but
I am not exactly sure how to do that after an insert.
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Problem:
You have a list of unknown length, such as this: list =
[X,X,X,O,O,O,O]. You want to extract all and only the X's. You know
the X's are all up front and you know that the item after the last X is
an O, or that the list ends with an X.
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
But this seems ugly to me, and using while give me the heebies. Is
there a better approach?
Note that list is the name of a built-in type; I used mylist.
Alex Martelli described how to do it in log n time using the bisect
module. Here's a dumb
On 10 Feb 2006 09:08:28 -0800
Kamilche [EMAIL PROTECTED] wrote:
Let's say I own a font, and use it in a paint program to
'draw some text' on a picture that I slap up on the
Internet. Everything's probably fine, right? But what if I
draw some text on a bitmap on the hard drive, add drop
Lonnie Princehouse wrote:
Why did you want to customize is?
Well, mostly out of principle ;-)
But also because I'm wrapping a C library which passes around C structs
which are wrapped in shim C++ classes for a Boost.Python layer. Boost
Python does a marvelous job of translating between
On Fri, 10 Feb 2006 20:22:07 GMT
John Salerno [EMAIL PROTECTED] wrote:
Can anyone tell me how complicated it might be to install
Python on my server so I can use it for web apps? Is it a
one-time process, or something to maintain?
Installing Python on a server is really, really easy. At
test comp.lang.python
--
http://mail.python.org/mailman/listinfo/python-list
Bugs item #1429063, was opened at 2006-02-10 12:26
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1429063group_id=5470
Please note that this message will contain a full copy of
Bugs item #1429053, was opened at 2006-02-10 12:07
Message generated for change (Comment added) made by kbriggs
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1429053group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1429053, was opened at 2006-02-10 13:07
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1429053group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1429481, was opened at 2006-02-10 19:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1429481group_id=5470
Please note that this message will contain a full copy of
Bugs item #1429481, was opened at 2006-02-10 19:13
Message generated for change (Comment added) made by tim_one
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1429481group_id=5470
Please note that this message will contain a full copy of the comment
101 - 180 of 180 matches
Mail list logo