On Wed, 24 Apr 2013 22:05:52 -0700, CM wrote:
> I have to count the number of various two-digit sequences in a list such
> as this:
>
> mylist = [(2,4), (2,4), (3,4), (4,5), (2,1)] # (Here the (2,4) sequence
> appears 2 times.)
>
> and tally up the results, assigning each to a variable. The in
The idea is a risk game application and data collected and controlled by a
gameserver, which happens to be a webserver too.
But for learning the principles, i want to start with tic-tac-toe multiplayer.
Thanks for your answers, I will read all your advices first now.
--
http://mail.python.org/
On Thu, Apr 25, 2013 at 3:49 PM, llanitedave wrote:
> Given that
>
> s = some static value
> i = a value incremented during a loop
>
> I'm used to comparing them as
>
> if i == s:
> # some code
>
> But for some unknown reason I did a switch
>
> if s == i:
> # same code
>
> It didn't seem t
Given that
s = some static value
i = a value incremented during a loop
I'm used to comparing them as
if i == s:
# some code
But for some unknown reason I did a switch
if s == i:
# same code
It didn't seem to make any difference at first glance, so I just got to
wondering --
Is ther
On Thu, Apr 25, 2013 at 3:05 PM, CM wrote:
> I have to count the number of various two-digit sequences in a list
> such as this:
>
> mylist = [(2,4), (2,4), (3,4), (4,5), (2,1)] # (Here the (2,4)
> sequence appears 2 times.)
>
> and tally up the results, assigning each to a variable.
You can use
I have to count the number of various two-digit sequences in a list
such as this:
mylist = [(2,4), (2,4), (3,4), (4,5), (2,1)] # (Here the (2,4)
sequence appears 2 times.)
and tally up the results, assigning each to a variable. The inelegant
first pass at this was something like...
# Create na
On Apr 25, 8:35 am, Seb wrote:
> Hi,
>
> Please excuse the slightly off-topic query. I'm learning Python, using
> the IPython (0.13) shell, and wanted to run it from Emacs 24. AFAICT,
> python.el is the most actively developed library, and is included in
> Emacs. How do experienced Python progr
On Wed, 24 Apr 2013 19:25:37 -0700, Ethan Furman wrote:
> On 04/24/2013 06:35 PM, Steven D'Aprano wrote:
>> Objects are supposed to return NotImplemented from special dunder
>> methods like __add__, __lt__, etc. to say "I don't know how to
>> implement this method for the given argument". Python w
Hi,
Please excuse the slightly off-topic query. I'm learning Python, using
the IPython (0.13) shell, and wanted to run it from Emacs 24. AFAICT,
python.el is the most actively developed library, and is included in
Emacs. How do experienced Python programmers set up their python.el to
make the b
On Thu, Apr 25, 2013 at 3:08 AM, Daniel Kersgaard
wrote:
> import tkinter
> import tkinter.messagebox
>
> class MyGui:
> def _init_(self):
> ... all code here
>
> poop = MyGui()
As already mentioned, changing that to __init__ makes everything work
(I just tested in Python 3.3 on Windows). But
On Thu, Apr 25, 2013 at 6:59 AM, wrote:
> hi,
> I struggle for some days about a "model" for a multiplayer game application.
> I read so much from my enemy Google, i got lost by all that info and dont
> know which path i should chose.
>
> a multiplayer game application, sending/receiving instan
On 04/24/2013 07:20 PM, Chris Angelico wrote:
On Thu, Apr 25, 2013 at 11:41 AM, Roy Smith wrote:
In article <5178884b$0$29977$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
I don't see why you would need anything like that. Reading further on, I
see that you are counting unimp
On 4/24/2013 1:53 PM, Chris “Kwpolska” Warrick wrote:
Please try fixing it and running it _outside of IDLE_, which is also
built in Tk
The default mode of Idle runs user code in a separate process. Editing
tkinter code with Idle and running it (in the separate process) should
be no problem.
On 04/24/2013 06:35 PM, Steven D'Aprano wrote:
Objects are supposed to return NotImplemented from special dunder methods
like __add__, __lt__, etc. to say "I don't know how to implement this
method for the given argument". Python will then try calling the other
object's special method. If both ob
In article ,
Chris Angelico wrote:
> On Thu, Apr 25, 2013 at 11:41 AM, Roy Smith wrote:
> > In article <5178884b$0$29977$c3e8da3$54964...@news.astraweb.com>,
> > Steven D'Aprano wrote:
> >
> >> I don't see why you would need anything like that. Reading further on, I
> >> see that you are coun
On Thu, Apr 25, 2013 at 11:41 AM, Roy Smith wrote:
> In article <5178884b$0$29977$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>> I don't see why you would need anything like that. Reading further on, I
>> see that you are counting unimplemented rules as true, for some reason
In article <5178884b$0$29977$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> I don't see why you would need anything like that. Reading further on, I
> see that you are counting unimplemented rules as true, for some reason
> which I don't understand.
The top-level logic we need
On Wed, 24 Apr 2013 19:50:33 -0400, Roy Smith wrote:
> I discovered something really neat today.
>
> We've got a system with a bunch of rules. Each rule is a method which
> returns True or False. At some point, we need to know if all the rules
> are True. Complicating things, not all the rules
On 25 April 2013 00:01, Ana Dionísio wrote:
> Hello!
>
> I have this script that scans a csv file and if the value in the first column
> == 200 it saves that row into an array.
>
> The problem is, I need to save that row and the next 10 rows in that same
> array. What can I add to the script so
On 04/24/2013 08:00 PM, Oscar Benjamin wrote:
On 25 April 2013 00:26, Dave Angel wrote:
On 04/24/2013 05:09 PM, William Ray Wing wrote:
My question is why bother with multithreading? Why not just do these as
separate processes? You said "they in no way interact with each other" and
On 04/24/2013 07:01 PM, Ana Dionísio wrote:
Hello!
I have this script that scans a csv file and if the value in the first column
== 200 it saves that row into an array.
No it doesn't. It creates a list, then overwrites it with a numpy array,
then overwrites that with a list of strings repres
On 25 April 2013 00:26, Dave Angel wrote:
> On 04/24/2013 05:09 PM, William Ray Wing wrote:
>>
>> On Apr 24, 2013, at 4:31 PM, Neil Cerutti wrote:
>>
>>> On 2013-04-24, William Ray Wing wrote:
When I look at the pool module, the error is occurring in
get(self, timeout=None) on the
I discovered something really neat today.
We've got a system with a bunch of rules. Each rule is a method which
returns True or False. At some point, we need to know if all the rules
are True. Complicating things, not all the rules are implemented.
Those that are not implemented raise NotIm
On 04/24/2013 07:21 PM, Rhodri James wrote:
On Thu, 25 Apr 2013 00:01:01 +0100, Ana Dionísio
wrote:
Odd that this subject should have come up so many times in various
guises in the last week or two.
Not that odd. In a larger classroom I'd expect several of the students
to have enough
On 04/24/2013 05:09 PM, William Ray Wing wrote:
On Apr 24, 2013, at 4:31 PM, Neil Cerutti wrote:
On 2013-04-24, William Ray Wing wrote:
When I look at the pool module, the error is occurring in
get(self, timeout=None) on the line after the final else:
def get(self, timeout=None):
On Thu, 25 Apr 2013 00:01:01 +0100, Ana Dionísio
wrote:
I tried to do for row in len(10): but I get an error.
Please remember to tell us what error, with the traceback, so that we can
make fun of you for not reading it :-) In this case it's pretty obvious;
Python will complain that you
Hello!
I have this script that scans a csv file and if the value in the first column
== 200 it saves that row into an array.
The problem is, I need to save that row and the next 10 rows in that same
array. What can I add to the script so it does that? I tried to do for row in
len(10): but I ge
On 24/04/2013 20:25, William Ray Wing wrote:
I run a bit of python code that monitors my connection to the greater Internet.
It checks connectivity to the requested target IP addresses, logging both
successes and failures, once every 15 seconds. I see failures quite regularly,
predictably on
On 24 April 2013 20:25, William Ray Wing wrote:
> I run a bit of python code that monitors my connection to the greater
> Internet. It checks connectivity to the requested target IP addresses,
> logging both successes and failures, once every 15 seconds. I see failures
> quite regularly, pred
On Apr 24, 2013, at 4:31 PM, Neil Cerutti wrote:
> On 2013-04-24, William Ray Wing wrote:
>> When I look at the pool module, the error is occurring in
>> get(self, timeout=None) on the line after the final else:
>>
>>def get(self, timeout=None):
>>self.wait(timeout)
>>if not
This series of articles is flash-based, and the examples apparently
don't run, but it is a great read on all the problems you face when
coding several kinds of multiplayer games, and the variety of things
you can do to fix it:
http://playerio.com/documentation/tutorials/building-flash-multiplayer-
In
webmas...@terradon.nl writes:
> i have tried and accompished an urllib connection, with get and post
> variabels, but that will be polling, with all the http-overhead for every
> poll. I think this is also to slow and no "real" updating of the game status.
Http can still work, depending on w
hi,
I struggle for some days about a "model" for a multiplayer game application.
I read so much from my enemy Google, i got lost by all that info and dont know
which path i should chose.
a multiplayer game application, sending/receiving instantly every change in
the game to a central webserver,
On 2013-04-24, William Ray Wing wrote:
> When I look at the pool module, the error is occurring in
> get(self, timeout=None) on the line after the final else:
>
> def get(self, timeout=None):
> self.wait(timeout)
> if not self._ready:
> raise TimeoutError
>
On 2013-04-24, Arnaud Delobelle wrote:
> His class is not a frame, it's just a container for the tkinter
> code. It's a bit unusual but it looks correct to me (apart from
> the single underscores in __init__() as spotted by Ned
> Batchelder).
I dunno if it makes any difference, but it's usual to
I run a bit of python code that monitors my connection to the greater Internet.
It checks connectivity to the requested target IP addresses, logging both
successes and failures, once every 15 seconds. I see failures quite regularly,
predictably on Sunday nights after midnight when various netw
On 24 April 2013 18:53, Chris “Kwpolska” Warrick wrote:
> On Wed, Apr 24, 2013 at 7:08 PM, Daniel Kersgaard
> wrote:
>> Today, being the last day of lectures at school, my instructor ran briefly
>> through Tkninter and GUIs. I'd been looking forward to this particular
>> lesson all semester, bu
On Wednesday, April 24, 2013 3:08:27 PM UTC-4, Neil Cerutti wrote:
> On 2013-04-24, Forafo San wrote:
>
> > Hello All,
>
> > I'm running Python version 2.7.3_6 on a FreeBSD system. The following
> > session in a Python interpreter throws a mysterious TypeError:
>
> >
>
> > ---
On 2013-04-24, Roozbeh wrote:
> I want to use spline interpolation function from SciPy in an
> application and at the same time, I don't want the end user to have
> to install SciPy separately. Is there a way around this problem?
You could bundle you app along with python and SciPy and whatever
Hello All,
I'm running Python version 2.7.3_6 on a FreeBSD system. The following session
in a Python interpreter throws a mysterious TypeError:
--
[ppvora@snowfall ~/xbrl]$ python
Python 2.7.3 (default, Apr 22 2013, 18:42:18)
[GCC 4.2.1 20070719 [FreeBSD
On 2013-04-24, Forafo San wrote:
> Hello All,
> I'm running Python version 2.7.3_6 on a FreeBSD system. The following session
> in a Python interpreter throws a mysterious TypeError:
>
> --
> [ppvora@snowfall ~/xbrl]$ python
> Python 2.7.3 (default, Apr 22
Le 24/04/2013 19:12, Sara Lochtie a écrit :
On Tuesday, April 23, 2013 11:22:29 PM UTC-7, Sara Lochtie wrote:
I have written a GUI that gets data sent to it in real time and this data is
displayed in a table. Every time data is sent in it is displayed in the table
in a new row. My problem is t
On 4/24/2013 1:08 PM, Daniel Kersgaard wrote:
Today, being the last day of lectures at school, my instructor ran briefly
through Tkninter and GUIs. I'd been looking forward to this particular lesson
all semester, but when I got home and copied a sample program from my textbook
verbatim, IDLE
On Wed, Apr 24, 2013 at 7:12 PM, Sara Lochtie wrote:
> So that is where I am stuck. I don't how to compare them and I am trying to
> avoiding saving the data to a file.
To a file? Just store it in a class attribute and you will be fine.
You have it in self.data already. Unless that structure d
On Wed, Apr 24, 2013 at 7:08 PM, Daniel Kersgaard
wrote:
> Today, being the last day of lectures at school, my instructor ran briefly
> through Tkninter and GUIs. I'd been looking forward to this particular lesson
> all semester, but when I got home and copied a sample program from my
> textboo
On 04/24/2013 12:54 PM, The Night Tripper wrote:
Hi all
I have a small suite of python modules, say
A.py
B.py
C.py
which can be invoked in a variety of ways. eg.
1) A.py is invoked directly; this imports and uses B.py and C.py
2) B.py is invoked; this imports a
On 04/24/2013 01:08 PM, Daniel Kersgaard wrote:
Today, being the last day of lectures at school, my instructor ran briefly
through Tkninter and GUIs. I'd been looking forward to this particular lesson
all semester, but when I got home and copied a sample program from my textbook
verbatim, IDLE
A Healthy Alternative to Takeaway Regret
http://natigtas7ab.blogspot.com/2013/03/a-healthy-alternative-to-takeaway-regret.html
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Apr 24, 2013 at 6:54 PM, The Night Tripper wrote:
> Hi all
> I have a small suite of python modules, say
>
> A.py
> B.py
> C.py
>
> which can be invoked in a variety of ways. eg.
>
> 1) A.py is invoked directly; this imports and uses B.py and C.py
>
> 2) B.p
Maybe import mylogger.mylogger as gLog? I don't know what you mean by
"missing a trick". Your example seems pretty pythonic to me, except for the
fact that you use a singleton where you could have a couple of functions
and use the module as the namespace.
On 24 Apr 2013 17:58, "The Night Tripper"
On Wed, Apr 24, 2013 at 12:14 AM, Peng Yu wrote:
> I currently use sphinx to generate the doc (in rst). How to figure it
> to support pandoc's markdown?
If I understand the desired workflow, it's just 1) write in markdown;
2) then run pandoc to convert to rst; 3) then run Sphinx to render
html or
On Tuesday, April 23, 2013 11:22:29 PM UTC-7, Sara Lochtie wrote:
> I have written a GUI that gets data sent to it in real time and this data is
> displayed in a table. Every time data is sent in it is displayed in the table
> in a new row. My problem is that I would like to have the data just re
Today, being the last day of lectures at school, my instructor ran briefly
through Tkninter and GUIs. I'd been looking forward to this particular lesson
all semester, but when I got home and copied a sample program from my textbook
verbatim, IDLE does nothing. No error, no nothing. Any ideas? He
Hi all
I have a small suite of python modules, say
A.py
B.py
C.py
which can be invoked in a variety of ways. eg.
1) A.py is invoked directly; this imports and uses B.py and C.py
2) B.py is invoked; this imports and uses A.py and C.py
I use the logging module in
On Wednesday, April 24, 2013 1:40:14 PM UTC+2, Robert Kern wrote:
> On 2013-04-24 17:04, Roozbeh wrote:
>
> > On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote:
>
> >> Hi all, I want to use spline interpolation function from SciPy in an
> >> application and at the same time, I don't
On Wednesday, April 24, 2013 3:52:50 PM UTC+2, Miki Tebeka wrote:
> > I want to use spline interpolation function from SciPy in an application
> > and at the same time, I don't want the end user to have to install SciPy
> > separately. You can pack you application with py2exe, pyinstaller ... and
> I want to use spline interpolation function from SciPy in an application and
> at the same time, I don't want the end user to have to install SciPy
> separately.
You can pack you application with py2exe, pyinstaller ... and then they won't
even need to install Python.
Another option (which is
A quick hack:
>>> from inspect import getargspec
>>>
>>> def func(a, b, c=3, **kwargs):
... out_dict = {}
... args, _, keywords, _ = getargspec(func)
... for argname in args:
... out_dict[argname] = locals()[argname]
... if keywords:
... out_dict.update(locals()[key
Hi everybody,
what is the recommended way of stuffing *all* function arguments (not just
the ones passed by **kwargs) into a common dictionary?
The following sort of works when used as the first block in a function:
try:
kwargs.update(locals())
except NameError:
kwargs = locals().copy()
e
Interesting. Thank you.
--
http://mail.python.org/mailman/listinfo/python-list
vasudevram wrote:
> On Wednesday, April 24, 2013 6:20:36 AM UTC+5:30, alex23 wrote:
>>
>> A nested class definition will be defined as an attribute of the class
>>
>> its defined within:
>>
>>
>>
>> >>> class Outer(object):
>>
>> ... foo = 'FOO'
>>
>> ... class Inner(object):
>>
>>
On Wed, 24 Apr 2013 04:34:44 -0700, Roozbeh wrote:
The scipy interpolation routines (splev, splrep, etc.) are on netlib:
http://www.netlib.org/dierckx/
This gives you FORTRAN source codes which you will have to compile
yourself to either a DLL or an SO. Call them from python using ctypes.
I ha
pablobl...@gmail.com wrote:
> I am using a XBee to receive data from an arduino network.
>
> But they have AP=2 which means escaped characters are used when a 11 or 13
> appears (and some more...)
>
> When this occurs, XBee sends 7D and inmediatly XOR operation with char and
> 0x20.
>
> I am tr
On 2013-04-24 17:04, Roozbeh wrote:
On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote:
Hi all, I want to use spline interpolation function from SciPy in an
application and at the same time, I don't want the end user to have to install
SciPy separately. Is there a way around this pr
On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote:
> Hi all, I want to use spline interpolation function from SciPy in an
> application and at the same time, I don't want the end user to have to
> install SciPy separately. Is there a way around this problem? Thanks in
> advance for y
On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote:
> Hi all, I want to use spline interpolation function from SciPy in an
> application and at the same time, I don't want the end user to have to
> install SciPy separately. Is there a way around this problem? Thanks in
> advance for y
On Wednesday, April 24, 2013 11:13:45 AM UTC+2, Roozbeh wrote: > Hi all, I want
to use spline interpolation function from SciPy in an application and at the
same time, I don't want the end user to have to install SciPy separately. Is
there a way around this problem? Thanks in advance for your he
On 2013-04-24 16:34, Oscar Benjamin wrote:
On 24 April 2013 10:13, Roozbeh wrote:
I want to use spline interpolation function from SciPy in an application and at
the same time, I don't want the end user to have to install SciPy separately.
Is there a way around this problem?
They cannot us
On Wednesday, April 24, 2013 6:20:36 AM UTC+5:30, alex23 wrote:
> On Apr 24, 9:13 am, vasudevram wrote:
>
> > On Wednesday, April 24, 2013 3:52:57 AM UTC+5:30, Ian wrote:
>
> > > On Tue, Apr 23, 2013 at 3:50 PM, vasudevram wrote:
>
> > > > I saw an example of defining a class within another cl
On 24 April 2013 10:13, Roozbeh wrote:
>
> I want to use spline interpolation function from SciPy in an application and
> at the same time, I don't want the end user to have to install SciPy
> separately. Is there a way around this problem?
They cannot use the function from scipy if scipy is no
On 24/04/2013 08:33, pablobl...@gmail.com wrote:
I am using a XBee to receive data from an arduino network.
But they have AP=2 which means escaped characters are used when a 11 or 13
appears (and some more...)
When this occurs, XBee sends 7D and inmediatly XOR operation with char and 0x20.
I
do anyone has examples of pyraknet???
I've being seen these ones (http://nullege.com/codes/search/pyraknet) but I
still don't understand lot of things about it and I can't find anything else.
http://www.uci.cu
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
I want to use spline interpolation function from SciPy in an application and at
the same time, I don't want the end user to have to install SciPy separately.
Is there a way around this problem?
Thanks in advance for your help
--
http://mail.python.org/mailman/listinfo/python-list
On 24/04/2013 02:59, Steven D'Aprano wrote:
> On Tue, 23 Apr 2013 17:57:17 +0100, Blind Anagram wrote:
[snip]
> In my opinion, it is more important to be efficient for large sieves, not
> small. As they say, for small N, everything is fast. Nobody is going to
> care about the difference between
On Wed, Apr 24, 2013 at 8:22 AM, Sara Lochtie wrote:
> I have written a GUI that gets data sent to it in real time and this data is
> displayed in a table. Every time data is sent in it is displayed in the table
> in a new row. My problem is that I would like to have the data just replace
> the
I am using a XBee to receive data from an arduino network.
But they have AP=2 which means escaped characters are used when a 11 or 13
appears (and some more...)
When this occurs, XBee sends 7D and inmediatly XOR operation with char and 0x20.
I am trying to recover the original character in pyth
76 matches
Mail list logo