Re: back with more issues

2013-08-12 Thread Kris Mesenbrink
import random class player(): hp = 10 attack = random.randint(0,5) class monster(): hp = 10 attack = random.randint(0,4) def battle(): print ("a wild mosnter appered!") print ("would you like to battle?") answer = input() if answer == ("yes"): while monst

[ANN] New article:

2013-08-12 Thread mauricel...@acm.org
Dear all The following article had been peer-reviewed and accepted by The Python Papers. Title: A Python Module for FITS Files with full C Level Programming Functionality Abstract: A Python module for manipulating files in the FITS format is described. The module was constructed using the capa

Re: back with more issues

2013-08-12 Thread Dave Angel
Kris Mesenbrink wrote: > darn i was hoping i could put off learning classes for a bit, but it seems > that is not the case. i have tested it a bit and it seems to be working > correctly now. > > > import random > > class player(): > hp = 10 > speed = 5 >

Calling Python macro from ctypes

2013-08-12 Thread Steven D'Aprano
Is it possible to call a Python macro from ctypes? For example, Python 3.3 introduces some new macros for querying the internal representation of strings: http://www.python.org/dev/peps/pep-0393/#new-api So I try this in 3.3: py> import ctypes py> ctypes.pythonapi.PyUnicode_MAX_CHAR_VALUE Tra

Re: Calling Python macro from ctypes

2013-08-12 Thread Peter Otten
Steven D'Aprano wrote: > Is it possible to call a Python macro from ctypes? For example, Python > 3.3 introduces some new macros for querying the internal representation > of strings: > > http://www.python.org/dev/peps/pep-0393/#new-api > > > So I try this in 3.3: > > py> import ctypes > py> c

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/10/2013 10:47 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: In article , Chris Angelico wrote: When you get a syntax error you can't understand, look at the previous line of code. Perhaps something there is incomplete; maybe you have mismatched parenthe

Re: Am I not seeing the Error?

2013-08-12 Thread Zachary Ware
On Mon, Aug 12, 2013 at 7:33 AM, Devyn Collier Johnson wrote: > > On 08/10/2013 10:47 PM, Chris Angelico wrote: >> >> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: >>> >>> In article , >>> Chris Angelico wrote: >>> When you get a syntax error you can't understand, look at the previous

Re: Am I not seeing the Error?

2013-08-12 Thread Ned Batchelder
On 8/12/13 8:33 AM, Devyn Collier Johnson wrote: On 08/10/2013 10:47 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: In article , Chris Angelico wrote: When you get a syntax error you can't understand, look at the previous line of code. Perhaps something ther

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/12/2013 09:20 AM, Zachary Ware wrote: On Mon, Aug 12, 2013 at 7:33 AM, Devyn Collier Johnson wrote: On 08/10/2013 10:47 PM, Chris Angelico wrote: On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith wrote: In article , Chris Angelico wrote: When you get a syntax error you can't understand

Re: Am I not seeing the Error?

2013-08-12 Thread John Gordon
In Devyn Collier Johnson writes: > I am checking my 1292-line script for syntax errors. I ran the following > commands in a terminal to check for errors, but I do not see the error. >File "./beta_engine", line 344 > JOB_WRITEURGFILES = > multiprocessing.Process(write2file('./mem/ENG

Re: back with more issues

2013-08-12 Thread Rotwang
On 12/08/2013 06:54, Dave Angel wrote: [...] This function makes no sense to me. A function should have three well-defined pieces: what are its parameters, what does it do, what are its side-effects, and what does it return. No! A function should have *four* well-defined pieces: what are its

Re: Am I not seeing the Error?

2013-08-12 Thread Zachary Ware
On Mon, Aug 12, 2013 at 9:04 AM, Devyn Collier Johnson wrote: > > Zachary, are you, Ned, and Terry trying to say the syntax should be > > job = multiprocessing.Process(func1(), func2()) > > not > > job = multiprocessing.Process(func1(); func2()) > Basically, yes. The first option there is equiva

Re: Am I not seeing the Error?

2013-08-12 Thread Zachary Ware
On Mon, Aug 12, 2013 at 10:37 AM, Zachary Ware wrote: > [snip my last reply with a few code samples] My apologies for Gmail's mangling of my samples. Any code that is not indented should be on the previous line. -- Zach -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-12 Thread Roy Smith
I can't quite sort out the multiple quoting levels, but somebody said: >>> Programming like that is called trolling. A programmer that uses >>> trolling is called a troll. A troll can also refer to such a line >>> of code itself. My scripts contain a lot of trolls. It is easier >>> for me to re

Re: Am I not seeing the Error?

2013-08-12 Thread Joel Goldstick
On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: > I can't quite sort out the multiple quoting levels, but somebody said: > Programming like that is called trolling. A programmer that uses trolling is called a troll. A troll can also refer to such a line of code itself. My scripts

Re: Calling Python macro from ctypes

2013-08-12 Thread Dave Angel
Peter Otten wrote: > Steven D'Aprano wrote: > >> Is it possible to call a Python macro from ctypes? For example, Python >> 3.3 introduces some new macros for querying the internal representation >> of strings: >> >> http://www.python.org/dev/peps/pep-0393/#new-api >> >> >> So I try this in 3.3:

Re: Am I not seeing the Error?

2013-08-12 Thread Chris Angelico
On Mon, Aug 12, 2013 at 5:56 PM, Joel Goldstick wrote: > If you like semicolons, use another language that needs them. > I think you think it is some version of premature optimization. Since > you are a novice at the language, stick with the standards, and learn > to embrace them. I'm a C progra

SSL issues in Python stdlib and 3rd party code

2013-08-12 Thread Christian Heimes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, (re-post from the Python developer list) last week Ryan Sleevi of the Google Chrome Security Team has informed us about about two issues in Python's SSL module. I already new about the cause of the first bug and suspected that our SSL module

Re: connection change

2013-08-12 Thread Joel Goldstick
On Sun, Aug 11, 2013 at 7:50 PM, Inna Belakhova wrote: > Hi, > > I don't know much about Python code. Where is the connection made, eg > config file - where can I find it? > > Our SQLITe database is currently 9GB and we have a table that contains > 7GB of BLOB type. I think the table cannot handle

Re: back with more issues

2013-08-12 Thread random832
On Mon, Aug 12, 2013, at 10:56, Rotwang wrote: > No! A function should have *four* well-defined pieces: what are its > parameters, what does it do, what are its side-effects, what does it > return, and an almost fanatical devotion to the Pope [etc.] To be fair, I can't think of what "what does i

Re: Am I not seeing the Error?

2013-08-12 Thread Devyn Collier Johnson
On 08/12/2013 12:56 PM, Joel Goldstick wrote: On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: I can't quite sort out the multiple quoting levels, but somebody said: Programming like that is called trolling. A programmer that uses trolling is called a troll. A troll can also refer to such

Re: Am I not seeing the Error?

2013-08-12 Thread Joel Goldstick
On Mon, Aug 12, 2013 at 4:16 PM, Devyn Collier Johnson wrote: > > On 08/12/2013 12:56 PM, Joel Goldstick wrote: >> >> On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: >>> >>> I can't quite sort out the multiple quoting levels, but somebody said: >>> >> Programming like that is called trolli

Re: Am I not seeing the Error?

2013-08-12 Thread Ned Batchelder
On 8/12/13 4:16 PM, Devyn Collier Johnson wrote: On 08/12/2013 12:56 PM, Joel Goldstick wrote: On Mon, Aug 12, 2013 at 11:47 AM, Roy Smith wrote: I can't quite sort out the multiple quoting levels, but somebody said: Programming like that is called trolling. A programmer that uses trolling

Digging into multiprocessing

2013-08-12 Thread Demian Brecht
Hi all, Some work that I'm doing atm is in some serious need of parallelization. As such, I've been digging into the multiprocessing module more than I've had to before and I had a few questions come up as a result: (Running 2.7.5+ on OSX) 1. From what I've read, a new Python interpreter instanc

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-12 Thread Michael Torrie
On 08/11/2013 11:54 PM, Gregory Ewing wrote: > Michael Torrie wrote: >> I've always wondered if the 160 character limit or whatever it is is a >> hard limit in their system, or if it's just a variable they could tweak >> if they felt like it. > > Isn't it for compatibility with SMS? Twitter could

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-12 Thread Chris Angelico
On Tue, Aug 13, 2013 at 2:48 AM, Michael Torrie wrote: > On 08/11/2013 11:54 PM, Gregory Ewing wrote: >> Michael Torrie wrote: >>> I've always wondered if the 160 character limit or whatever it is is a >>> hard limit in their system, or if it's just a variable they could tweak >>> if they felt lik

Re: back with more issues

2013-08-12 Thread Kris Mesenbrink
the Classes and __init__ still don't make much sense actually. i have tried and tried again to make it generate numbers between 0 and 5 in a while statement but it just doesn't seem to be working. import random class Player(): hp = 10 def __init__(self, patt): self.att = rando

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-12 Thread Jason Friedman
>>> I've always wondered if the 160 character limit or whatever it is is a >>> hard limit in their system, or if it's just a variable they could tweak >>> if they felt like it. I thought it was 140 characters? https://twitter.com/about -- http://mail.python.org/mailman/listinfo/python-list

Re: back with more issues

2013-08-12 Thread MRAB
On 13/08/2013 04:13, Kris Mesenbrink wrote: the Classes and __init__ still don't make much sense actually. i have tried and tried again to make it generate numbers between 0 and 5 in a while statement but it just doesn't seem to be working. import random class Player(): This sets an attrib

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-12 Thread MRAB
On 13/08/2013 04:20, Jason Friedman wrote: I've always wondered if the 160 character limit or whatever it is is a hard limit in their system, or if it's just a variable they could tweak if they felt like it. I thought it was 140 characters? https://twitter.com/about He did say "or whatever".

Re: back with more issues

2013-08-12 Thread Steven D'Aprano
On Mon, 12 Aug 2013 20:13:31 -0700, Kris Mesenbrink wrote: > the Classes and __init__ still don't make much sense actually. i have > tried and tried again to make it generate numbers between 0 and 5 in a > while statement but it just doesn't seem to be working. Hi Kris, You might also find that

Re: Calling Python macro from ctypes

2013-08-12 Thread Steven D'Aprano
On Mon, 12 Aug 2013 13:42:14 +0200, Peter Otten wrote: > Steven D'Aprano wrote: > >> Is it possible to call a Python macro from ctypes? For example, Python >> 3.3 introduces some new macros for querying the internal representation >> of strings: >> >> http://www.python.org/dev/peps/pep-0393/#new