On Sun, 11 Aug 2019 12:50:29 -0400, slefkowitz wrote:
> Just getting started with Python.
>
> Downloaded 3.7.4 rom python.org
>
> I wrote program in Notepad, saved it with a ".py" extension.
>
> What do I do next? How do I execute a program?
I am assuming you are using Windows since you poste
Just getting started with Python.
Downloaded 3.7.4 rom python.org
I wrote program in Notepad, saved it with a ".py" extension.
What do I do next? How do I execute a program?
--
https://mail.python.org/mailman/listinfo/python-list
at 9:42 PM, boB Stepp wrote:
> >>> On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak
> >>> wrote:
> >>>> Hi to all
> >>>>
> >>>> I have a beginner question to which I have not found an answer I was able
> >>>&g
Steven,
On Thu, Jun 2, 2016 at 1:20 AM, Steven D'Aprano
wrote:
> On Thursday 02 June 2016 14:21, Igor Korot wrote:
>
>> Hi, guys,
>>
>> On Wed, Jun 1, 2016 at 9:42 PM, boB Stepp wrote:
>>> On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak
>>> wrote:
>
That linked help clear up my confusion...yes you really have to know how things
work internally to understand why things happen the way they happen.
Thanks again to all
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday 02 June 2016 14:21, Igor Korot wrote:
> Hi, guys,
>
> On Wed, Jun 1, 2016 at 9:42 PM, boB Stepp wrote:
>> On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak
>> wrote:
>>> Hi to all
>>>
>>> I have a beginner question to which I have not foun
Hi, guys,
On Wed, Jun 1, 2016 at 9:42 PM, boB Stepp wrote:
> On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak
> wrote:
>> Hi to all
>>
>> I have a beginner question to which I have not found an answer I was able to
>> understand. Could someone explain why the follo
On Thursday 02 June 2016 10:55, Marcin Rak wrote:
> Hi to all
>
> I have a beginner question to which I have not found an answer I was able to
> understand. Could someone explain why the following program:
>
> def f(a, L=[]):
> L.append(a)
> return L
The d
On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak wrote:
> Hi to all
>
> I have a beginner question to which I have not found an answer I was able to
> understand. Could someone explain why the following program:
>
> def f(a, L=[]):
> L.append(a)
> return L
>
Hi to all
I have a beginner question to which I have not found an answer I was able to
understand. Could someone explain why the following program:
def f(a, L=[]):
L.append(a)
return L
print(f(1))
print(f(2))
print(f(3))
gives us the following result:
[1]
[1,2]
[1,2,3]
How can this
> from kivy.app import App
> from kivy.uix.label import Label
>
> class MyApp(App):
> def build(self):
> return Label(text='Hello World')
>
> if __name__ == '__main__':
> MyApp().run()
>
>
>
> I get this error when I run it:
>
>
> Traceback (most recent call last):
> File
> Unindent the 'if' statement. Currently, it's indented inside the class
> definition, so MyApp isn't defined yet.
Thanks very much. That fixed it.
Best regards
David
--
https://mail.python.org/mailman/listinfo/python-list
On 2015-01-28 11:10, David Aldrich wrote:
Hi
I am just getting started with Python 3.3.3 and Kivy 1.8.
I am using the Kivy development environment on Windows (open a command prompt
and call kivy.bat).
With this minimal code:
import kivy
kivy.require('1.8.0')
from kivy.app import App
from k
Hi
I am just getting started with Python 3.3.3 and Kivy 1.8.
I am using the Kivy development environment on Windows (open a command prompt
and call kivy.bat).
With this minimal code:
import kivy
kivy.require('1.8.0')
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App)
On Fri, 09 Aug 2013 16:34:48 -0700, eschneider92 wrote:
> What does global mean?
Hi eschneider92,
A few bits of advice:
- You may like to actually sign your emails with a real name, or at least
an alias that you want to be called, otherwise we'll just call you by
your email address, and apar
On 10 August 2013 00:34, wrote:
> What does global mean?
Python has "scopes" for its variables. Most programming languages do.
A "scope" is a restriction on where variables exist -- they exist only
within the scope.
This can be seen in this example:
def function():
# A new "scope"
I'm sorry, but I still don't understand how it applies to my problem. Thanks
for everyone's patience.
--
http://mail.python.org/mailman/listinfo/python-list
On 10/08/2013 00:40, eschneide...@comcast.net wrote:
(I forgot to post this with my last post.)
Also, I don't understand any part of the following example, so there's no
specific line that's confusing me. Thanks for the help btw.
You don't understand _any_ of it?
> var = 42
Here you're assi
(I forgot to post this with my last post.)
Also, I don't understand any part of the following example, so there's no
specific line that's confusing me. Thanks for the help btw.
var = 42
def myfunc():
var = 90
print "before:", var
myfunc()
print "after:", var
def myfunc():
globa
(I forgot to post this with my last post.)
Also, I don't understand any part of the following example, so there's no
specific line that's confusing me. Thanks for the help btw.
var = 42
def myfunc():
var = 90
print "before:", var
myfunc()
print "after:", var
def myfunc():
glo
What does global mean?
--
http://mail.python.org/mailman/listinfo/python-list
On 10 August 2013 00:14, wrote:
> I don't understand any of the advice any of you have given.
What about it don't you understand? Pick a sentence you don't
understand and throw it back at us. If you understand all the
sentences but not how they come together, say so. If there's a leap
that you d
Thanks, though me not utilizing any of the other advice wasn't from lack of
trying; I couldn't understand any of it. I get it now that I have a corrrect
example code in front of me.
--
http://mail.python.org/mailman/listinfo/python-list
I don't understand any of the advice any of you have given.
--
http://mail.python.org/mailman/listinfo/python-list
On 9 August 2013 23:27, wrote:
> This is what I ended up with btw. Does this insult anyone's more well attuned
> Python sensibilities?
...
Yes.
You didn't listen to any of the advice we've been giving you. You've
had *much* better answers given than this.
Start from the top.
We need letter
This is what I ended up with btw. Does this insult anyone's more well attuned
Python sensibilities?
letters='abcdefghijkl'
def repeat():
print('wanna go again?')
batman=input()
if batman in ('y','yes'):
main()
else:
return
def main():
print('guess a letter')
This is what I ended up with btw. Does this insult anyone's more well-attuned
Pythonic sensibilities?
letters='abcdefghijkl'
def repeat():
print('wanna go again?')
batman=input()
if batman in ('y','yes'):
main()
else:
return
def main():
print('guess a
Le jeudi 8 août 2013 22:29:00 UTC+2, Terry Reedy a écrit :
> On 8/8/2013 7:41 AM, Chris Angelico wrote:
>
> > On Thu, Aug 8, 2013 at 7:20 AM, wrote:
>
> > def z2():
>
> >> ... letters = 'abc'
>
> >> ... while True:
>
> >> ... c = input('letter: ')
>
> >> ... if c
On 8/8/2013 7:41 AM, Chris Angelico wrote:
On Thu, Aug 8, 2013 at 7:20 AM, wrote:
def z2():
... letters = 'abc'
... while True:
... c = input('letter: ')
... if c not in letters:
... print('end, fin, Schluss')
... break
... else:
...
On Thu, Aug 8, 2013 at 7:20 AM, wrote:
def z2():
> ... letters = 'abc'
> ... while True:
> ... c = input('letter: ')
> ... if c not in letters:
> ... print('end, fin, Schluss')
> ... break
> ... else:
> ... print('do stuff')
Le mercredi 7 août 2013 10:17:21 UTC+2, eschne...@comcast.net a écrit :
> I'm trying to create an option for the program to repeat if the user types
> 'y' or 'yes', using true and false values, or otherwise end the program. If
> anyone could explain to me how to get this code working, I'd appreci
On 08/07/2013 01:17 AM, eschneide...@comcast.net wrote:
I'm trying to create an option for the program to repeat if the user types 'y'
or 'yes', using true and false values, or otherwise end the program. If anyone
could explain to me how to get this code working, I'd appreciate it.
letters='ab
eschneide...@comcast.net wrote:
> What I wanted to happen is when the user typed something other than 'y' or
> 'yes' after being asked 'go again?', the batman==False line would cause the
> program to stop asking anything and say 'this is the end'. Instead, what is
> happening is that the progra
What I wanted to happen is when the user typed something other than 'y' or
'yes' after being asked 'go again?', the batman==False line would cause the
program to stop asking anything and say 'this is the end'. Instead, what is
happening is that the program just keeps going. I figured that after
On 7 August 2013 09:17, wrote:
> I'm trying to create an option for the program to repeat if the user types
> 'y' or 'yes', using true and false values, or otherwise end the program. If
> anyone could explain to me how to get this code working, I'd appreciate it.
Always tell people what in par
I'm trying to create an option for the program to repeat if the user types 'y'
or 'yes', using true and false values, or otherwise end the program. If anyone
could explain to me how to get this code working, I'd appreciate it.
letters='abcdefghijklmn'
batman=True
def thingy():
print('type le
Thanks that helped a lot!
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-08-06 14:35, eschneide...@comcast.net wrote:
> Why won't the 'goodbye' part of this code work right? it prints 'ok' no
> matter what is typed. Much thanks.
"if" statements do not fall through, because the first statement was matched,
no other ones in the same chain will be evaluted.
"elif
On Tue, 06 Aug 2013 22:35:44 +0100, wrote:
Why won't the 'goodbye' part of this code work right? it prints 'ok' no
matter what is typed. Much thanks.
def thing():
print('go again?')
goagain=input()
if goagain=='y' or 'yes':
This line doesn't do what you think it does :-) Typin
On Tue, Aug 6, 2013 at 10:35 PM, wrote:
> Why won't the 'goodbye' part of this code work right? it prints 'ok' no
> matter what is typed. Much thanks.
>
> def thing():
> print('go again?')
> goagain=input()
> if goagain=='y' or 'yes':
> print('ok')
> elif goagain!='y' or
eschneide...@comcast.net wrote:
> Why won't the 'goodbye' part of this code work right? it prints 'ok' no
> matter what is typed. Much thanks.
>
> def thing():
> print('go again?')
> goagain=input()
> if goagain=='y' or 'yes':
This expression doesn't do what you think. The compariso
Why won't the 'goodbye' part of this code work right? it prints 'ok' no matter
what is typed. Much thanks.
def thing():
print('go again?')
goagain=input()
if goagain=='y' or 'yes':
print('ok')
elif goagain!='y' or 'yes':
print('goodbye')
sys.exit()
thing()
On Wednesday, June 19, 2013 11:47:36 AM UTC-2:30, Rick Johnson wrote:
> On Tuesday, June 18, 2013 9:47:34 PM UTC-5, andrew...@gmail.com wrote:
>
>
>
> > I'm looking at developing a program for work that can be
>
> > distributed to others (i.e. and exe file). The
>
> > application would open v
On Tuesday, June 18, 2013 9:47:34 PM UTC-5, andrew...@gmail.com wrote:
> I'm looking at developing a program for work that can be
> distributed to others (i.e. and exe file). The
> application would open various dialogue boxes and ask the
> user for input and eventually perform mathematical
> cal
On Wed, Jun 19, 2013 at 2:57 PM, Oscar Benjamin
wrote:
> On 19 June 2013 14:14, wrote:
>> This sounds similar to what I might want. So you know of any online
>> tutorials for this?
>
> It's hard to tell what you're referring to since you haven't included
> any quoted context in your message (li
On 19 June 2013 14:14, wrote:
> This sounds similar to what I might want. So you know of any online tutorials
> for this?
It's hard to tell what you're referring to since you haven't included
any quoted context in your message (like I have above). I'll assume
you're referring to what Fábio said
This sounds similar to what I might want. So you know of any online tutorials
for this?
--
http://mail.python.org/mailman/listinfo/python-list
As I've said, I'm a fairly novice. I've compiled simple VB programs previously
into exe files for use but nothing with pyton and nothing of this complexity.
This application could potentially be distributed to hundreds of people
throughout the world as our company is worldwide. Asking these peop
On 19 Jun 2013 12:56, "Oscar Benjamin" wrote:
>
> On 19 June 2013 12:13, wrote:
> >
> > I've seen some information on Blender. Is it possible to have the
entire program contained within a single exe (or exe and some other files)
so that it can be passed around and used by others without having
On 19 June 2013 12:13, wrote:
>
> I've seen some information on Blender. Is it possible to have the entire
> program contained within a single exe (or exe and some other files) so that
> it can be passed around and used by others without having to install blender?
I don't know if Blender woul
On Wednesday, June 19, 2013 3:30:41 AM UTC-2:30, Christian Gollwitzer wrote:
> Am 19.06.13 04:47, schrieb andrewblun...@gmail.com:
>
> > However, for one part of the program I'd like to be able to create a
>
> > 3D model based on the user input. The model would be very basic
>
> > consisting of
On Wednesday, June 19, 2013 12:50:52 AM UTC-2:30, Steven D'Aprano wrote:
> On Tue, 18 Jun 2013 19:47:34 -0700, andrewblundon wrote:
>
>
>
> > However, for one part of the program I'd like to be able to create a 3D
>
> > model based on the user input. The model would be very basic consisting
>
Am 19.06.13 04:47, schrieb andrewblun...@gmail.com:
However, for one part of the program I'd like to be able to create a
3D model based on the user input. The model would be very basic
consisting of a number of lines and objects. We have 3D models of
each component within our CAD system so it w
On Tue, 18 Jun 2013 19:47:34 -0700, andrewblundon wrote:
> However, for one part of the program I'd like to be able to create a 3D
> model based on the user input. The model would be very basic consisting
> of a number of lines and objects. We have 3D models of each component
> within our CAD sy
Hi there,
Sorry for the complete beginner question but I thought the readers here might
be able to provide me with some guidance.
I've done some programming with Visual Basic and VBA plus a little PHP, CSS and
HTML. I'm looking at developing a program for work that can be dist
On Tue, Jun 4, 2013 at 9:53 PM, Carlos Nepomuceno
wrote:
> Are there any benefits from using dict() instead of {}?
Not for what you're doing, but you can use dict() with an iterable.
Most of the time, use the literal.
ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
Sorry for the delay in replying.
On Tue, 04 Jun 2013 15:51:38 +0300, Carlos Nepomuceno wrote:
>> [1] Technically it's a type, not a function, but the difference makes
>> no difference here.
> Can you explain me the difference of the type and function you've just
> mentioned?
We were talking ab
Thanks everyone!
--
http://mail.python.org/mailman/listinfo/python-list
On 06/04/2013 08:21 AM, mstagliamonte wrote:
Hi everyone,
I am a beginner in python and trying to find my way through... :)
I am writing a script to get numbers from the headers of a text file.
If the header is something like:
h01 = ('>scaffold_1')
I just use:
h01.lstrip('>scaffold_')
and this
On 06/04/2013 12:01 PM, Mark Lawrence wrote:
On 04/06/2013 16:49, mstagliamonte wrote:
[strip the double line spaced nonsense]
Can you please check your email settings. It's bad enough being plagued
with double line spaced mail from google, having it come from yahoo is
just adding insult to in
On 4 June 2013 04:39, wrote:
> Is there a more efficient way of doing this? Any help is gratly appreciated.
>
>
> import random
> def partdeux():
> print('''A man lunges at you with a knife!
> Do you DUCK or PARRY?''')
> option1=('duck')
> option2=('parry')
> optionsindex=[option1
On 06/04/2013 07:53 AM, Carlos Nepomuceno wrote:
>On 4 Jun 2013 12:28, "Carlos Nepomuceno" wrote:
> [...]
> >> What's going on? Is there a way to make dict() to resolve the
variables?
> >Well yes.
> >dict(**{a:0,b:1})
> >The dict() constructor makes a dictionary from keyword arguments. So
y
Thanks to everyone! I didn't expect so many replies in such a short time!
Regards,
Max
--
http://mail.python.org/mailman/listinfo/python-list
On 04/06/2013 16:49, mstagliamonte wrote:
[strip the double line spaced nonsense]
Can you please check your email settings. It's bad enough being plagued
with double line spaced mail from google, having it come from yahoo is
just adding insult to injury, thanks :)
--
"Steve is going for the
In <1829efca-935d-4049-ba61-7138015a2...@googlegroups.com> mstagliamonte
writes:
> Hi everyone,
> I am a beginner in python and trying to find my way through... :)
> I am writing a script to get numbers from the headers of a text file.
> If the header is something like:
> h01 = ('>scaffold_1'
On Tuesday, June 4, 2013 11:48:55 AM UTC-4, MRAB wrote:
> On 04/06/2013 16:21, mstagliamonte wrote:
>
> > Hi everyone,
>
> >
>
> > I am a beginner in python and trying to find my way through... :)
>
> >
>
> > I am writing a script to get numbers from the headers of a text file.
>
> >
>
> > I
mstagliamonte wrote:
> Hi everyone,
>
> I am a beginner in python and trying to find my way through... :)
>
> I am writing a script to get numbers from the headers of a text file.
>
> If the header is something like:
> h01 = ('>scaffold_1')
> I just use:
> h01.lstrip('>scaffold_')
> and this re
On Tuesday, June 4, 2013 11:41:43 AM UTC-4, Fábio Santos wrote:
> On 4 Jun 2013 16:34, "mstagliamonte" wrote:
>
> >
>
> > On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
>
> > > Hi everyone,
>
> > >
>
> > >
>
> > >
>
> > > I am a beginner in python and trying to find my way
On 04/06/2013 16:21, mstagliamonte wrote:
Hi everyone,
I am a beginner in python and trying to find my way through... :)
I am writing a script to get numbers from the headers of a text file.
If the header is something like:
h01 = ('>scaffold_1')
I just use:
h01.lstrip('>scaffold_')
and this re
On 4 Jun 2013 16:34, "mstagliamonte" wrote:
>
> On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
> > Hi everyone,
> >
> >
> >
> > I am a beginner in python and trying to find my way through... :)
> >
> >
> >
> > I am writing a script to get numbers from the headers of a text file.
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
> Hi everyone,
>
>
>
> I am a beginner in python and trying to find my way through... :)
>
>
>
> I am writing a script to get numbers from the headers of a text file.
>
>
>
> If the header is something like:
>
> h01 = ('>sca
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
> Hi everyone,
>
>
>
> I am a beginner in python and trying to find my way through... :)
>
>
>
> I am writing a script to get numbers from the headers of a text file.
>
>
>
> If the header is something like:
>
> h01 = ('>sca
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
> Hi everyone,
>
>
>
> I am a beginner in python and trying to find my way through... :)
>
>
>
> I am writing a script to get numbers from the headers of a text file.
>
>
>
> If the header is something like:
>
> h01 = ('>sca
On Tuesday, June 4, 2013 11:21:53 AM UTC-4, mstagliamonte wrote:
> Hi everyone,
>
>
>
> I am a beginner in python and trying to find my way through... :)
>
>
>
> I am writing a script to get numbers from the headers of a text file.
>
>
>
> If the header is something like:
>
> h01 = ('>sca
Hi everyone,
I am a beginner in python and trying to find my way through... :)
I am writing a script to get numbers from the headers of a text file.
If the header is something like:
h01 = ('>scaffold_1')
I just use:
h01.lstrip('>scaffold_')
and this returns me '1'
But, if the header is:
h02: ('
In article ,
Larry Hudson wrote:
> def partdeux():
> print('A man lunges at you with a knife!')
> option = input('Do you DUCK or PARRY? ').lower()
> success = random.randint(0, 1)
> if success:
> if option == 'duck':
> print('He tumbles over you')
>
> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Beginner question
> Date: Tue, 4 Jun 2013 12:35:59 +
> To: python-list@python.org
>
> On Tue, 04 Jun 2013 14:23:39 +0300, Carlos Nepomuceno wrote:
>
> > Started answering... now I'm asking! lol
>
>
> Awesome! Now I can do it just like that:
>
> >>> dict([(chr(ord('a')+x),x) for x in range(2)])
> {'a': 0, 'b': 1}
>
> Thanks a lot! ;)
>
Or
dict((c, i) for (i, c) in enumerate('ab'))
But at this point you could just use a dict comprehension.
{c: i for i, c in enumerate('ab')}
--
http://mail
On Tue, 04 Jun 2013 14:23:39 +0300, Carlos Nepomuceno wrote:
> Started answering... now I'm asking! lol
>
> I've tried to use dict() to create a dictionary to use like the switch
> statement providing variable names instead of literals, such as:
>
a='A'
b='B'
{a:0,b:1}#here th
> From: steve+comp.lang.pyt...@pearwood.info
> Subject: Re: Beginner question
> Date: Tue, 4 Jun 2013 12:25:27 +
> To: python-list@python.org
>
> On Tue, 04 Jun 2013 14:53:29 +0300, Carlos Nepomuceno wrote:
>
> > That's exactly the same!
> >&g
On Tue, 04 Jun 2013 14:53:29 +0300, Carlos Nepomuceno wrote:
> That's exactly the same!
dict(**{a:0,b:1})=={a:0,b:1}
> True
Of course it is. Isn't that what you wanted?
It's also a waste of time, because you create a dict literal using {},
then unpack it into keyword arguments, then call d
On 4 Jun 2013 12:57, "Carlos Nepomuceno"
wrote:
>
> >On 4 Jun 2013 12:28, "Carlos Nepomuceno"
wrote:
> [...]
>
> >> What's going on? Is there a way to make dict() to resolve the
variables?
> >Well yes.
> >dict(**{a:0,b:1})
> >The dict() constructor makes a dictionary from keyword arguments. So yo
>On 4 Jun 2013 12:28, "Carlos Nepomuceno" wrote:
[...]
>> What's going on? Is there a way to make dict() to resolve the variables?
>Well yes.
>dict(**{a:0,b:1})
>The dict() constructor makes a dictionary from keyword arguments. So you just
>have to feed it keyword arguments using **.
>And if you'
On 4 Jun 2013 12:28, "Carlos Nepomuceno"
wrote:
>
> Started answering... now I'm asking! lol
>
> I've tried to use dict() to create a dictionary to use like the switch
statement providing variable names instead of literals, such as:
>
> >>> a='A'
> >>> b='B'
> >>> {a:0,b:1}#here the variables
Started answering... now I'm asking! lol
I've tried to use dict() to create a dictionary to use like the switch
statement providing variable names instead of literals, such as:
>>> a='A'
>>> b='B'
>>> {a:0,b:1}#here the variables are resolved
{'A': 0, 'B': 1}
That's ok! But if I use dict()
Chris Angelico wrote:
> On Tue, Jun 4, 2013 at 5:57 PM, John Ladasky
> wrote:
>> On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote:
>>
>>> BTW, did I get the logic correctly, the end result is random?
>>
>> You're right! I'm guessing that's not what the OP wants?
>
> I'm guessing th
On 06/03/2013 08:39 PM, eschneide...@comcast.net wrote:
Is there a more efficient way of doing this? Any help is gratly appreciated.
import random
def partdeux():
print('''A man lunges at you with a knife!
Do you DUCK or PARRY?''')
option1=('duck')
option2=('parry')
optionsi
On Tue, Jun 4, 2013 at 5:57 PM, John Ladasky wrote:
> On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote:
>
>> BTW, did I get the logic correctly, the end result is random?
>
> You're right! I'm guessing that's not what the OP wants?
I'm guessing that's exactly what the OP wants. This
> Date: Tue, 4 Jun 2013 00:53:04 -0700
> Subject: Re: Beginner question
> From: john_lada...@sbcglobal.net
> To: python-list@python.org
>
> On Monday, June 3, 2013 11:46:03 PM UTC-7, Carlos Nepomuceno wrote:
> > That doesn't even works because input() is the same
On Tuesday, June 4, 2013 12:45:38 AM UTC-7, Anssi Saari wrote:
> BTW, did I get the logic correctly, the end result is random?
You're right! I'm guessing that's not what the OP wants?
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, June 3, 2013 11:46:03 PM UTC-7, Carlos Nepomuceno wrote:
> That doesn't even works because input() is the same as eval(raw_input()). So
> you'll get a NameError exception.
>
> I think you know that. Perhaps you mean raw_input() instead of input().
But the OP's code shows print() funct
eschneide...@comcast.net writes:
> Is there a more efficient way of doing this? Any help is gratly appreciated.
Efficiency in a short program isn't a big thing. You have some pretty
weird things in there, there's no need make single element tuples out of
your strings and then putting those in a l
er, default)()
Note that switch is a dictionary and you can use it without creating a
variable, for example:
{ option1: function1,
option2: function2
}.get(randomizer, default)()
> Date: Mon, 3 Jun 2013 20:39:28 -0700
> Subject: Beginner question
> From: eschneide...@comcast.net
> T
Is there a more efficient way of doing this? Any help is gratly appreciated.
import random
def partdeux():
print('''A man lunges at you with a knife!
Do you DUCK or PARRY?''')
option1=('duck')
option2=('parry')
optionsindex=[option1, option2]
randomizer=random.choice(optionsin
On Apr 7, 1:52 am, Steven D'Aprano wrote:
> Sounds like this library is documented the same way most third party
> libraries are: as an afterthought, by somebody who is so familiar with
> the software that he cannot imagine why anyone might actually need
> documentation.
>
> I feel your pain.
>
On Fri, 06 Apr 2012 13:41:23 -0700, Martin Jones wrote:
> In a nutshell: My question is: how do experienced coders learn about
> external/third-party classes/APIs?
Does it have a tutorial? Do it.
Does it have a manual, a wiki, FAQs, or other documentation? Read them.
If all else fails, what doe
On 4/6/2012 1:41 PM Martin Jones said...
In a nutshell: My question is: how do experienced coders learn about
external/third-party classes/APIs?
I'm teaching myself Python through a combination of Hetland's
'Beginning
Python', various online tutorials and some past experience coding
ASP/VBScript
In a nutshell: My question is: how do experienced coders learn about
external/third-party classes/APIs?
I'm teaching myself Python through a combination of Hetland's
'Beginning
Python', various online tutorials and some past experience coding
ASP/VBScript. To start to learn Python I've set myself
El 16/11/11 03:22, Jabba Laci escribió:
Hi,
I'm reading the redis documentation and there is one thing that
bothers me. For redis, you need to start a server on localhost. Is
there an easy way that my Python script starts this server
automatically? Before using my script, I don't want to start
r
In article ,
Jabba Laci wrote:
> > Why do you want to stop redis after your program terminates? Generally,
> > you just start redis up when the system boots and leave it running.
>
> Hi,
>
> OK, so it's more like MySQL or PostgeSQL, i.e. leave the server
> running in the background.
That's h
1 - 100 of 273 matches
Mail list logo