Hi everyone,
I'm happy to announce that GMPY v1.03 has been released.
It is available at: http://code.google.com/p/gmpy/
What is GMPY?
==
GMPY is a C-coded Python extension module that wraps the GMP library
to
provide to Python code fast multiprecision arithmetic (integer,
I'm pleased to announce the first alpha version of anntools, a utility package
for Python 3.0's new function annotation feature. It supports validation,
type checking and conversion. It provides cooperation schemes to achieve
future compatibility with another annotation based tools.
The
Serve Lau wrote:
What is the expected result of -1/2 in python?
Python 3.0b1 (r30b1:64403M, Jun 19 2008, 14:56:09) [MSC v.1500 32 bit
(Intel)]
n win32
Type help, copyright, credits or license for more information.
-1/2
-0.5
as expected ;-)
-1//2 is as Gary Herron specified from the
On Jun 17, 11:54 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Do you know if there is suchXPathengine that can be applied to a DOM-
like structure ?
No. But I toyed with the idea to write one :)
One way would be to take anXPathengine from an existing XML engine
(ElementTree, or any
eliben a écrit :
d = {}
execcode in globals(), d
return d['foo']
My way:
return function(compile(code, 'string', 'exec'), globals())
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
Paddy [EMAIL PROTECTED] wrote:
I monitor changes to the Wikipedia doctest page, and so noticed a
change in the Ruby implementation of doctest.
Scooting around their implementation I found that they have an !!!
special directive that says drop into the interpreter at this point
when testing
On Jun 23, 1:12 pm, Mensanator [EMAIL PROTECTED] wrote:
On Jun 22, 5:43�am, Jonathan Roberts [EMAIL PROTECTED]
wrote:
Hi all,
I'm looking to learn Python (as my first programming language) and I'm
pretty sure I'd be more successful doing this with a group of other
people.
I've
Hi everyone,
I am looking for a python module or something similar which makes use
of the capabilities of the kernel module applesmc to provide support
for the sudden motion sensor in Apple hardware. It should be something
like this:
http://pypi.python.org/pypi/PyAppleSMS/1.0
Would it make sense
Hi,
is this the right group to ask / report problems with python3.0 ?
The question:
Is it possible to tell 2to3 to replace, say,
#!/usr/bin/python
by
#!/usr/local/bin/python3.0
?
Here the bug:
While 2to3 keeps the first line
#!/usr/bin/python
it removes the first line if it was
Le Monday 23 June 2008 09:22:29 Bruno Desthuilliers, vous avez écrit :
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
globals(). This is not exactly what I need.
I possibly messed up a couple
On Jun 19, 6:12 pm, Lie [EMAIL PROTECTED] wrote:
On Jun 19, 4:02 pm, Justin Ezequiel [EMAIL PROTECTED]
wrote:
perhaps change html
body=MIMEText('hello,\r\n
ok',_subtype='html',_charset='windows-1255')
to plain
body=MIMEText('hello,\r\n
Hi
Given the following two files in the same directory
Master.py:
--
#!/usr/bin/python
import Slave
Slave.main()
and
Slave.py:
-
def main() :
print Hello World
Invoking Master.py under python-2.5.2
works just fine.
2to3 converts these to
Master.py:
--
from . import
weheh wrote:
I'm running Python 2.3 and calling pyTTS. I've had it working forever.
Today, I ran out of disk space. After deleting some of my personal files,
for no apparent reason, pyTTS no longer runs.
For the statement
tts = pyTTS.Create()
I get the error message:
Mensanator wrote:
On Jun 22, 4:07�pm, Ken Starks [EMAIL PROTECTED] wrote:
weheh wrote:
I don't know if you found this example:
http://www.daniweb.com/code/snippet285.html
Thanks for that. The offerings are very similar to the
algorithms I wrote myself.
It wasn't the solution I was
Preamble: when posting a brand new question, you'd better not replying to
an existing completely unrelated message. In most viewers, this will cause
your message to appear in the thread for the original question and far
less people will see it. So better create a brand new thread.
On Fri,
rych [EMAIL PROTECTED] wrote:
I'm on Windows with VS2005 testing ctypes on a very simple dll
I create a test.dll project which exports a function fntest(). I don't
touch anything in the autogenerated source and build it. I can load
the dll but can't access the function by its name fntest.
I guess it's time to choose what a project your group will work at.
Personally, I'm working at the project relating to text analysis, but
it's rather specific because I use Russian texts. So, maybe we should
to choose more 'international' implementation.
-Ed
--
John Machin wrote:
Instead of sum(a + b for a, b in zip(foo, bar))
why not use sum(foo) + sum(bar)
?
or even sum(foo+bar) as may apply.
Cheers, BB
--
http://mail.python.org/mailman/listinfo/python-list
Maric Michaud a écrit :
Le Monday 23 June 2008 09:22:29 Bruno Desthuilliers, vous avez écrit :
With some help from the guys at IRC I came to realize your way doesn't
do the same. It creates a function that, when called, creates 'foo' on
globals(). This is not exactly what I need.
I possibly
Hi there.
I am reprogrammed my astar* path finding algorithm in C to make it quicker.
I am now trying to make python use this C extension, however I keep
getting Segmentation fault.
Some of the C stuff:
typedef struct Point {
int x;
int y;
} Point;
typedef struct Node {
Jens Henrik Leonhard Jensen [EMAIL PROTECTED] wrote:
Your problem is that open(...,'w') is not locked.
Use something like:
lockf = open('aaa', 'a')
fnctl.flock(lockf,fnctl.LOCK_EX)
file = open('aaa', 'w')
file.write('asdf')
file.close()
lockf.close()
I've not seen that trick
Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit :
John Machin wrote:
Instead of sum(a + b for a, b in zip(foo, bar))
why not use sum(foo) + sum(bar)
?
or even sum(foo+bar) as may apply.
Because some are better than others :
sum(foo+bar) is the worst, it create a
On Jun 23, 9:16 pm, Maric Michaud [EMAIL PROTECTED] wrote:
Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit :
John Machin wrote:
Instead of sum(a + b for a, b in zip(foo, bar))
why not use sum(foo) + sum(bar)
?
or even sum(foo+bar) as may apply.
Because some are
Hi,
I need to write a python script to store data which is in XML to MYSQL and
even vice versa
what should be the approach?
i am able to establish a connection,create tables and insert data .
but how to read an xml file and store in MYSQL
my XML structure is like
list title= xyz, id
hi guys.
I would be glad to join your group because i want to learn deeper
python but i am frustrated of isolation too. It would provide
stimulation and encourage to study and will boost our desire to learn.
So count me in!
--
http://mail.python.org/mailman/listinfo/python-list
On 23 Jun, 10:32, Nick Craig-Wood [EMAIL PROTECTED] wrote:
rych [EMAIL PROTECTED] wrote:
I'm on Windows with VS2005 testing ctypes on a very simple dll
I create a test.dll project which exports a function fntest(). I don't
touch anything in the autogenerated source and build it. I can
Le Monday 23 June 2008 13:51:34 John Machin, vous avez écrit :
On Jun 23, 9:16 pm, Maric Michaud [EMAIL PROTECTED] wrote:
Le Monday 23 June 2008 11:39:44 Boris Borcic, vous avez écrit :
John Machin wrote:
Instead of sum(a + b for a, b in zip(foo, bar))
why not use sum(foo) + sum(bar)
On Jun 21, 12:21 am, David Boddie [EMAIL PROTECTED] wrote:
On Friday 20 June 2008 17:24, Phil Thompson wrote:
On Fri, 20 Jun 2008 08:04:57 -0700 (PDT),Carbonimax
[EMAIL PROTECTED] wrote:
I have a problem with py2exe and QtWebKit :
I make a program with a QtWebKit view.
If I launch the
On Jun 21, 12:21 am, David Boddie [EMAIL PROTECTED] wrote:
On Friday 20 June 2008 17:24, Phil Thompson wrote:
On Fri, 20 Jun 2008 08:04:57 -0700 (PDT), Carbonimax
[EMAIL PROTECTED] wrote:
I have a problem with py2exe and QtWebKit :
I make a program with a QtWebKit view.
If I launch the
On Jun 23, 1:32 am, Serve Lau [EMAIL PROTECTED] wrote:
What is the expected result of -1/2 in python?
Operator precedence:
Both python 2 and 3 follows the same rule for operator precedence,
see: http://www.ibiblio.org/g2swap/byteofpython/read/operator-precedence.html
. In -1/2, unary negative
Hi,
I am using Distutils to build and distribute some packages. I do write
unit tests, but I am confused as to where to put them and how to run
them prior to the package being installed (The modules being tested
would not be in my sys.path). I would rather not put the test cases in
the same files
Knut Saua Mathiesen:
Any help? :p
My faster suggestion is to try ShedSkin, it may help you produce a
fast enough extension.
If ShedSkin doesn't compile it, its author (Mark) may be quite willing
to help.
bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Le Monday 23 June 2008 15:38:40 Joe Riopel, vous avez écrit :
Hi,
I am using Distutils to build and distribute some packages. I do write
unit tests, but I am confused as to where to put them and how to run
them prior to the package being installed (The modules being tested
would not be in my
On Mon, Jun 23, 2008 at 9:59 AM, Cédric Lucantis [EMAIL PROTECTED] wrote:
Yes a checksuite should be kept separate from the 'real' code. You can run it
locally by setting the PYTHONPATH environment variable :
PYTHONPATH=/path/to/your/modules python checksuite.py
So I could also just append
A new open source project has been started by Linden Lab, makers of the
Second Life™ virtual worlds, and the Second Life Architecture Working
Group (AWG) to test LL's proposed virtual worlds Open Grid Protocols
(OGP) that will allow any virtual world to support multi-world login,
between-world
On Mon, Jun 23, 2008 at 9:59 AM, Cédric Lucantis [EMAIL PROTECTED] wrote:
Yes a checksuite should be kept separate from the 'real' code. You can
run it locally by setting the PYTHONPATH environment variable :
PYTHONPATH=/path/to/your/modules python checksuite.py
So I could also just
I have just installed PyOpenGL and get a
series of warning messages:
Best match: PyOpenGL 3.0.0b3
Downloading
http://downloads.sourceforge.net/pyopengl/PyOpenGL-3.0.0b3.zip?modtime=1213363873big_mirror=0
Processing PyOpenGL-3.0.0b3.zip
Running PyOpenGL-3.0.0b3\setup.py -q
bdist_egg
I want to split a sentence and assign each word to a variable.
In Ruby I can do it as:
v1,v2,v3,v4,v5 = str1.split
Which will be the Python equivalent ? Thanks.
Andrew.
--
http://mail.python.org/mailman/listinfo/python-list
Andreu wrote:
I want to split a sentence and assign each word to a variable.
In Ruby I can do it as:
v1,v2,v3,v4,v5 = str1.split
Which will be the Python equivalent ? Thanks.
That would be:
str1 = The quick brown fox jumps
v1, v2, v3, v4, v5 = str1.split ()
TJG
--
Wow...about ten seconds to get a kind response
Thanks Tim.
Andrew.
Tim Golden wrote:
Andreu wrote:
I want to split a sentence and assign each word to a variable.
In Ruby I can do it as:
v1,v2,v3,v4,v5 = str1.split
Which will be the Python equivalent ? Thanks.
That would be:
str1 =
Hi all.
I'd like learn some basic unit testing with python.
I red some articles about different testing framework like unittest or
nose, but I'm a bit confused: what is the best choice? I'm not a
professional developer (I'm a SEO) but I belive that unit testing is a
good and pragmatic way to
Lie [EMAIL PROTECTED] wrote:
On Jun 23, 1:32 am, Serve Lau [EMAIL PROTECTED] wrote:
What is the expected result of -1/2 in python?
Operator precedence:
Both python 2 and 3 follows the same rule for operator precedence,
see:
On Jun 23, 4:45 pm, Andreu [EMAIL PROTECTED] wrote:
I want to split a sentence and assign each word to a variable.
In Ruby I can do it as:
v1,v2,v3,v4,v5 = str1.split
Which will be the Python equivalent ? Thanks.
Andrew.
Well a straight copy would be...
example = Hello, how are you
v1,
On Jun 22, 10:13 pm, abranches [EMAIL PROTECTED] wrote:
Hello everyone.
I'm having a problem when extracting data from HTML with regular
expressions.
This is the source code:
You are ready in the nextbr /span id=counter_jt_minutes
style=display: inline;span id=counter_jt_minutes_value12/
Hi all,
I've always wondered why os.kill isn't supported on Windows. I found a
discussion somewhere from 2006 about this so it seems others have
wanted it, but still nothing. So I have a half-baked solution
involving calling taskkill on Windows Vista or tskill on Windows
XP via the shell. I feel
May I ask a simple newbie question, which I presume is true, but for
which I can't readily find confirmation:
Let's say I have a parent class with an __init__ method explicitly
defined:
class ParentClass(object):
def __init__(self, keyword1, keyword2):
etc
and I subclass
Let's see these simple classes:
class base_foo()
pass
class foo(base_foo):
a=1
b={}
c=zz
I would like to find class foo attributes creation order.
Using __metaclass__ is not of help because special method __new__
receive attrs as a dictionary and so
John Dann a écrit :
May I ask a simple newbie question, which I presume is true, but for
which I can't readily find confirmation:
Let's say I have a parent class with an __init__ method explicitly
defined:
class ParentClass(object):
def __init__(self, keyword1, keyword2):
John Dann wrote:
May I ask a simple newbie question, which I presume is true, but for
which I can't readily find confirmation:
Let's say I have a parent class with an __init__ method explicitly
defined:
class ParentClass(object):
def __init__(self, keyword1, keyword2):
I had a guy on this mailing list tell me that pyQT is much better than
Tkinter, and after looking into it a bit I think he is right. However,
I can't find much on it. I want to know if there are any good books or
online tutorials that would be helpful. I doubt there is one, but if
there is
Le Monday 23 June 2008 17:53:07 Marcob, vous avez écrit :
Let's see these simple classes:
class base_foo()
pass
class foo(base_foo):
a=1
b={}
c=zz
I would like to find class foo attributes creation order.
Using __metaclass__ is not of help
Hello,
I have programmed before, but I am new to using Python. I am
currently using the ArcGIS software which uses Python as its scripting
language for automating tasks.
The current script that I am working on requires pulling in some
information from a Microsoft SQL Server.
I was wondering if
is there an IDE for python of the same quality as Eclipse or DEVC++?
I am currently using the editor that coems iwth python and it is all
fine but for bigger projects it would be nice to have some way to
easier browse the projectfiles for example.
--
On 23 Giu, 18:08, Cédric Lucantis [EMAIL PROTECTED] wrote:
Le Monday 23 June 2008 17:53:07 Marcob, vous avez écrit :
Let's see these simple classes:
class base_foo()
pass
class foo(base_foo):
a=1
b={}
c=zz
I would like to find class
On Jun 23, 5:53 pm, Marcob [EMAIL PROTECTED] wrote:
Let's see these simple classes:
class base_foo()
pass
class foo(base_foo):
a=1
b={}
c=zz
I would like to find class foo attributes creation order.
Using __metaclass__ is not of help because
2008/6/23 cirfu [EMAIL PROTECTED]:
is there an IDE for python of the same quality as Eclipse or DEVC++?
I am currently using the editor that coems iwth python and it is all
fine but for bigger projects it would be nice to have some way to
easier browse the projectfiles for example.
Actually,
cirfu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
is there an IDE for python of the same quality as Eclipse or DEVC++?
I am currently using the editor that coems iwth python and it is all
fine but for bigger projects it would be nice to have some way to
easier browse the
Hi All,
How do I format printed data in python?
I could not find this in the Python Reference Manual:
http://docs.python.org/ref/print.html
Nor could I find it in Matloff's great tutorial:
http://heather.cs.ucdavis.edu/~matloff/Python/PythonIntro.pdf
For example, how do I turn this:
512 Jun 5
Thanks for the responses - they're much appreciated. And I understand
the slight impatience with questions that could possibly be answered
without recourse to a forum - I'm usually in the opposite position of
fielding many newbie questions in a forum in a completely different
field!
But don't be
Generally speaking, what tools would I use to do this? Is there a built-in
module for it? I looked at the telnetlib module, but the documentation
wasn't really complete enough for me to get a good idea of it. Is Telnet and
SSH even the same thing?
Basically, I want to write a script that will
Alex Bryan a écrit :
I had a guy on this mailing list tell me that pyQT is much better than
Tkinter, and after looking into it a bit I think he is right. However, I
can't find much on it. I want to know if there are any good books or
online tutorials that would be helpful. I doubt there is
format the strings:
http://www.python.org/doc/2.1.3/lib/typesseq-strings.html
[EMAIL PROTECTED] wrote:
Hi All,
How do I format printed data in python?
I could not find this in the Python Reference Manual:
http://docs.python.org/ref/print.html
Nor could I find it in Matloff's great tutorial:
On Mon, 23 Jun 2008 13:30:55 -0400, John Salerno [EMAIL PROTECTED] wrote:
Generally speaking, what tools would I use to do this? Is there a built-in
module for it? I looked at the telnetlib module, but the documentation
wasn't really complete enough for me to get a good idea of it. Is Telnet and
On Jun 23, 12:12 pm, [EMAIL PROTECTED] wrote:
Hi All,
How do I format printed data in python?
I could not find this in the Python Reference
Manual:http://docs.python.org/ref/print.html
Nor could I find it in Matloff's great
i installed python 3.0. now when im laucnhing from the dos prompt in
win vista it searches in python3.0
i want to rebind it to 2.5, what do i need to change?
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 23, 12:47 pm, Mensanator [EMAIL PROTECTED] wrote:
On Jun 23, 12:12 pm, [EMAIL PROTECTED] wrote:
Hi All,
How do I format printed data in python?
I could not find this in the Python Reference
Manual:http://docs.python.org/ref/print.html
Nor could I find it in Matloff's great
i downloaded the extension for eclipse, nice.
any opinions of netbeans vs eclipse for python?
--
http://mail.python.org/mailman/listinfo/python-list
The first time i start the shell it always works. But often after
closing it and restarting it I get:
Two windows pops up and the shell, after clicking the windows the
shell just closes by itself.
socket error: connection refused
IDLE's subprocess didnt make connection.
im using python 2.5.1
John Salerno [EMAIL PROTECTED] wrote:
Generally speaking, what tools would I use to do this? Is there a built-in
module for it?
There's paramiko (q.g.). I can't personally vouch for it, but it seems
popular... It seems to depend on a separate crypto library.
Is Telnet and SSH even the
John Salerno wrote:
Generally speaking, what tools would I use to do this? Is there a built-in
module for it?
I've had a very nice experience using the 3rd-party package paramiko for
ssh communication. There's nothing in the standard library that I know of.
I looked at the telnetlib module,
Jeffrey Froman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Be careful, this procedure sounds potential risky, security-wise ;-)
I guess a blanket process might be a tad risky, but don't you want all CGI
files to be executable by all?
--
I don't know this list is the right place for newbie questions. I try
to implement insertion sort in pyhton. At first code there is no
problem. But the second one ( i code it in the same pattern i think )
doesn't work. Any ideas ?
def
[EMAIL PROTECTED] wrote:
I have programmed before, but I am new to using Python. I am
currently using the ArcGIS software which uses Python as its scripting
language for automating tasks.
The current script that I am working on requires pulling in some
information from a Microsoft SQL Server.
It's a security conflict. You should be able to run it again and have
it work. Our company's cisco does the same thing (even after we
approve the app)
--
http://mail.python.org/mailman/listinfo/python-list
On 23 Juni, 20:55, [EMAIL PROTECTED] wrote:
It's a security conflict. You should be able to run it again and have
it work. Our company's cisco does the same thing (even after we
approve the app)
doesnt work but i found out i should open the task manager and kill
all the python processes, then
A good starting point is Mark Pilgrim's Dive Into Python.
http://www.diveintopython.org/unit_testing/index.html
Josh
On Jun 23, 7:55 am, Alex [EMAIL PROTECTED] wrote:
Hi all.
I'd like learn some basic unit testing with python.
I red some articles about different testing framework like
On Jun 23, 6:53 pm, cirfu [EMAIL PROTECTED] wrote:
i installed python 3.0. now when im laucnhing from the dos prompt in
win vista it searches in python3.0
i want to rebind it to 2.5, what do i need to change?
Reinstalling 2.5 should work.
Michael Foord
http://www.ironpythoninaction.com/
--
Hi all.
I'd like learn some basic unit testing with python.
I red some articles about different testing framework like unittest or
nose, but I'm a bit confused: what is the best choice? I'm not a
professional developer (I'm a SEO) but I belive that unit testing is a
good and pragmatic way
Michael Torrie [EMAIL PROTECTED]:
Pete Kirkham wrote:
2008/6/21 Val-Amart [EMAIL PROTECTED]:
Use PyQt. You will gain great portability +all the functionality built
in qt.
You can try PyGTK also, though i wont recommend it.
Why would you not recommend it? I've been using it for a mall
On Jun 21, 7:52 am, Peter Otten [EMAIL PROTECTED] wrote:
eliben wrote:
On Jun 20, 2:44 pm, Peter Otten [EMAIL PROTECTED] wrote:
eliben wrote:
Additionally, I've found indentation to be a problem in such
constructs. Is there a workable way to indent the code at the level of
cirfu wrote:
i installed python 3.0. now when im laucnhing from the dos prompt in
win vista it searches in python3.0
i want to rebind it to 2.5, what do i need to change?
When you install any Python on Windows with the .msi installer, there is
a box something like
[x] make this the
Alex Bryan [EMAIL PROTECTED]:
I had a guy on this mailing list tell me that pyQT is much better than
Tkinter, and after looking into it a bit I think he is right. However,
I can't find much on it. I want to know if there are any good books or
online tutorials that would be helpful. I doubt
Before the inevitable response comes, let me assure you I've read
through the posts from Guido about this. 7 years ago Guido clearly
expressed a displeasure with allowing these methods for tuple. Let me
lay out (in a fresh way) why I think we should reconsider.
1) It's counterintuitive to exclude
On Monday 23 June 2008 15:02, Carbonimax wrote:
If I copy the dll in the dist directory, and I use QPluginLoader() and
load(),
it does work in the .py but it doesn't in .exe made with py2exe
my code :
dll = QPluginLoader(path_to_dll)
res = dll.load()
res == true in the .py
res ==
On 2008-06-23, John Salerno [EMAIL PROTECTED] wrote:
Generally speaking, what tools would I use to do this?
In shell scripts I use expect to automate ssh stuff, so I would
probably give pyexpect or pexpect a try:
http://sourceforge.net/projects/pexpect/
Is there a built-in module for it? I
never mind... a coworker pointed me to this
http://bugs.python.org/issue1696444
apparently they're there in py3k...
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
I guess a blanket process might be a tad risky, but don't you want all CGI
files to be executable by all?
Typically, I prefer CGI scripts to be executable only the owner. If the web
server runs those scripts as a different user, then that user must also be
permitted to
Helmut Jarausch wrote:
Hi,
is this the right group to ask / report problems with python3.0 ?
While the general Python list is the right place to discuss bugs it's
not sensible to report them here. Most Python core developers except
Martin, me and a few more aren't reading this list at all.
python_newbie wrote:
I don't know this list is the right place for newbie questions.
It is. We get them all the time. There is also a tutor mailing list.
I try to implement insertion sort in pyhton.
python
At first code there is no problem.
It is pretty straightforward.
But the
Helmut Jarausch wrote:
is this the right group to ask / report problems with python3.0 ?
It is certainly a place. Given the number of bogus bug reports on
bugs.python.org, asking here is often a good idea. In this and your
other post, the problems you report look like probable bugs to
Helmut Jarausch wrote:
Now, when I invoke Master.py I get
Traceback (most recent call last):
File Master.py, line 2, in module
from . import Slave
ValueError: Attempted relative import in non-package
thanks for looking into it,
The cause of the bug is in fixes/fix_import.py
On Jun 23, 1:24 am, Josip [EMAIL PROTECTED] wrote:
Why not make it a function?
function assignLimited(value, vmin, vmax):
value = max(vmin, value)
value = min(vmax, value)
return value
a = assignLimited(7, 0, 10)
Seems like it solves your problem relatively cleanly.
On Jun 23, 1:24 am, Josip [EMAIL PROTECTED] wrote:
Why not make it a function?
function assignLimited(value, vmin, vmax):
value = max(vmin, value)
value = min(vmax, value)
return value
a = assignLimited(7, 0, 10)
Seems like it solves your problem relatively cleanly.
On Jun 23, 11:52 am, python_newbie [EMAIL PROTECTED] wrote:
I don't know this list is the right place for newbie questions. I try
to implement insertion sort in pyhton. At first code there is no
problem. But the second one ( i code it in the same pattern i think )
doesn't work. Any ideas ?
Jeffrey Froman wrote:
Also note that all .py files on my web server is not necessarily
restricted to CGI scripts -- and therein lies the real gist of my
cautionary note.
Yeah, I realized that afterwards. Good point. I was assuming all my
executable files would be CGI, but that's not a good
On 23 Giu, 21:26, Josip [EMAIL PROTECTED] wrote:
Hi all.
I'd like learn some basic unit testing with python.
I red some articles about different testing framework like unittest or
nose, but I'm a bit confused: what is the best choice? I'm not a
professional developer (I'm a SEO) but I
On Mon, Jun 23, 2008 at 2:55 PM, Alex [EMAIL PROTECTED] wrote:
Hi all.
I'd like learn some basic unit testing with python.
I red some articles about different testing framework like unittest or
nose, but I'm a bit confused: what is the best choice? I'm not a
professional developer (I'm a
I need to extract prices froma html-document.
[0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt
really matter and it is unlikely anyway to appear a $sign with no
price attahced to it I still want to prevent it.
How do I avoid matching $? It has to be nbr$.
--
2008/6/24, cirfu [EMAIL PROTECTED]:
I need to extract prices froma html-document.
[0-9]*\$ matches 112$ 45$ etc but also just a $. why that shouldnt
really matter and it is unlikely anyway to appear a $sign with no
price attahced to it I still want to prevent it.
How do I avoid matching $?
Yes, ... don't ask me why, but in fact v1,v2,v3 = str1.split()
does not seem to work. My original problem was I forgot about
the parenthesis as Tim point out. So I ended up converting to a
list as in: v = str1.split() and accessing the elements using
v[0] v[1] ect...it is working now. Thanks.
1 - 100 of 188 matches
Mail list logo