Re: Google Maps and Python: creating a map, embedding it, adding images, videos, markers, using python

2014-12-19 Thread Daniel da Silva
Kevin, that client library looks like it is for accessing Google Maps related services, not modifying maps themselves. On Fri, Dec 19, 2014 at 1:02 AM, Kev Dwyer wrote: > Veek M wrote: > > > I'm messing with Google-Maps. Is there a way I can create a map, embed it > > on a page (CSS/HTML/Javas

Re: piping with subprocess

2014-02-01 Thread Daniel da Silva
Try this: from subprocess import check_output import sys check_output("textutil -convert html %s -stdout | pandoc -f html -t markdown -o %s" % sys.argv[1:3], shell=True) On Sat, Feb 1, 2014 at 7:19 AM, Rick Dooling wrote: > I spent half a day trying to convert this bash script (on Mac) > > t

Re: Chanelling Guido - dict subclasses

2014-01-15 Thread Daniel da Silva
On Tue, Jan 14, 2014 at 8:27 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > > But reading Guido, I think he's saying that wouldn't be a good idea. I > don't get it -- it's not a violation of the Liskov Substitution > Principle, because it's more restrictive, not less. What am

Re: Python 3 __bytes__ method

2014-01-11 Thread Daniel da Silva
On Sat, Jan 11, 2014 at 9:44 PM, Ethan Furman wrote: > On 01/11/2014 06:19 PM, Daniel da Silva wrote: > >> >> One use case is: >> Suppose you have existing function that accepts a /bytes/ object. If you >> subclass /bytes/ and want it to be guaranteed >>

Re: Python 3 __bytes__ method

2014-01-11 Thread Daniel da Silva
wrote: > On 01/11/2014 04:53 PM, Daniel da Silva wrote: > >> >> Where did you read this? I can't find any documentation about __bytes__ >> on google. >> > > http://docs.python.org/3.3/reference/datamodel.html? > highlight=__bytes__#object.__bytes__ >

Re: Python 3 __bytes__ method

2014-01-11 Thread Daniel da Silva
Where did you read this? I can't find any documentation about __bytes__ on google. Regards, Daniel On Sat, Jan 11, 2014 at 7:24 PM, Ethan Furman wrote: > Python 3 has a new method, __bytes__. The docs say: Called by bytes() to > compute a byte-string representation of an object. This should r

Re: random number

2012-03-25 Thread Daniel da Silva
If you want it as an int: random.randint(10, 99) Or as a string: s = '%06d' % random.randint(0, 99) On Mon, Mar 26, 2012 at 2:08 AM, Nikhil Verma wrote: > Hi All > > How can we generate a 6 digit random number from a given number ? > > eg:- > > def number_generator(id): > rando

Best way to administer code updates to server daemon

2011-01-21 Thread Daniel da Silva
Hi, I am writing a custom IRC server, and I was wondering would be the best way to administer code updates to the daemon. Am I doomed to have to restart the server every time I want to do an update (which would disconnect all clients)? I don't mind doing something a little more advanced if it mean

Re: Parsing string for " "

2011-01-12 Thread Daniel da Silva
MRAB, I will check it out. Thanks! Daniel On Tue, Jan 11, 2011 at 10:23 PM, MRAB wrote: > On 12/01/2011 01:50, Daniel da Silva wrote: > >> Hi, >> >> I have come across a task where I would like to scan a short 20-80 >> character line of text for instances of &quo

Parsing string for " "

2011-01-11 Thread Daniel da Silva
Hi, I have come across a task where I would like to scan a short 20-80 character line of text for instances of " ". Ideally could be of any tense. I know quite a bit of programming and computer science, but computational linguistics is relatively new to me. If anyone can point me in the right di

Parsing string for " "

2011-01-11 Thread Daniel da Silva
Hi, I have come across a task where I would like to scan a short 20-80 character line of text for instances of " ". Ideally could be of any tense. I know quite a bit of programming and computer science, but computational linguistics is relatively new to me. If anyone can point me in the right di

Re: list displays

2011-01-08 Thread Daniel da Silva
They're called "List Comprehensions" http://docs.python.org/tutorial/datastructures.html#list-comprehensions On Sat, Jan 8, 2011 at 4:57 PM, Olive wrote: > I am a newbie to python. Python supports what I thinks it is call

Funny __future__ imports

2010-12-21 Thread Daniel da Silva
from __future__ import space_shuttle DeprecationWarning: will be removed in next release Post yours! -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling FORTAN dll functions from Python

2010-12-08 Thread Daniel da Silva
I don't know much about fortran+python, but I work with someone who does, and he absolutely loves this tool: http://cens.ioc.ee/projects/f2py2e/ Daniel On Tue, Dec 7, 2010 at 10:19 PM, Dennis Lee Bieber wrote: > On Tue, 07 Dec 2010 12:52:54 +0100, Stefan Behn

Re: Man pages and info pages

2010-11-03 Thread Daniel da Silva
Guys, this really has nothing to do with python. On Wednesday, November 3, 2010, Hrvoje Niksic wrote: > Teemu Likonen writes: > >>     Enter   Follow a link (down to node) >>     u       up node level >>     h       help (general how-to) >>     ?       help (commands) >>     s       search > > A

Re: newbie problem with str.replace

2010-08-04 Thread Daniel da Silva
Also, for bestandsnaam in dirs and files: is probably not doing what you want. Use + to concatenate lists. Daniel On Wed, Aug 4, 2010 at 6:30 AM, Mike Kent wrote: > On Aug 4, 9:10 am, BobAalsma wrote: > > I'm working on a set of scripts and I can't get a replace to work in >

Re: Global variables problem

2010-08-03 Thread Daniel da Silva
I can't really comment on what you're doing wrong, but I hope this points you in the right direction. Sorry I couldn't be of more help, Daniel On Tue, Aug 3, 2010 at 9:48 PM, Navkirat Singh wrote: > > On 04-Aug-2010, at 9:46 AM, Daniel da Silva wrote: > > Please po

Re: simple (I hope!) problem

2010-08-03 Thread Daniel da Silva
Why not just add the google app engine lib subdirectories to your python path? On Tue, Aug 3, 2010 at 3:09 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > samwyse wrote: > >> I'm writing for the Google app engine and have stubbed my toe yet >> again on a simple obstacle. Non-trivia

Re: Global variables problem

2010-08-03 Thread Daniel da Silva
Please post approximate code that actually works and displays the problem. On Tue, Aug 3, 2010 at 9:00 PM, Navkirat Singh wrote: > Hey guys, > > I am using a multiprocessing program, where the new process is supposed to > change a variable in the main class that it branches out from. This is > s

Re: Aaaargh! "global name 'eggz' is not defined"

2009-10-29 Thread Daniel da Silva
There are several static analysis tools that can check whether a variable name is used before it is defined. At my old workplace we used "pylint", so I can recommend that: http://www.logilab.org/857 --Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: os system command not found

2009-01-14 Thread Daniel da Silva
On Jan 14, 5:25 am, codicedave wrote: > Hi all! > I installed a external program called infomap using the classical > procedure > > ./configure > make > sudo make install > >  and it works perfectly in Terminal (Os x) using both bash and tcsh > shell > > admins-macbook-pro-2:~ unil$ infomap-build

Re: big objects and avoiding deepcopy?

2008-10-28 Thread Daniel da Silva
etimes missing for performance reasons). > > Bye, > bearophile > -- > http://mail.python.org/mailman/listinfo/python-list > -- Daniel da Silva (240) 678 - 4686 GSFC, GES-DISC 610.2 University of Maryland -- http://mail.python.org/mailman/listinfo/python-list

Re: default value in __init__

2008-10-14 Thread Daniel da Silva
is Lee Bieber KD6MOG >[EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ >(Bestiaria Support Staff: [EMAIL PROTECTED]) >HTTP://www.bestiaria.com/ > -- > http://mail.python.org/mailman/listinfo/python-list > -- Daniel da Silva (240) 678 - 4686 GSFC, GES-DISC 610.2 University of Maryland -- http://mail.python.org/mailman/listinfo/python-list

Re: Plotting libraries recommendations

2008-10-14 Thread Daniel da Silva
Seconded. If you are familiar with Matlab plotting at all, the interface is nearly identical, and the graphics are great. Daniel On Tue, Oct 14, 2008 at 9:19 AM, eliben <[EMAIL PROTECTED]> wrote: > On Oct 14, 1:18 pm, sert <[EMAIL PROTECTED]> wrote: > > I'm developing a circuit simulation applic

Re: How can I check nbr of cores of computer?

2008-07-30 Thread Daniel da Silva
Single line using /proc/cpuinfo: numprocs = [ int(line.strip()[-1]) for line in open('/proc/cpuinfo', 'r') if \ line.startswith('processor') ][-1] + 1 On Wed, Jul 30, 2008 at 2:16 PM, Dan Upton <[EMAIL PROTECTED]> wrote: > > On Wed, Jul 30, 2008 at 2:22 PM, John Nagle <[EMAIL PROTE

Re: Overloaded Functions

2008-07-29 Thread Daniel da Silva
With a little hacking, you might be able to do something like this: @overload("f", (int, int, str)) def f1(x, y, z): pass @overload("f", (str, str)) def f2(x, y): pass The way I would typically do method overloading would be as follows (this has been tested): class Person: def __in

Re: iterating "by twos"

2008-07-29 Thread Daniel da Silva
The following method is similar to the others provided, but yields an index value as well (similar to the enumerate(iterable) function). This is useful in some (but not all) situations. If the iterable object's iterator returns an even number of items then you're fine; otherwise it will throw away

Re: static variables in Python?

2008-07-29 Thread Daniel da Silva
This is the solution I suggest. It is fairly trivial, and works by introducing the "self.static" namespace for a class's static variables, in contrast to "self" for the class's instance variables. --- class Static(object): pass personStatic = Static() class Pers

Re: You, spare time and SyntaxError

2008-07-10 Thread Daniel da Silva
I applaud your creativity. Very nice. On Wed, Jul 9, 2008 at 10:56 AM, <[EMAIL PROTECTED]> wrote: > def ine(you): >yourself = "what?" >go = list("something"), list("anything") >be = "something" >please = be, yourself >yourself = "great" >for good in yourself: >if y

Re: this is simple...

2008-06-27 Thread Daniel da Silva
ToshiBoy, You might want to take a look at the filter() function, it can also be used for the kind of the thing you're doing. http://docs.python.org/tut/node7.html#SECTION00713 >>> B = range(1,27) >>> def test(b): ... if b*b in B: ... return True ... else: ...