I just wrote the code with Python 3.6.1, I am just a beginner in python.
while compiling having below error, can anyone help me in this
TypeError: a bytes-like object is required, not 'str'
The code I wrote:
import socket
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connec
Hi,
TypeError: a bytes-like object is required, not 'str'
...
mysock.send('GET http://data.pr4e.org/intro-short.txt HTTP/1.0\n\n')
Here you must encode the str as bytes:
mysock.send('GET http://data.pr4e.org/intro-short.txt
HTTP/1.0\n\n'.encode("UTF-8"))
The actual encoding does not
On Fri, Jun 16, 2017 at 7:06 PM, JAIDIP patel wrote:
> The code I wrote:
>
> import socket
>
> mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> mysock.connect(('data.pr4e.org', 80))
> mysock.send('GET http://data.pr4e.org/intro-short.txt HTTP/1.0\n\n')
> while True:
> data =x.recv(
On Fri, 16 Jun 2017 00:10:58 +1000, Chris Angelico wrote:
> On Fri, Jun 16, 2017 at 12:00 AM, alister
> wrote:
>> On Thu, 15 Jun 2017 22:27:40 +1000, Chris Angelico wrote:
>>
>>> On Thu, Jun 15, 2017 at 9:47 PM, Rhodri James
>>> wrote:
> 1) It is not secure. Check this out:
> https://sta
On Thu, 15 Jun 2017 21:17:05 +0100, Erik wrote:
> On 15/06/17 15:10, Chris Angelico wrote:
>> On Fri, Jun 16, 2017 at 12:00 AM, alister
>> wrote:
>>> Json is designed to be legal Javascript code & therefore directly
>>> executable so no parser is posible.
>>>
>>>
>> "no parser is possible"???
>
On Thu, 15 Jun 2017 21:11:41 -0600, Ian Kelly wrote:
> On Thu, Jun 15, 2017 at 8:51 PM, Larry Martell
> wrote:
>> On Thu, Jun 15, 2017 at 6:35 PM, Christopher Reimer
>> wrote:
>>> One commentator on a tech website admonished programmers for wasting
>>> time by pressing the space bar four times i
Am 15.06.2017 um 07:09 schrieb Jussi Piitulainen:
> Andre Müller writes:
>
>> I'm a fan of infinite sequences. Try out itertools.islice.
>> You should not underestimate this very important module.
>>
>> Please read also the documentation:
>> https://docs.python.org/3.6/library/itertools.html
>>
>>
Andre Müller wrote:
> # to impress your friends you can do
> for chunk in itertools.zip_longest(*[iter(s)]*4):
> chunked_str = ''.join(c for c in chunk if c) # generator expression
> inside join with condition
> print(chunked_str)
This can be simplified with a fillvalue
>>> s = "abracad
EuroPython 2017 is happy to host and sponsor a Django Girls free
workshop on Sunday 9th, from 9:00 to 18:00 CEST.
The non-profit organization FuzzyBrains will lead you through
HTML/CSS, Python/Django to the design of a new blog in a single day
workshop. No prior programming knowledge is needed to
Dear folks, I need some help with:
I am working with some Hospital data, and I need to calculate Operating Room
Utilization per day
df.groupby(by = ['Actual_Surgery_Day','Actual_Surgery_Room'])
.agg({'Actual_Surgery_Duratation' : 'sum', 'Procedure_Code' : 'count'})
On 2017-06-16 15:53, Ben Finney wrote:
> > I must admit my initial preference would be the differently named
> > wrapper. Surely users of the codebase will be invoking stuff via
> > something opaque which sources the requisite things?
>
> That “something opaque” is the ‘$VENV/bin/activate’ scrip
On 2017-06-16, Ben Finney wrote:
> alister writes:
>
>> Json is designed to be legal Javascript code & therefore directly
>> executable so no parser is posible.
>
> JSON is designed to be *a strictly limited subset* of legal JavaScript
> that only defines data structures. The explicit goal is tha
Grant Edwards writes:
> On 2017-06-16, Ben Finney wrote:
> > JSON is designed to be *a strictly limited subset* of legal
> > JavaScript that only defines data structures. The explicit goal is
> > that it is statically parseable as non-executable data.
>
> That doesn't mean that it's reasonable/a
> I still think it _could_ be the output of a Python repr() or similar
> (something that is expected to be evaluated as a Python expression).
It may be valid fodder for python eval(), but if it came from repr() It
would have used single quotes, yes?
--
https://mail.python.org/mailman/listinfo/
https://thenewstack.io/instagram-makes-smooth-move-python-3/
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list
Very Nice.
Em sex, 16 de jun de 2017 às 13:30, Terry Reedy escreveu:
> https://thenewstack.io/instagram-makes-smooth-move-python-3/
> --
> Terry Jan Reedy
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
The process they followed is discussed in their recent Keynote at PyCon
2017: https://youtu.be/66XoCk79kjM
Well worth the 40 minutes it takes to watch :-)
Paul.
On 16 June 2017 at 18:43, Rauklei P. S. Guimarães wrote:
> Very Nice.
>
> Em sex, 16 de jun de 2017 às 13:30, Terry Reedy
> escreve
On 15/06/17 14:45, Larry Martell wrote:
> I am trying to use sqlite
>
> $ python2.7
> Python 2.7.10 (default, Feb 22 2016, 12:13:36)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
import _sqlite3
> Traceback (most r
I have create a python script where use post gis queries to automate some
intersection tasks using postgis database.
in my database I have polygons,points and lines.
here my snippet code of my script :
try:
if str(geomtype) == 'point':
geomtype = 1
elif str(geomtype
On 16/06/17 12:03, alister wrote:
(The non native English speaker excuse is not an option for me)
Does that mean it's mandatory for you? I'm confused :D :D
E.
--
https://mail.python.org/mailman/listinfo/python-list
On 16Jun2017 06:40, Tim Chase wrote:
At least within virtualenvwrapper (I'm not sure whether they come
with virtualenv proper), in my $WORKON_HOME and
$WORKON_HOME/$VIRTUALENV/bin directories, I have a bunch of pre* and
post* templates including preactivate and postactivate hooks in which
I can
I assigned the optimal time of 960min to x.
>>> x=960.0
Then I assigned the time used 189min to y.
>>> y=189.0
Then I divide the time used(y) by the optimal time(x) and multiply the answer
by 100 and assign the answer to z.
>>> z=(y/x)*100
The answer.
>>> z
19.6875
For Python to give you an ac
22 matches
Mail list logo