[EMAIL PROTECTED] wrote:
On Jun 24, 5:38 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote:
In Python 3k I believe you can put a * next to one of the variables to
hold multiple arguments. That'll be aidful!
IDLE 3.0b1
>>> a,b,*c=[1,2,3,4,5]
>>> c
[3, 4, 5]
>>> a,*b,c = [1,2,3,4,5]
>>> b
[2, 3, 4
On Jun 24, 5:38 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote:
> "Andreu" <[EMAIL PROTECTED]> wrote in messagenews:[EMAIL PROTECTED]
> > 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
"Andreu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
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 acc
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.
A
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
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 = "T
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
--
http://mail.python.org/m
Tim Roberts wrote:
> "Iain King" <[EMAIL PROTECTED]> wrote:
> >
> >You probably want:
> >
> >s.sendto('\xff'*6 + ('\x%s\x%s\x%s\x%s\x%s\x%s' % (str01, str02, str03,
> > sttr04, str05, str06))*16, ('192.168.1.255', 80))
>
> You probably should TRY suggestions before you post them. That will get an
"Iain King" <[EMAIL PROTECTED]> wrote:
>
>You probably want:
>
>s.sendto('\xff'*6 + ('\x%s\x%s\x%s\x%s\x%s\x%s' % (str01, str02, str03,
> sttr04, str05, str06))*16, ('192.168.1.255', 80))
You probably should TRY suggestions before you post them. That will get an
"invalid \x escape". \x must be f
[EMAIL PROTECTED] wrote:
> mac_string = '001485e55503' (This is the mac address of a computer.)
> Since the MAC adddress are hexadecimal, how should I go about it here.
>
> Please help, every help is appreciated. Thanks
I could not quite understand what you are trying to achieve, but
it appears
I will try this one too...thanks for your response.
Iain King wrote:
> [EMAIL PROTECTED] wrote:
> > mac_string = '001485e55503' (This is the mac address of a computer.)
> >
> > I am using wake on LAN python script to start computer remote.It uses
> > format like this
> >
> > s.sendto('\xff'*6
Many Thanks!! It worked like a charm.
Fredrik Lundh wrote:
> [EMAIL PROTECTED] wrote:
>
> > mac_string = '001485e55503' (This is the mac address of a computer.)
> >
> > I am using wake on LAN python script to start computer remote.It uses
> > format like this
> >
> > s.sendto('\xff'*6 + '\x0
[EMAIL PROTECTED] wrote:
> mac_string = '001485e55503' (This is the mac address of a computer.)
>
> I am using wake on LAN python script to start computer remote.It uses
> format like this
>
> s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255',
> 80))
>
> where '\x00\x14\x8
[EMAIL PROTECTED] wrote:
> mac_string = '001485e55503' (This is the mac address of a computer.)
>
> I am using wake on LAN python script to start computer remote.It uses
> format like this
>
> s.sendto('\xff'*6 + '\x00\x014\x85\xe5\x55\x03'*16, ('192.168.1.255',
> 80))
>
> where '\x00\x14\x8
Nico Grubert wrote:
> > This sounds like a homework problem. You might try splitting the name
> > at the e's, check the length of the resulting list and do that many
> > nested loops.
>
> This was my idea too but I am wondering if there are any scripts for
> tasks like this.
>
> Nico
def combine
> This sounds like a homework problem. You might try splitting the name
> at the e's, check the length of the resulting list and do that many
> nested loops.
This was my idea too but I am wondering if there are any scripts for
tasks like this.
Nico
--
http://mail.python.org/mailman/listinfo/py
This sounds like a homework problem. You might try splitting the name
at the e's, check the length of the resulting list and do that many
nested loops.
On 1/10/06, Nico Grubert <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I have a string 'Michèle' that represents the firstname of a person.
>
> What
17 matches
Mail list logo