Re: Question about Source Control

2014-03-24 Thread Frank Millman
"Rustom Mody" wrote in message news:19d3ddc9-0fb9-476d-a117-e5f174eca...@googlegroups.com... > On Monday, March 17, 2014 6:36:33 PM UTC+5:30, Frank Millman wrote: >> Hi all > >> I know I *should* be using a Source Control Management system, but at >> p

Gauteng Usergroup Meeting

2014-04-03 Thread Frank Millman
would mention it here in case others are equally unaware. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of things with dictionaries

2014-04-08 Thread Frank Millman
fault('a', get_value('xyz')) getting value xyz 'xyzxyz' >>> my_dict.setdefault('a', get_value('abc')) getting value abc 'xyzxyz' >>> my_dict {'a': 'xyzxyz'} >>> It seems odd. Is there a situation where this behaviour is useful? Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of things with dictionaries

2014-04-08 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmpk-rqx0fp6_4vxyus2z34vc5fq_qntj+q9+kn8y5u...@mail.gmail.com... > On Tue, Apr 8, 2014 at 5:14 PM, Frank Millman wrote: >> It appears that when you use 'setdefault', the default is always >> evaluated, >> e

Re: Keeping track of things with dictionaries

2014-04-08 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidmP5Bevbace9GyQrVXe-_2T=jtpq1yvapsaepvomqe...@mail.gmail.com... > On Tue, Apr 8, 2014 at 1:14 AM, Frank Millman wrote: >> >> It appears that when you use 'setdefault', the default is always >> evaluated, >>

Re: Keeping track of things with dictionaries

2014-04-08 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmoRxEhX02ZviHiLO+qi+dD+81smbGGYcPECpHb5E=p4=a...@mail.gmail.com... > On Tue, Apr 8, 2014 at 6:26 PM, Frank Millman wrote: >>> words_by_length = {} >>> for word in open("/usr/share/dict/words"): >>>

Re: Keeping track of things with dictionaries

2014-04-08 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmppaqmb6no7udddadqg_jv9yz0sn4d70kasksbwwr3...@mail.gmail.com... > On Tue, Apr 8, 2014 at 7:28 PM, Frank Millman wrote: >> Are you saying that >> >> all([len(word) == 23 for word in words_by_length[23]]) # hope I g

Re: threading

2014-04-09 Thread Frank Millman
that a response is returned quickly (however one defines quickly) but I cannot guarantee it if the database server is under stress. Is this a good candidate for async, or not? Thanks for any insights. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: threading

2014-04-09 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmqwhb8o8vq84mmtv+-rkc3ff1aqdxe5cs8y5gy02kh...@mail.gmail.com... > On Wed, Apr 9, 2014 at 11:23 PM, Frank Millman wrote: > >> How does one distinguish betwen 'blocking' and 'non-blocking'? Is it >> e

Re: threading

2014-04-09 Thread Frank Millman
"Marko Rauhamaa" wrote in message news:87lhveobeq@elektro.pacujo.net... > "Frank Millman" : > >> I understand that, if one uses threading, each thread *can* block >> without affecting other threads, whereas if one uses the async >> approach, a re

Re: threading

2014-04-10 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmq2xx_WG2ymCC0NNqisDO=dnnjhnegpid3de+xeiy5...@mail.gmail.com... > On Thu, Apr 10, 2014 at 12:30 AM, Frank Millman > wrote: >> >>> >>>> How does one distinguish betwen 'blocking' and 'no

Re: threading

2014-04-10 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmoWaHPZk=DAxbfJ=9ez2aj=4yf2c8wmbryof5vgn6e...@mail.gmail.com... > On Thu, Apr 10, 2014 at 7:17 PM, Frank Millman wrote: >> The current version of my program uses HTTP. As I understand it, a client >> makes a connection a

Re: Strange syntax error, occurs only when script is executed directly

2014-04-22 Thread Frank Millman
w the shell interprets the '#!' line. My editor allows me to re-save a file using a different format, so I saved it as 'unix', reran it, and it worked. HTH Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode in Python

2014-04-26 Thread Frank Millman
gt; give the illusion they are properly working. > It is quite frustrating when you make these statements without explaining what you mean by 'not working'. It would be really useful if you could spell out - 1. what you did 2. what you expected to happen 3. what actual

Re: Python and Math

2014-05-20 Thread Frank Millman
rk, but when I ran 'ipython notebook' it failed on 'import pyzmq'. I ran 'pip install pyzmq', tried again, and it failed on 'import jinja2'. I used pip to install that, then it failed on 'import tornado'. I used pip to install that, and now it

Re: Python and Math

2014-05-22 Thread Frank Millman
grade even if I already have it. > Indeed it did - thanks for the tip. I used pip to uninstall jinja2. Afterwards, running 'ipython notebook' predictably failed. Then I ran the above command to upgrade ipython notebook. It figured out that jinja2 was missing and re-installed it. Now it wo

Re: Benefits of asyncio

2014-06-03 Thread Frank Millman
x27;, and for every potentially blocking request, grab a connection, set up a callback or a 'yield from' to wait for the response, and unblock. Provided the requests return quickly, I would have thought a hundred database connections could support thousands of users. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread Frank Millman
"Neil Cerutti" wrote in message news:b5sk3cfkiq...@mid.individual.net... > On 2013-07-31, Frank Millman wrote: >> >> >> Can anyone explain *why* the results do not compare equal? If I >> understood the problem, I might be able to find a workaround. &

Re: Problem with psycopg2, bytea, and memoryview

2013-08-01 Thread Frank Millman
e a standalone objects when there is an obvious > alternative (in this case, bytes). For the record, I forwarded this to the psycopg2 list, and got the following reply from Daniele Varrazzo - Hi Frank, thank you for forwarding the thread. Until a not very long time ago, this was exactl

Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Hi Steven, Yea this is great. Thanks for the feedback. On Saturday, August 24, 2013 3:27:45 AM UTC-7, Steven D'Aprano wrote: > On Fri, 23 Aug 2013 22:25:55 -0700, snarf wrote: > > > > [...] > > > * Seems like exception handing within Classes is largely avoided and is > > > typically only use

Re: Exception Handling Practices / Patterns

2013-08-24 Thread frank . ruiz
Appreciate the feedback. I was hoping to get as much perspective as possible. On Saturday, August 24, 2013 12:18:59 AM UTC-7, Dave Angel wrote: > snarf wrote: > > > > > Greetings, > > > > > > As I tread through my journey of OO I am trying to determine if there is a > > good approach for ex

Re: I am never going to complain about Python again

2013-10-10 Thread Frank Millman
s to the same type, the triple form does not. '1' == 1 returns true '1' === 1 returns false The moment I discovered this, I changed all my operators from the double form to the triple form. Now I no longer have surprises of this nature. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: I am never going to complain about Python again

2013-10-10 Thread Frank Millman
"MRAB" wrote in message news:52568b30.8040...@mrabarnett.plus.com... > On 10/10/2013 09:23, Frank Millman wrote: >> >> "Steven D'Aprano" wrote in message >> news:52562ee3$0$2931$c3e8da3$76491...@news.astraweb.com... >>> Just came across t

Re: Python Front-end to GCC

2013-10-22 Thread Frank Miles
On Tue, 22 Oct 2013 16:40:32 +, Steven D'Aprano wrote: > On Tue, 22 Oct 2013 15:39:42 +, Grant Edwards wrote: > >>> No, I was thinking of an array. Arrays aren't automatically >>> initialised in C. >> >> If they are static or global, then _yes_they_are_. They are zeroed. > > Not that I

Python in The Economist

2015-02-26 Thread Frank Millman
Python. Here is a link to the full article - http://www.economist.com/news/business/21644150-battle-software-talent-other-industries-can-learn-silicon-valley-how-bag Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Question about importlib

2015-03-07 Thread Frank Millman
me timing tests, and the overhead does indeed seem to be minimal - 0.0001 sec on a slow desktop machine. I think it is still worth posting, for any insights into either question. Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about importlib

2015-03-07 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmrXp4MSO9f=xb_brupnrz7xrksktkbfvo-e5n7lr_m...@mail.gmail.com... > On Sun, Mar 8, 2015 at 6:30 PM, Frank Millman wrote: >> Actually, as I write this, I realise that there is a more important >> question >> that had not

Re: I want to get involved with Python!

2015-03-11 Thread Frank Millman
ve a look through the archives. Both groups organise monthly meetings - a good opportunity to mix with other Python developers. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Dict comprehensions - improvement to docs?

2015-03-15 Thread Frank Millman
t the Library Reference should be updated to include dict comprehensions. Just checking here first before I raise a Documentation issue. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Dict comprehensions - improvement to docs?

2015-03-15 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidnTUifj_L=DSH_8s+z0L44pxVvdpG1+pfz1Tzm=ect...@mail.gmail.com... > On Sun, Mar 15, 2015 at 11:25 PM, Frank Millman > wrote: >> Hi all >> >> I like dict comprehensions, but I don't use them very often, so when I

Re: Dict comprehensions - improvement to docs?

2015-03-16 Thread Frank Millman
"Paul Rubin" wrote in message news:87fv95fom0@jester.gateway.sonic.net... > "Frank Millman" writes: >> I like dict comprehensions, but I don't use them very often, so when I do >> I >> need to look up the format. > > I never felt a need

Re: Dict comprehensions - improvement to docs?

2015-03-16 Thread Frank Millman
> http://bugs.python.org/issue23677 Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: Dict comprehensions - improvement to docs?

2015-03-16 Thread Frank Millman
"Paul Rubin" wrote in message news:87wq2hfibu@jester.gateway.sonic.net... > "Frank Millman" writes: >> dict((a, b) for a, b in zip(x, y)) >> 10 loops, best of 3: 16.1 usec per loop >> {a: b for a, b in zip(x, y)}" >> 10 loo

Re: Dict comprehensions - improvement to docs?

2015-03-16 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzid=u19ymkfjbhblzi1qh2u9uk4ohy5wco1zo-i3t5at...@mail.gmail.com... > On Mon, Mar 16, 2015 at 3:01 AM, Frank Millman wrote: >> C:\>python -m timeit -s "x = range(65, 91); y = (chr(z) for z in x)" >> "dict(zip(x, y))

Re: Dict comprehensions - improvement to docs?

2015-03-18 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidmNDcSvER7S6inEaVZA=DHUrDX1KzL-WRVwhd=o3_l...@mail.gmail.com... > On Tue, Mar 17, 2015 at 12:44 AM, Frank Millman > wrote: >> Thanks for the explanation. I'll try not to make that mistake again. >> >> However, to g

Re: Sudoku solver

2015-03-26 Thread Frank Millman
less than a second. It could not solve Marko's second one, returning "impossible" immediately. Here is another one that does not use python, but uses SQL - https://www.sqlite.org/lang_with.html You will find it at the bottom of the page, under the heading "Outlandish Recu

Re: Sudoku solver

2015-03-27 Thread Frank Millman
"Marko Rauhamaa" wrote in message news:87fv8sndw1@elektro.pacujo.net... > "Frank Millman" : > >> Here is another python-based sudoku solver - >> >> http://www.ics.uci.edu/~eppstein/PADS/Sudoku.py >> >>>From its docstring - >&g

Re: Sudoku solver

2015-03-27 Thread Frank Millman
on). It is possible to construct minimum puzzles with different numbers of givens. The minimum number of givens refers to the minimum over all proper puzzles and identifies a subset of minimum puzzles. So what I am talking about is called a "satisfactory" puzzle, which is a subset of a "pr

Is this unpythonic?

2015-05-08 Thread Frank Millman
ot; it looks wrong because I have been conditioned to think of it as a gotcha. Would it be more pythonic to change them all to use the alternative "z=None", or is it ok to leave it as it is? Or to phrase it differently, how would an experienced pythonista react on seeing this when rev

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Steven D'Aprano" wrote in message news:554c8b0a$0$12992$c3e8da3$54964...@news.astraweb.com... > On Fri, 8 May 2015 06:01 pm, Frank Millman wrote: > >> Hi all >> [...] >> >> However, every time I look at my own code, and I see "def x(y, z=[

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Ben Finney" wrote in message news:85y4kzb90f@benfinney.id.au... > "Frank Millman" writes: > >> If I use a list as an argument, I only use it to pass values *into* >> the function, but I never modify the list. > > You've had good reas

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Dave Angel" wrote in message news:554ca652.1000...@davea.name... > On 05/08/2015 06:53 AM, Frank Millman wrote: >> > > It might be appropriate to define the list at top-level, as > > EMPTY_LIST=[] > > and in your default argument as > def x(y,

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Steven D'Aprano" wrote in message news:554cd119$0$12977$c3e8da3$54964...@news.astraweb.com... > On Fri, 8 May 2015 08:53 pm, Frank Millman wrote: > >>> Does z have to be a list? Could you use an empty tuple instead? >>> >>> def x(y, z=()):

Re: Is this unpythonic?

2015-05-08 Thread Frank Millman
"Frank Millman" wrote in message news:mik7j6$59n$1...@ger.gmane.org... > > "Steven D'Aprano" wrote in message > news:554cd119$0$12977$c3e8da3$54964...@news.astraweb.com... >> On Fri, 8 May 2015 08:53 pm, Frank Millman wrote: >> >>>&

Re: Is this unpythonic?

2015-05-09 Thread Frank Millman
"Gregory Ewing" wrote in message news:cr5sc6fgfm...@mid.individual.net... > Frank Millman wrote: > > The absolutely clearest way to write it would > probably be > >def f(things = None): > "things is a mapping of stuff to be operated on" >

Re: Is this unpythonic?

2015-05-10 Thread Frank Millman
expand the explanation to show why a tuple is used instead. So if there was a situation where the overhead of testing for None became a problem, this solution offers the following - 1. it solves the 'overhead' problem 2. it reads reasonably intuitively in the body of the program 3. it is safe 4. it should not be difficult to write a suitable self-explanatory comment Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: Is this unpythonic?

2015-05-10 Thread Frank Millman
"Johannes Bauer" wrote in message news:min9t3$e56$1...@news.albasani.net... On 10.05.2015 10:58, Frank Millman wrote: > > It is then a simple extra step to say - > > > > EMPTY_L:IST = () > > > > and if required - > > > > EMPTY_DICT = () >

Re: Slightly OT: Seeking (python-based) project diary tool, or framework to write one

2015-05-19 Thread Frank Millman
tes and more." There seems to be at least some overlap with your requirements, so it may be worth a look. It uses wxPython. According to their download page it only works with Python 2.x, but as wxPython for Python3 is getting closer, hopefully it is on their roadmap to target P

Re: How to access the low digits of a list

2015-06-02 Thread Frank Stutzman
; > ['12', '42', '49', '56', '25', '36', '49', '64', '81', '00'] > > > When I try to use lines[3][0] is '1' > lines[3][1] is '5' > lines[3][2] is '6' Is there something wrong with using: lines[3][-2:] -- Frank Stutzman -- https://mail.python.org/mailman/listinfo/python-list

Re: Argument Presence Checking via Identity or Boolean Operation?

2015-06-04 Thread Frank Millman
self.arg = arg or [] Based on your comment, I have changed it to - def __init__(self, arg=None): self.arg = [] if arg is None else arg Does this pass your 'stop and consider' test? Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Which GUI?

2015-07-24 Thread Frank Miles
On Fri, 24 Jul 2015 19:31:36 +0100, Paulo da Silva wrote: [snip] > Which technology is better? > matplotlib? > tkinter? > wxwidgets? > qt? Sadly - I don't think wxpython has been ported to python3 yet. -- https://mail.python.org/mailman/listinfo/python-list

Data integrity problem with sqlite3

2015-08-11 Thread Frank Millman
o mimic all of this. I will persevere, but in the meantime, does anyone happen to know under what other circumstances sqlite3 might issue an implicit commit? Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Data integrity problem with sqlite3

2015-08-11 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmrHmj2bsdSm4CQ=orgxutmyctk3w3e3n-qxolg2tvq...@mail.gmail.com... On Tue, Aug 11, 2015 at 9:33 PM, Frank Millman wrote: > I have added 'set_trace_callback' to see exactly what is going on, and > in > the middle of my

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... Hi all I have a 'data integrity' problem with sqlite3 that I have been battling with for a while. I have not got to the bottom of it yet but I do have some useful info, so I thought I would post it h

Re: Data integrity problem with sqlite3 - solved

2015-08-11 Thread Frank Millman
"Frank Millman" wrote in message news:mqcslv$tee$1...@ger.gmane.org... "Frank Millman" wrote in message news:mqcmie$po9$1...@ger.gmane.org... > Hi all > > I have a 'data integrity' problem with sqlite3 that I have been battling > with for a while.

Re: How to model government organization hierarchies so that the list can expand and compress

2015-08-13 Thread Frank Millman
the gui that you choose. Most gui toolkits will have a 'tree' widget, and hopefully make it easy to implement 'drag-and-drop' between the nodes. Then your task becomes one of getting the data out of the database and into the gui, and back again. Once you get used to the concepts

Re: How to model government organization hierarchies so that the list can expand and compress

2015-08-14 Thread Frank Millman
"Alex Glaros" wrote in message news:ae4e203d-c664-4388-af0b-41c41d5ec...@googlegroups.com... Frank, thanks for describing the terminology of what I'm trying to do. 1. Do the recursive join Postgres examples you linked to, use a data structure where the child has the adjo

Question about import

2015-09-10 Thread Frank Millman
and then just use 'import package_name' inside each module? Another question - I thought that, because aa.py and bb.py are in different sub-directories, I would have to set them up as packages by adding '__init__.py' to each one, but it works fine without that. What am I m

Re: Question about import

2015-09-10 Thread Frank Millman
"Ian Kelly" wrote in message news:calwzidm3khnagtt0ohveo5bhqk1tfejbuuuinw9tnuxrpnr...@mail.gmail.com... On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote: > That makes me wonder if, in my project, I can import all modules inside > 'start.py', and then just use &#

foldername change killed python

2015-09-17 Thread Frank Huurman
thon 3.5 didn't exist while IDLE was just sitting there in my start menu. It's a stupid thing but I know for sure a lot of people are going nuts because they did something like I did today. Kind Regards, Frank. -- https://mail.python.org/mailman/listinfo/python-list

Re: foldername change killed python

2015-09-17 Thread Frank Huurman
Still doesn't work with the default path. For some reason the script that worked 20 mins ago in IDLE using "import win32com.client" can't find the module anymore so I messed it up somewhere. 2015-09-17 1:45 GMT+02:00 Frank Huurman : > Heya, I just uninstalled Python 3.

Re: Using pipe in a system call

2015-10-10 Thread Frank Millman
t;SELECT spreekwoord " "FROM spreekwoorden " "ORDER BY spreekwoord COLLATE LOCALIZED" ) To my eye, the result is nicer, at virtually no extra effort. Just don't forget the trailing space on all but the last line. Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Traceback error

2015-11-20 Thread Frank Millman
back (most recent call last): File "python", line 1, in NameError: name 'j' is not defined Any ideas how to debug this ? It looks to me as if the error is right there on the first line. What is that 'j' doing there? It looks like a typo. HTH Frank Mill

Re: *= operator

2015-11-21 Thread Frank Millman
be rewritten as x = x + 1 to achieve a similar, but not exactly equal effect. In the augmented version, x is only evaluated once. Also, when possible, the actual operation is performed in-place, meaning that rather than creating a new object and assigning that to the target, the old object is modified instead." Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: print("%.2f" % total)

2015-11-21 Thread Frank Millman
ormat(), your example would look like this - print('{:.2f}'.format(total)) Another word of warning. Using a format specifier displays the value nicely rounded to a number of decimal places, but the original value is unchanged. Use the interpreter to see what the actual value is. For

try/except/finally

2014-06-06 Thread Frank B
Ok; this is a bit esoteric. So finally is executed regardless of whether an exception occurs, so states the docs. But, I thought, if I from my function first, that should take precedence. au contraire Turns out that if you do this: try: failingthing() except FailException: return 0 fina

Re: try/except/finally

2014-06-06 Thread Frank B
Ok; thanks for the underscore and clarification. Just need to adjust my thinking a bit. -- https://mail.python.org/mailman/listinfo/python-list

asyncio - how to stop loop?

2014-06-11 Thread Frank Millman
see what happens) def stop_loop(): loop.stop() loop.close() loop = asyncio.get_event_loop() loop.call_later(2, stop_loop) loop.run_forever() Both platforms show the same traceback, after two seconds - Traceback (most recent call last): File "C:\Documents and S

Re: asyncio - how to stop loop?

2014-06-12 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidnv07Wba9WJ=nuc0_v4mvudyaxwh6bgjvw0o1hf3oo...@mail.gmail.com... > On Wed, Jun 11, 2014 at 1:19 AM, Frank Millman wrote: >> First attempt - same as before >> >> loop = asyncio.get_event_loop() >> threading.

Question about asyncio

2014-06-13 Thread Frank Millman
yself I would like to know if this feels like the right approach. Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about asyncio

2014-06-17 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidmzG_WA5shw+PS4Y976M4DVTOwE=zb+kurvcpj3n+5...@mail.gmail.com... > On Fri, Jun 13, 2014 at 5:42 AM, Frank Millman wrote: >> Now I want to use the functionality of asyncio by using a 'yield from' to >> suspend th

Re: Is pip being automatically installed for Python 3.4.0?

2014-07-02 Thread Frank Liou
it's truth pip will be automatically install Python3.4.0 if you want to use another version you should use wget -- https://mail.python.org/mailman/listinfo/python-list

Re: How can I catch values from other def by flask???

2014-07-02 Thread Frank Liou
Steven Thank you!!! it's work i'm so appreciate that hava a nice day^^ -- https://mail.python.org/mailman/listinfo/python-list

flask sql cann't insert Variable in VALUES

2014-07-04 Thread Frank Liou
I try to insert username in to my table it show Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. it maybe mean no request i try to change username to '123123' then

Re: flask sql cann't insert Variable in VALUES

2014-07-06 Thread Frank Liou
Thank you CA learn so much from your words -- https://mail.python.org/mailman/listinfo/python-list

same code same tables but not the same result(use flask and postgres)

2014-07-09 Thread Frank Liou
i use flask connect to postgres def post_insert(username): conn = engine.connect() encoded = base64.b64encode(username.encode('utf-8')) puresql = sqla.text("INSERT INTO friends(name) VALUES(:encoded)") conn.execute(puresql,encoded = encoded) i insert username encode with base64 t

Re: same code same tables but not the same result(use flask and postgres)

2014-07-09 Thread Frank Liou
Hi ChrisA i use same workspace all the same python 3.3 -- https://mail.python.org/mailman/listinfo/python-list

Re: same code same tables but not the same result(use flask and postgres)

2014-07-09 Thread Frank Liou
oh by the way one of database version is postgres 80420 another is 90304 80420 is fine but 90304 is so strange -- https://mail.python.org/mailman/listinfo/python-list

How can i get http body??

2014-07-09 Thread Frank Liou
https://lh5.googleusercontent.com/-6t5tmr5T4Ys/U74FdF128oI/Bvo/bYyaHzsdw9Q/s1600/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg how can i catch the "body" when i was post ?? i want to catch body to my database and encode to base64 def hello(username): if request.method=='POST': pos

Re: How can i get http body??

2014-07-10 Thread Frank Liou
Got it Thanks you -- https://mail.python.org/mailman/listinfo/python-list

base64 convert to binary by binascii is that right?

2014-07-11 Thread Frank Liou
conn = engine.connect() encoded = base64.b64encode(getbody) binary_string = binascii.a2b_base64(encoded) puresql = sqla.text("INSERT INTO friends(name) VALUES(:binary_string)") conn.execute(puresql,binary_string = binary_string) first getbody trans to base64 then i convert t

how can i get "body" values?

2014-07-11 Thread Frank Liou
how can i get body values use variable to Separate catch? https://lh3.googleusercontent.com/-6Ywp4GukuCM/U7-vhF0nzuI/Bv4/Ovcr1O2FScs/s1600/321.jpg i want to catch name and key values now i use request.data i can catch all the body but how can i use variable to separate and catch? --

Re: Python 3 is killing Python

2014-07-16 Thread Frank Millman
their lives made much easier by the changes to Python3 - a 'silent majority'? I don't mean an absolute majority, as I believe there are still more Python2 users than Python3. But of those who have made the switch from 2 to 3, maybe most of them are quite happy. If so, then the

Re: Python 3 is killing Python

2014-07-16 Thread Frank Millman
Python 2.7 as an alternative to b'', to faciliate writing code that works on both versions. There would be a lot of overlap with b'...', but the differences could be documented. Methods could be added to B'' to replicate any behaviour of b'' which ha

Re: Python 3 is killing Python

2014-07-16 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmr4nPA6euD-j2uNAN==h=ids1o5bdhgj0fnjkjo9wf...@mail.gmail.com... > On Thu, Jul 17, 2014 at 12:27 AM, Frank Millman > wrote: > >> Unfortunately, human nature being what it is, the possibility of this >> split >>

Re: Python 3 is killing Python

2014-07-17 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmot9q2cuyy5jc6keycxyp8_usjhr1y8e+z+t70qnc5...@mail.gmail.com... > On Thu, Jul 17, 2014 at 4:31 PM, Frank Millman wrote: >> It is worth watching this - >> https://www.youtube.com/watch?v=skYBOXE02OQ > > Not in a po

Unicode, stdout, and stderr

2014-07-21 Thread Frank Millman
ng to stdout and writing to stderr. My questions are - 1. What is the difference? 2. Is there an easy way to get stdout to behave the same as stderr? Thanks Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Lele Gaifax" wrote in message news:87lhrl28ie.fsf@nautilus.nautilus... > "Frank Millman" writes: > >> Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 >> bit >> (In >> tel)] on win32 >> Type "help",

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Steven D'Aprano" wrote in message news:53ce0b96$0$29897$c3e8da3$54964...@news.astraweb.com... > On Tue, 22 Jul 2014 08:18:08 +0200, Frank Millman wrote: > >> Hi all >> >> This is not important, but I would appreciate it if someone could >> expla

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Lele Gaifax" wrote in message news:87d2cx271o.fsf@nautilus.nautilus... > "Frank Millman" writes: > >>> No, both statements actually emit noise on the standard output, but the >>> former prints the *repr* of the string, the latter tries to encode it

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Peter Otten" <__pete...@web.de> wrote in message news:lql3am$2q7$1...@ger.gmane.org... > Frank Millman wrote: > >> Hi all >> >> This is not important, but I would appreciate it if someone could explain >> the following, run from cmd.exe on Windows

Re: Unicode, stdout, and stderr

2014-07-22 Thread Frank Millman
"Peter Otten" <__pete...@web.de> wrote in message news:lql9oi$hlt$1...@ger.gmane.org... > Frank Millman wrote: > [...] > >> Out of interest, does the same thing happen when writing to sys.stderr? > > If you are asking about the fallback mechanism, that is

What happens when you 'break' a generator?

2014-07-29 Thread Frank Millman
'x' goes out of scope, the generator is garbage collected, even though it never completed. Is this correct? Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: What happens when you 'break' a generator?

2014-07-29 Thread Frank Millman
"Peter Otten" <__pete...@web.de> wrote in message news:lr7ilg$de4$1...@ger.gmane.org... > Frank Millman wrote: > >> Hi all >> >> Python 3.4.1 >> >> Here is a simple generator - >> >> def test(): >> print('start&

Second edition - Porting to Python 3

2014-07-31 Thread Frank Millman
rdles and shows you the new Python features. Here is the link - http://python3porting.com/ Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Pythonic way to iterate through multidimensional space?

2014-08-05 Thread Frank Miles
I need to evaluate a complicated function over a multidimensional space as part of an optimization problem. This is a somewhat general problem in which the number of dimensions and the function being evaluated can vary from problem to problem. I've got a working version (with loads of conditional

Re: Pythonic way to iterate through multidimensional space?

2014-08-05 Thread Frank Miles
On Tue, 05 Aug 2014 20:06:05 +, Frank Miles wrote: > I need to evaluate a complicated function over a multidimensional space > as part of an optimization problem. This is a somewhat general problem > in which the number of dimensions and the function being evaluated can > vary

newbee

2014-08-12 Thread Frank Scafidi
a program I've written, reload it in Python, list the program once it's loaded? How do I edit a program? Are these command line functions? Thanks Frank -- https://mail.python.org/mailman/listinfo/python-list

Re: why no 2to3 in my python?

2014-08-20 Thread Frank Millman
"luofeiyu" wrote in message news:53f463c1.5060...@gmail.com... > why no 2to3 in my python34,how can i change python 2 into python3? > >dir d:\Python34\Scripts You will find it in \Python34\Tools\Scripts Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between name and _name?

2014-08-20 Thread Frank Millman
turned up this in-depth explanation - http://stackoverflow.com/questions/17330160/how-does-the-property-decorator-work HTH Frank Millman -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >