Hi,
I would probably take the string, separate the numbers and check they
are acceptable:
def correct_ip(ip):
# Check if my IP address has 4 numbers separated by dots
num=ip.split('.')
if not len(num)==4:
return False
# Check each of the 4 numbers is between 0 and 255
for n
Hi,
Look at this:
>>> i=[1,2,3]
>>> i[len(i)]
Traceback (most recent call last):
File "", line 1, in ?
IndexError: list index out of range
This means that I have tried to access an element that is out of the
list, in this case i[3], that is, the 4th element of the list.
You are doing the
Hi,
After python I have to start learning Java.
Do you know of any Tutor-like list for Java you could recommend? I've
been looking and I've been unable to find any... and i miss it :-)
Thanks,
Guille
___
Tutor maillist - Tutor@python.org
http://ma
Nothing to do, but did you think about SimPy?
http://simpy.sourceforge.net/
It may make your life much simpler.
G
On Wed, 23 Feb 2005 11:32:12 -0800 (PST), Danny Yoo
<[EMAIL PROTECTED]> wrote:
>
>
> On Wed, 23 Feb 2005, Shitiz Bansal wrote:
>
> > I am trying to build a traffic network simulator us
Hi,
Don't know if there's any network simulator.
But I know about SimPy:
http://simpy.sourceforge.net/
Looks well documented. Check the examples, it seems you can do pretty
robust things with not toomuch code.
I readed about it in the charming python section of IBM developers works:
http://www-1
Got it.
import copy
def rec(list,length):
result=[]
if len(list)<=length:
return [list]
for elem in list:
temp=copy.deepcopy(list)
temp.remove(elem)
temp=rec(temp,length)
for i in temp:
Hi,
I'm trying to take a list and find all the unique combinations of that list.
I mean:
if I enter (1,2,3,4,5) and I watn combinations of 3, I want to find:
(1,2,3) but then not (2,1,3), (3,1,2),...
(1,2,4)
(1,2,5)
(2,3,5)
(3,4,5)
The thing is, I want to do it as a generic function, where I pas
Hi,
> Does ExFileSelectDialog do anything that the standard Tk file dialogs don't?
> (if you don't know about it: have a look at the tkFileDialog module)
(*Ashamed*)
Indeed not. Well... tkFileDialog is a bit more "bulky" that
ExFileSelectDialot, but the functionalities are alike.
Actually, my Tk
Hi,
> When I tried, I couldn't figure out how to freeze Tix. I ended up giving up
> and
> recoding all my Tix stuff to use Pmw instead...
> (although I was a lot more new to python in those days)
Indeed, I think I'm going to do the same. I find the situation really
surprising though. When I go t
5 23:12:26 -0800 (PST), Chad Crabtree
<[EMAIL PROTECTED]> wrote:
> Try something like.
> import mx
> import Tix
>
> Sometimes py2exe will not gather up all the modules that it depends
> on.
> It does an admirable job but still needs some help. Perhaps you are
> in
Hi,
I've done a GUI program and it works perfectly.
but when I try to package it with py2exe, I obtain the following result:
The following modules appear to be missing
['mx']
And when i run it, it crashes with this error message:
Traceback (most recent call last):
File "openwar.py", line 41, i
wrote:
>
>
> On Thu, 13 Jan 2005, Guillermo Fernandez Castellanos wrote:
>
> > Is there any "table" frame that I am unaware of?
>
>
> Hi Guillermo,
>
> There are some recipes for making a Tkinter table widget; here's one:
>
> http
> > So tkinter is a good module to use if you only want simple widgets,
> > but be prepared to switch to something newer when you hit it's
> limitations.
> This I agree with totally, fortunately I've yet to hit itslimitations
> in my fairly simple GUIs.
Well... there's also Tix... but I don't know
Hi,
I have a table of information that look like this (only 3 lines here):
Gibraltar Division BR INF D 095 59 GAR None 10-7-4-6 Gibraltar
Kuwait Division BR INF D 148 71GAR None 2-1-0-4 Kuwait
Somaliland Division BR INF D 139 84 GAR None 2-1-0-3 None
I would like to show this in a nice
> 1500 entries shouldn't be a problem for queries either using DOM
> (in memory) or XPath or even XQuery. If your app grows to 15
> it might stat to be a problem, and if you get over a million
> entries I'd definitely start thinking about regular RDBMS.
Hi,
No it will not go further... let's s
Hi,
Just out of curiosity,
> > Well, I plan to use it as a data storage format for a university
> > project (crowd simulation in a shopping center -- coded in Java). I
> > hate binary data formats, and XML is a good unified way to store data
> > as ASCII text, so I figured I'd use it.
> >
hi!
> 1. Is there any easy way to compeltely reverse a list so that the last index
> becomes the first, etc.?
The doc is your friend :-)
http://www.python.org/dev/doc/maint24/lib/typesseq-mutable.html
"""s.reverse() reverses the items of s in place"""
>>> a=[1,2,3,4]
>>> a.reverse()
>>>
On Wed, 22 Dec 2004 11:37:57 +0900
> Guillermo Fernandez Castellanos <[EMAIL PROTECTED]> wrote:
> Hi Guille,
> The "command" option should be assigned to the Select widget itself, not to
> the added buttons.
> It takes two arguments then (from the tixSelect man
Hi,
26 years, single, spanish but having lived around Europe,
communication systems engineer, working in Japan now for a year, going
back to europe in April and looking for a job.
I've done mainly network stuff, from system conception to network
programming in C. I've worked in VoIP (SIP, Megaco,
its value"""
http://tix.sourceforge.net/dist/current/docs/tix-book/intro.tex.html#1-11
Thanks,
G
On Tue, 21 Dec 2004 21:28:40 +0100, Michael Lange <[EMAIL PROTECTED]> wrote:
> On Tue, 21 Dec 2004 14:16:56 +0900
> Guillermo Fernandez Castellanos <[EMAIL PROTECTED]>
Hi,
I'm trying to figure out how to work with Tix. The lack of examples
and avalaibility of documentation for TCL only do not help :-(
It does not work because when I start the program, the red and gren
buttons start blinking betweeb 2 or 3 different places, no matter what
the tab is.
Here is th
Hi,
If you want an easy way of iterating over stdin, you may be interested
in using this module:
http://www.python.org/dev/doc/devel/lib/module-fileinput.html
I've used it with some of my scripts to do something similar.
It will not work for a growing file though...
Otherwise, you can always tr
Hi,
On the Vpython homepage they have links to quite a few programs:
http://vpython.org/contributed.html
http://www.physics.syr.edu/%7Esalgado/software/vpython/
Should be enough for a start.
Enjoy,
Guille
On Wed, 8 Dec 2004 22:05:31 -0500 (GMT-05:00),
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wro
Usually, in case of doubt, use a debugger or print statements:
def selection_sort(lst,start,end):
"""sort the lst from selection start to end"""
print lst, start, end
if len(lst)==1:
print "list of size 1"
return lst
elif lst=="":
Hi,
I've been through the unittest tutorial page and I've seen this function:
suite = unittest.makeSuite(Testname,'test')
In the python 2.4 Python Library Reference I have find no reference to
such a fucntion (there is an example, exactly the same but without the
'test' parameter).
I could not r
25 matches
Mail list logo