Re: Best way to (re)load test data in Mongo DB

2019-02-24 Thread Martin Sand Christensen
breamore...@gmail.com writes:
> I was going to suggest mocking. I'm no expert so I suggest that you
> search for "python test mock database" and go from there. Try to run
> tests with a real db and you're likely to be at it until domesday.

Mocking is definitely the order of the day for most tests, but I'd like
to test the data layer itself, too, and I want a number of comprehensive
function tests as well, and these need to exercise the whole stack.
Mocking is great so long as you also remember to test the things that
you mock.

The point of this exercise is to eventually release it as a sort of
example project of how to build a complex web application. Testing is
particularly important to me since it's too often being overlooked in
tutorials, or it only deals with trivial examples.


Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to (re)load test data in Mongo DB

2019-02-24 Thread Nagy László Zsolt



  Hello!

We have a system where we have to create an exact copy of the original
database for testing. The database size is over 800GB. We have found
that using zfs snapshots and zfs clone is the best option. In order to
do this, you have to enable journaling in mongodb. Then you can take a
snapshot of the live database at any time, then clone that snapshot via
"zfs clone" and finally start up a new mongodb instance on the clone.
(We are using docker containers for this, but it doesn't really matter.)
Using zfs clones has a performance penality (we have measured 80%
performance), but it is still much better than restoring such a huge
database with mongoimport. (8 hours vs. 10 seconds) Using zfs for
mongodb is not recommended anyway, but you can keep a separate replica
set member just for this purpose.

For much smaller databases, you can (of course) use pure python code to
insert test data into a test database. If it only takes seconds, then it
is not a problem, right? I believe that for small tests (e.g. unit
tests), using python code to populate a test database is just fine.

There is no "best" way to do this, and there is always a tradefoff. For
good tests, you need more data. If you want to restore more data, then
it either takes more time, or you have to use external tools.

Regarding question #2, you can always directly give an _id for documents
if you want:

https://api.mongodb.com/python/current/api/bson/objectid.html#bson.objectid.ObjectId

This will let you create a database with known _id values, and run
repeatable tests on that database.

Best,

   Laszlo


> Hi!
>
> I'm toying around with Pyramid and am using Mongo via MongoEngine for
> storage. I'm new to both Pyramid and MongoEngine. For every test case in
> the part of my suite that tests the data access layer I want to reload
> the database from scratch, but it feels like there should be a better
> and faster way than what I'm doing now.
>
> I have two distinct issues:
> 1. What's the fastest way of resetting the database to a clean state?
> 2. How do I load data with Mongo's internal _id being kept persistent?
>
> For issue #1:
> First of all I'd very much prefer to avoid having to use external client
> programs such as mongoimport to keep the number of dependencies minimal.
> Thus if there's a good way to do it through MongoEngine or PyMongo,
> that'd be preferable.
>
> My first shot at populating the database was simply to load data from a
> JSON file, use this to create my model objects (based on
> MongoEngine.Document) and save them to the DB. With a single-digit
> number of test cases and very limited data, this approach already takes
> close to a second, so I'm thinking there should be a faster way. It's
> Mongo, after all, not Oracle.
>
> My second version uses the underlying PyMongo module's insert_many()
> function to add all the documents for each collection in one go, but for
> this small amount of data it doesn't seem any faster.
>
> Which brings us to issue #2:
> For both of these strategies I'm unable to insert the Mongo ObjectId
> type _id. I haven't made _id properties part of my models, because they
> seem a bit... alien. I'd rather not include them solely to be able to
> load my test data properly. How can I populate _id as an ObjectId, not
> just as a string? (I'm assuming there's a difference, but it's never
> come up until now.)
>
>
> Am I being too difficult? I haven't been able to find much written about
> this topic: discussions about mocking drown out everything else the
> moment you mention 'mongo' and 'test' in the same search.
>
>
> Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


tkinter: variable width widgets in a grid?

2019-02-24 Thread Rich Shepard

When placing widgets (e.g., Entry, Spinbox) in a grid layout can a length
(visible width) be specified? For example, a telephone extension is a shorter
string than the number itself.

What's a good resource (other than this mail list) for such questions?

TIA,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter: variable width widgets in a grid?

2019-02-24 Thread Paul Sutton
On 24/02/2019 17:09, Rich Shepard wrote:
> When placing widgets (e.g., Entry, Spinbox) in a grid layout can a length
> (visible width) be specified? For example, a telephone extension is a
> shorter
> string than the number itself.
> 
> What's a good resource (other than this mail list) for such questions?
> 
> TIA,
> 
> Rich

Hi

Not sure if this is helpful. I wrote a small application in python-tk,
and you can indeed do this

#define boxes
namebx = Text(window, height=1, width=20)
officebx = Text(window, height=1, width=20)

With the main project (parts are work in progress) here


https://github.com/zleap/AboutMe


hope this helps

regards

Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, 
downloads, authuser FROM guests
WHERE pagesID = (SELECT ID FROM pages 
WHERE url = %s) ORDER BY visits DESC''', page )
data = pymydb.fetchall()
for visit in visits:
  visit = visit.strftime('%A %e %b,  %I:%M %p')


'visit' is being returned from database containing a MySQL datatime field that 
i want to change to another format which is ('%A %e %b, %I:%M %p') thats why 
i'm using that function. If not convert or comment out then results are not 
appearing normally.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter: variable width widgets in a grid?

2019-02-24 Thread Wildman via Python-list
On Sun, 24 Feb 2019 09:09:22 -0800, Rich Shepard wrote:

> When placing widgets (e.g., Entry, Spinbox) in a grid layout can a length
> (visible width) be specified? For example, a telephone extension is a shorter
> string than the number itself.

The height and width can be specified in the command that
creates the wedget.

> What's a good resource (other than this mail list) for such questions?

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html

> TIA,
> 
> Rich

-- 
 GNU/Linux user #557453
The cow died so I don't need your bull!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter: variable width widgets in a grid?

2019-02-24 Thread Rich Shepard

On Sun, 24 Feb 2019, Paul Sutton wrote:


Not sure if this is helpful. I wrote a small application in python-tk,
and you can indeed do this


  ...

Paul,

Thank you.

Regards,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: tkinter: variable width widgets in a grid?

2019-02-24 Thread Rich Shepard

On Sun, 24 Feb 2019, Wildman via Python-list wrote:


The height and width can be specified in the command that creates the
wedget.


Wildman,

I thought so, but these were not mentioned in Alan Moore's book which is my
reference for learning tkinter. Thus, my second question:


What's a good resource (other than this mail list) for such questions?

http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html


Excellent; I missed this in my web searchs.

Thanks very much,

Rich
--
https://mail.python.org/mailman/listinfo/python-list


Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil

Vergos,

Please provide more information and show how you've debugged the code so 
far...



On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote:

pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, 
downloads, authuser FROM guests
WHERE pagesID = (SELECT ID FROM pages 
WHERE url = %s) ORDER BY visits DESC''', page )
data = pymydb.fetchall()
 for visit in visits:
   visit = visit.strftime('%A %e %b,  %I:%M %p')


Is this the actual code? How do we get from the collection of 
tuples/dicts called "data", to an iterable called "visits"?


Also: %e should likely be %w or %d.

Which 'connector' are you using between MySQL and Python?
(may not be the same as the one I favor)



'visit' is being returned from database containing a MySQL datatime field that 
i want to change to another format which is ('%A %e %b, %I:%M %p') thats why 
i'm using that function. If not convert or comment out then results are not 
appearing normally.


Where are these actual results? (might they help us to help you?)
What do you see, as the same row/col, when using the MySQL cmdLN shell 
or MySQL-Workbench (etc)?


Have you shown us what comes back as the first row's value for "visit"?
Please check its type() before the code processes it further - is it 
coming back as a Python date or time format, or is it a string?

Remember logging or even debug print()-s are your friend!

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Dictionary

2019-02-24 Thread Himanshu Yadav
fibs={0:0,1:1}
def rfib(n):
  global fibs
   if not fibs.get(n):
fibs[n]=rfib(n-2)+rfib(n-1)
return fibs[n]

Why it is gives error??
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Dictionary

2019-02-24 Thread Peter Otten
Himanshu Yadav wrote:

> fibs={0:0,1:1}
> def rfib(n):
>   global fibs
>if not fibs.get(n):
> fibs[n]=rfib(n-2)+rfib(n-1)
> return fibs[n]

Please use cut and paste to make sure you are not introducing new errors 
like the inconsistent indentation above.
 
> Why it is gives error??

Do not leave us guessing, always describe the error you encounter as precise 
as you can.

Assuming indentation is not the problem in your actual code, here's one 
hint:

>if not fibs.get(n):

Will the if suite be executed or skipped for n == 0?

Another hint: Python's dicts support containment tests directly, with the 
'in' and the 'not in' operator. A few examples:

>>> "a" in {"a": 42, "b": 24}
True
>>> "x" in {"a": 42, "b": 24}
False
>>> "a" not in {"a": 42, "b": 24}
False
>>> "x" not in {"a": 42, "b": 24}
True


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Dictionary

2019-02-24 Thread MRAB

On 2019-02-24 04:21, Himanshu Yadav wrote:

fibs={0:0,1:1}
def rfib(n):
   global fibs
if not fibs.get(n):
 fibs[n]=rfib(n-2)+rfib(n-1)
 return fibs[n]

Why it is gives error??


What error?
--
https://mail.python.org/mailman/listinfo/python-list


Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε:
> Vergos,
> 
> Please provide more information and show how you've debugged the code so 
> far...
> 
> 
> On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote:
> > pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, 
> > hits, downloads, authuser FROM guests
> > WHERE pagesID = (SELECT ID FROM pages 
> > WHERE url = %s) ORDER BY visits DESC''', page )
> > data = pymydb.fetchall()
> >  for visit in visits:
> >visit = visit.strftime('%A %e %b,  %I:%M %p')
> 
> Is this the actual code? How do we get from the collection of 
> tuples/dicts called "data", to an iterable called "visits"?
> 
> Also: %e should likely be %w or %d.
> 
> Which 'connector' are you using between MySQL and Python?
> (may not be the same as the one I favor)
> 
> 
> > 'visit' is being returned from database containing a MySQL datatime field 
> > that i want to change to another format which is ('%A %e %b, %I:%M %p') 
> > thats why i'm using that function. If not convert or comment out then 
> > results are not appearing normally.
> 
> Where are these actual results? (might they help us to help you?)
> What do you see, as the same row/col, when using the MySQL cmdLN shell 
> or MySQL-Workbench (etc)?
> 
> Have you shown us what comes back as the first row's value for "visit"?
> Please check its type() before the code processes it further - is it 
> coming back as a Python date or time format, or is it a string?
> Remember logging or even debug print()-s are your friend!
> 
> -- 
> Regards =dn

The  'connector' that i'am using between MySQL and Python is 'bottle-pymysql'

In the following code:

def coalesce( data ):
newdata = []
seen = {}
for host, ref, location, useros, browser, visits, hits, 
downloads, authuser in data:
# Here i have to decide how to group the rows together
# I want an html row for every unique combination of 
(host) and that hits should be summed together
key = host
if key not in seen:
newdata.append( [ [host], [ref], location, 
useros, browser, [visits], hits, [downloads], authuser ] )
seen[key] = len( newdata ) - 1  # Save 
index (for 'newdata') of this row
else:   # This row is a duplicate row with a 
different referrer & visit datetime & torrent download
rowindex = seen[key]
newdata[rowindex][0].append( host )
newdata[rowindex][1].append( ref )
newdata[rowindex][5].append( visits )
newdata[rowindex][6] += hits
newdata[rowindex][7].append( downloads )
return newdata


pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, 
hits, downloads, authuser FROM guests
WHERE pagesID = (SELECT ID FROM pages 
WHERE url = %s) ORDER BY visits DESC''', page )
data = pymydb.fetchall()


newdata = coalesce( data )
for row in newdata:
(hosts, refs, location, useros, browser, visits, hits, 
downloads, authuser) = row

# start of table
pdata = pdata + ''

pdata = pdata + ' %s ' % hosts[0]

pdata = pdata + ''
for ref in refs:
pdata = pdata + ' %s ' % ref
pdata = pdata + ''

for item in (location, useros, browser):
pdata = pdata + ' %s 
' % item

print( visits )
pdata = pdata + ''
for visit in visits:
print( visit)
pdata = pdata + ' %s ' % visit
pdata = pdata + ''


if i try to print 'visits' filed before and during the loop the results is 
multiple

[Mon Feb 25 00:23:55.165094 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165098 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165102 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165107 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165111 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165115 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165119 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165123 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165127 2019] [wsgi:error] [pid 15158] [remote

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread vergos . nikolas
Τη Δευτέρα, 25 Φεβρουαρίου 2019 - 12:38:43 π.μ. UTC+2, ο χρήστης 
vergos@gmail.com έγραψε:
> Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil 
> έγραψε:
> > Vergos,
> > 
> > Please provide more information and show how you've debugged the code so 
> > far...
> > 
> > 
> > On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote:
> > > pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, 
> > > hits, downloads, authuser FROM guests
> > >   WHERE pagesID = (SELECT ID FROM pages 
> > > WHERE url = %s) ORDER BY visits DESC''', page )
> > >   data = pymydb.fetchall()
> > >  for visit in visits:
> > >visit = visit.strftime('%A %e %b,  %I:%M %p')
> > 
> > Is this the actual code? How do we get from the collection of 
> > tuples/dicts called "data", to an iterable called "visits"?
> > 
> > Also: %e should likely be %w or %d.
> > 
> > Which 'connector' are you using between MySQL and Python?
> > (may not be the same as the one I favor)
> > 
> > 
> > > 'visit' is being returned from database containing a MySQL datatime field 
> > > that i want to change to another format which is ('%A %e %b, %I:%M %p') 
> > > thats why i'm using that function. If not convert or comment out then 
> > > results are not appearing normally.
> > 
> > Where are these actual results? (might they help us to help you?)
> > What do you see, as the same row/col, when using the MySQL cmdLN shell 
> > or MySQL-Workbench (etc)?
> > 
> > Have you shown us what comes back as the first row's value for "visit"?
> > Please check its type() before the code processes it further - is it 
> > coming back as a Python date or time format, or is it a string?
> > Remember logging or even debug print()-s are your friend!
> > 
> > -- 
> > Regards =dn
> 
> The  'connector' that i'am using between MySQL and Python is 'bottle-pymysql'
> 
> In the following code:
> 
>   def coalesce( data ):
>   newdata = []
>   seen = {}
>   for host, ref, location, useros, browser, visits, hits, 
> downloads, authuser in data:
>   # Here i have to decide how to group the rows together
>   # I want an html row for every unique combination of 
> (host) and that hits should be summed together
>   key = host
>   if key not in seen:
>   newdata.append( [ [host], [ref], location, 
> useros, browser, [visits], hits, [downloads], authuser ] )
>   seen[key] = len( newdata ) - 1  # Save 
> index (for 'newdata') of this row
>   else:   # This row is a duplicate row with a 
> different referrer & visit datetime & torrent download
>   rowindex = seen[key]
>   newdata[rowindex][0].append( host )
>   newdata[rowindex][1].append( ref )
>   newdata[rowindex][5].append( visits )
>   newdata[rowindex][6] += hits
>   newdata[rowindex][7].append( downloads )
>   return newdata
> 
> 
>   pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, 
> hits, downloads, authuser FROM guests
>   WHERE pagesID = (SELECT ID FROM pages 
> WHERE url = %s) ORDER BY visits DESC''', page )
>   data = pymydb.fetchall()
> 
> 
>   newdata = coalesce( data )
>   for row in newdata:
>   (hosts, refs, location, useros, browser, visits, hits, 
> downloads, authuser) = row
> 
>   # start of table
>   pdata = pdata + ''
> 
>   pdata = pdata + ' size=3> %s ' % hosts[0]
> 
>   pdata = pdata + ''
>   for ref in refs:
>   pdata = pdata + ' %s ' % ref
>   pdata = pdata + ''
> 
>   for item in (location, useros, browser):
>   pdata = pdata + ' %s 
> ' % item
> 
>   print( visits )
>   pdata = pdata + ''
>   for visit in visits:
>   print( visit)
>   pdata = pdata + ' %s ' % visit
>   pdata = pdata + ''
> 
> 
> if i try to print 'visits' filed before and during the loop the results is 
> multiple
> 
> [Mon Feb 25 00:23:55.165094 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068] visits
> [Mon Feb 25 00:23:55.165098 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068] visits
> [Mon Feb 25 00:23:55.165102 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068] visits
> [Mon Feb 25 00:23:55.165107 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068] visits
> [Mon Feb 25 00:23:55.165111 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068] visits
> [Mon Feb 25 00:23:55.165115 2019] [wsgi:error] [pid 15158] [remote 
> 46.103.69.193:5068]

Re: How to format a datetime MySQL database field to local using strftime()

2019-02-24 Thread DL Neil

Vergos,

On 25/02/19 11:53 AM, vergos.niko...@gmail.com wrote:

Τη Δευτέρα, 25 Φεβρουαρίου 2019 - 12:38:43 π.μ. UTC+2, ο χρήστης 
vergos@gmail.com έγραψε:

Τη Κυριακή, 24 Φεβρουαρίου 2019 - 8:52:03 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε:

Vergos,

Please provide more information and show how you've debugged the code so
far...


On 25/02/19 7:03 AM, vergos.niko...@gmail.com wrote:

pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, hits, 
downloads, authuser FROM guests
WHERE pagesID = (SELECT ID FROM pages 
WHERE url = %s) ORDER BY visits DESC''', page )
data = pymydb.fetchall()
  for visit in visits:
visit = visit.strftime('%A %e %b,  %I:%M %p')


Is this the actual code? How do we get from the collection of
tuples/dicts called "data", to an iterable called "visits"?

Also: %e should likely be %w or %d.

Which 'connector' are you using between MySQL and Python?
(may not be the same as the one I favor)



'visit' is being returned from database containing a MySQL datatime field that 
i want to change to another format which is ('%A %e %b, %I:%M %p') thats why 
i'm using that function. If not convert or comment out then results are not 
appearing normally.


Where are these actual results? (might they help us to help you?)
What do you see, as the same row/col, when using the MySQL cmdLN shell
or MySQL-Workbench (etc)?

Have you shown us what comes back as the first row's value for "visit"?
Please check its type() before the code processes it further - is it
coming back as a Python date or time format, or is it a string?
Remember logging or even debug print()-s are your friend!

--
Regards =dn


The  'connector' that i'am using between MySQL and Python is 'bottle-pymysql'

In the following code:

def coalesce( data ):
newdata = []
seen = {}
for host, ref, location, useros, browser, visits, hits, 
downloads, authuser in data:
# Here i have to decide how to group the rows together
# I want an html row for every unique combination of 
(host) and that hits should be summed together
key = host
if key not in seen:
newdata.append( [ [host], [ref], location, 
useros, browser, [visits], hits, [downloads], authuser ] )
seen[key] = len( newdata ) - 1  # Save 
index (for 'newdata') of this row
else:   # This row is a duplicate row with a different 
referrer & visit datetime & torrent download
rowindex = seen[key]
newdata[rowindex][0].append( host )
newdata[rowindex][1].append( ref )
newdata[rowindex][5].append( visits )
newdata[rowindex][6] += hits
newdata[rowindex][7].append( downloads )
return newdata


pymydb.execute( '''SELECT host, ref, location, useros, browser, visits, 
hits, downloads, authuser FROM guests
WHERE pagesID = (SELECT ID FROM pages 
WHERE url = %s) ORDER BY visits DESC''', page )
data = pymydb.fetchall()


newdata = coalesce( data )
for row in newdata:
(hosts, refs, location, useros, browser, visits, hits, 
downloads, authuser) = row

# start of table
pdata = pdata + ''

pdata = pdata + ' 
%s ' % hosts[0]

pdata = pdata + ''
for ref in refs:
pdata = pdata + ' %s ' % ref
pdata = pdata + ''

for item in (location, useros, browser):
pdata = pdata + ' %s 
' % item

print( visits )
pdata = pdata + ''
for visit in visits:
print( visit)
pdata = pdata + ' %s ' % visit
pdata = pdata + ''


if i try to print 'visits' filed before and during the loop the results is 
multiple

[Mon Feb 25 00:23:55.165094 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165098 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165102 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165107 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165111 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165115 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165119 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] visits
[Mon Feb 25 00:23:55.165123 2019] [wsgi:error] [pid 15158] [remote 
46.103.69.193:5068] vi

Re: how to setup for localhost:8000

2019-02-24 Thread nathanntkou123
On Thursday, April 14, 2016 at 1:47:03 PM UTC-4, wrh...@gmail.com wrote:
> Hi,
> 
> I am working on window 7 and Python 3.5 to setup a localhost:8000 but it did 
> not get through as shown below:
> > python -m http.server
> Serving HTTP on 0.0.0.0 port 8000 ...
> 
> But it did not show the results.
> 
> Can someone help me how to setup the localhost?
> 
> Thanks,
> Wen-Ruey
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to setup for localhost:8000

2019-02-24 Thread 0x906 via Python-list
There is a chance that I missed something with the 0.0.0.0. but I am pretty 
sure that the localhost IP is 127.0.0.1. 



> On Feb 24, 2019, at 6:13 PM, nathanntkou...@gmail.com wrote:
> 
> On Thursday, April 14, 2016 at 1:47:03 PM UTC-4, wrh...@gmail.com wrote:
>> Hi,
>> 
>> I am working on window 7 and Python 3.5 to setup a localhost:8000 but it did 
>> not get through as shown below:
>>> python -m http.server
>> Serving HTTP on 0.0.0.0 port 8000 ...
>> 
>> But it did not show the results.
>> 
>> Can someone help me how to setup the localhost?
>> 
>> Thanks,
>> Wen-Ruey
> -- 
> https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: how to setup for localhost:8000

2019-02-24 Thread Cameron Simpson

On 24Feb2019 19:00, 0x906  wrote:
I am working on window 7 and Python 3.5 to setup a localhost:8000 
but it did not get through as shown below:

python -m http.server

Serving HTTP on 0.0.0.0 port 8000 ...
But it did not show the results.
Can someone help me how to setup the localhost?


There is a chance that I missed something with the 0.0.0.0. but I am pretty 
sure that the localhost IP is 127.0.0.1.


Yeah. 0.0.0.0 is the wildcard address: the server will be listening on 
all the available addresses (127.0.0.1 and also any LAN address).


Wen-Ruey may simply be missing that it is just running a web server. To 
actually see anything she/he needs to hit it with a web browser, for 
example with a URL like:


 http://127.0.0.1:8000/

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[ANN] PyYAML-5.1b1: YAML parser and emitter for Python

2019-02-24 Thread Ingy dot Net
===
 Announcing PyYAML-5.1b1 (First beta release)
===

The first beta release of PyYAML-5.1 has been uploaded to pypi.org. The
final
release is expected to land in the next 2 weeks. Normally we would only
announce the final release, but this one has been a long time coming and has
major changes, so we want people to know about the release process early on.


A new MAJOR RELEASE of PyYAML is now available:
https://pypi.org/project/PyYAML/

This is the first major release of PyYAML under the new maintenance team.

Among the many changes listed below, this release specifically addresses the
arbitrary code execution issue raised by:

https://nvd.nist.gov/vuln/detail/CVE-2017-18342

(See https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
for complete details).

The PyYAML project is now maintained by the YAML and Python communities.
Planning happens on the #yaml-dev, #pyyaml and #libyaml IRC channels on
irc.freenode.net.


Changes
===

* https://github.com/yaml/pyyaml/pull/35  -- Some modernization of the test
running
* https://github.com/yaml/pyyaml/pull/42  -- Install tox in a virtualenv
* https://github.com/yaml/pyyaml/pull/45  -- Allow colon in a plain scalar
in a flow context
* https://github.com/yaml/pyyaml/pull/48  -- Fix typos
* https://github.com/yaml/pyyaml/pull/55  -- Improve RepresenterError
creation
* https://github.com/yaml/pyyaml/pull/59  -- Resolves #57, update readme
issues link
* https://github.com/yaml/pyyaml/pull/60  -- Document and test Python 3.6
support
* https://github.com/yaml/pyyaml/pull/61  -- Use Travis CI built in pip
cache support
* https://github.com/yaml/pyyaml/pull/62  -- Remove tox workaround for
Travis CI
* https://github.com/yaml/pyyaml/pull/63  -- Adding support to Unicode
characters over codepoint 0x
* https://github.com/yaml/pyyaml/pull/65  -- Support unicode literals over
codepoint 0x
* https://github.com/yaml/pyyaml/pull/75  -- add 3.12 changelog
* https://github.com/yaml/pyyaml/pull/76  -- Fallback to Pure Python if
Compilation fails
* https://github.com/yaml/pyyaml/pull/84  -- Drop unsupported Python 3.3
* https://github.com/yaml/pyyaml/pull/102 -- Include license file in the
generated wheel package
* https://github.com/yaml/pyyaml/pull/105 -- Removed Python 2.6 & 3.3
support
* https://github.com/yaml/pyyaml/pull/111 -- Remove commented out Psyco code
* https://github.com/yaml/pyyaml/pull/129 -- Remove call to `ord` in lib3
emitter code
* https://github.com/yaml/pyyaml/pull/143 -- Allow to turn off sorting keys
in Dumper
* https://github.com/yaml/pyyaml/pull/149 -- Test on Python 3.7-dev
* https://github.com/yaml/pyyaml/pull/158 -- Support escaped slash in
double quotes "\/"
* https://github.com/yaml/pyyaml/pull/256 -- Make default_flow_style=False
* https://github.com/yaml/pyyaml/pull/257 -- Deprecate yaml.load and add
FullLoader and UnsafeLoader classes


Resources
=

PyYAML IRC Channel: #pyyaml on irc.freenode.net
PyYAML homepage: https://github.com/yaml/pyyaml
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.org/project/PyYAML/
GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list:
http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter
for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistence.


Example
===

>>> import yaml

>>> yaml.load("""
... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: https://github.com/yaml/pyyaml
... keywords: [YAML, serialization, configuration, persistence, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistence',
'pickle'], 'homepage': 'https://github.com/yaml/pyyaml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}

>>> print yaml.dump(_)
name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]


Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Ingy döt Net
* Tina Mueller
* Matt Davis

and many thanks to all who have contribributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2019 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by