Let child process to run while parent is out (multiprocessing)

2012-07-19 Thread John Wong
def main(...): build_id = create_build_id(...) build_stuff return build_id Suppose build_stuff compiles a C program. It could take days to finish, and notify users their builds are ready. I was thinking about using mutliprocessing to handle the build_stuff. So here is a sample: #!/us

Re: Goto

2018-01-02 Thread John Wong
I think the point is there is not much to discuss. Goto is not going to be added. Furthermore, for every program language you want to translate from source, you have to find a workaround. Otherwise, your translation will only work for languages that have goto. Even so the implementation may not be

Re: Multi-Line Strings: A Modest Proposal

2016-08-13 Thread John Wong
On Sat, Aug 13, 2016 at 8:38 PM, Lawrence D’Oliveiro wrote: > Python allows a single string literal to cross multiple lines, provided it > begins and ends with three quote characters, e.g. > > s = """this string continues > on the next line.""" > > There is a drawback with this: any white

Re: What should Python apps do when asked to show help?

2016-04-28 Thread John Wong
On Thu, Apr 28, 2016 at 1:02 PM, Dan Strohl via Python-list < python-list@python.org> wrote: > I would suggest using argparse > https://docs.python.org/3/library/argparse.html as it handles all of that > natively... including validating arguments, showing errors, help, etc... > however, assuming y

Re: Python is an Equal Opportunity Programming Language

2016-05-06 Thread John Wong
On Sat, May 7, 2016 at 12:04 AM, Chris Angelico wrote: > > > In the case of PyCon questions, I fully agree with it; there were > enough women present that it wasn't a ridiculous suggestion, and it > encourages people to speak up who might otherwise have kept quiet. But > just because that worked w

Re: Don't put your software in the public domain

2016-06-01 Thread John Wong
On Wed, Jun 1, 2016 at 4:45 PM, Lawrence D’Oliveiro wrote: > On Thursday, June 2, 2016 at 3:00:05 AM UTC+12, Steven D'Aprano wrote: > > ... because it is extremely unlikely to work. > > Which is why CC0 https://creativecommons.org/publicdomain/zero/1.0/ was > invented. > -- > This does not solve

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-22 Thread John Wong
On Wed, Jun 22, 2016 at 4:45 AM, Nick Sarbicki wrote: > On Wed, Jun 22, 2016 at 9:42 AM Miki Tebeka wrote: > > > IMO you can do that at https://www.codecademy.com/learn/python > > > > Some people might think differently but I wouldn't recommend a python > course which teaches 2.7 over 3.x. > > p

Re: [Tutor] Is context manager the answer to synchronous function calls?

2015-09-16 Thread John Wong
On Wed, Sep 16, 2015 at 7:54 AM, Mark Lawrence wrote: > > Assuming your (Alan's) guess is correct, and I certainly agree it's > plausible, I suspect this might be better asked on the main Python mailing > list, I don't see this as tutor material. > > Sorry first time posting to tutor / general li

Re: [Tutor] Is context manager the answer to synchronous function calls?

2015-09-16 Thread John Wong
because I have custom needs that cloudformation can't do elegantly without many hops. API is much more flexible for my current task, FYI. Any feedback is welcome. Thank you. John On Wed, Sep 16, 2015 at 10:53 AM, Chris Angelico wrote: > On Thu, Sep 17, 2015 at 12:34 AM, John Wong wrote: > &

Re: Automating build from source (was: Automating Sphinx generated documentation)

2015-09-18 Thread John Wong
On Fri, Sep 18, 2015 at 2:50 AM, Peter Otten <__pete...@web.de> wrote: > Ben Finney wrote: > > > David Aldrich writes: > > > >> I have setup Sphinx for my Python project. We keep all our code and > >> documentation in Subversion. > > > > It's a good idea to keep *source* files in VCS. > > > > The

Re: Linux Mint installation of Python 3.5

2015-09-30 Thread John Wong
On Tue, Sep 29, 2015 at 10:37 PM, Mario Figueiredo wrote: > Hello everyone, > > Under Linux Mint it is not a good idea to just go ahead and replace the > system installed Python versions and their packages. And yet I wish to > both update the 3.4 modules and install Python 3.5. I understand that

Re: What is wrong in this example code?

2015-11-12 Thread John Wong
If you are using Python 3 you will need to change xrange to range, but the error shouldn't be invalid syntax. I remember it should just name name not found/not defined. So if you are not using Python 3, range and xrange do still in Python 2 and they have different use case. So i am really curious