I have just committed a new main.py file on github. I added alot more comments
and slimmed down the getinfo() function.
--
https://mail.python.org/mailman/listinfo/python-list
#torrent.py
-
import re
import urllib.request
import urllib.parse
urltemp = 'https://btdigg.org/search?info_hash=&q='
urlinput = urllib.parse.quote(input('Please input keywords:'))
url = urltemp + urlinput
print('Searching'+'\n'+url)
cont
On Sun, Sep 21, 2014 at 11:33 AM, Nicholas Cannon
wrote:
> Yeah this is exactly what I was looking for I know the comments are horrible
> and I had no idea about the camelCase stuff. Should I use
> '''
> Use this commenting on my functions or not. I think they are called
> docStrings or somethin
On Saturday, September 20, 2014 9:17:27 PM UTC+8, Nicholas Cannon wrote:
> I have created my first python program and I have learnt a lot about python
> from this group and wanted some feedback. I am still improving it and trying
> to tackle some performance and GUI stuff so keep that in mind. I
On Wednesday, May 6, 2009 11:38:16 AM UTC+3, CkurtM wrote:
> I have a problem with recieving requests on j2me based bluetooth
> server using RFCOMM. I can send messages from the j2me client to
> python server, but cant receive from the python bluetooth client to
> j2me server, it only connects but
Juan Christian wrote:
> I have the following structure:
>
> Third-party API installed via pip:
> steamapi /
> app.py
> consts.py
> core.py
> users.py
> [...]
>
> My script:
> test.py
>
>
> In the API, the module users.py has a class 'SteamUser' and I want to
> mimic it's usage on my code, like
On 20/09/2014 15:58, Chris Angelico wrote:
On Sat, Sep 20, 2014 at 11:16 PM, Nicholas Cannon
wrote:
You may
also notice that the camelCase variable names you're using are in
stark contrast to the rest of the language. It's normal to use
lower_case_with_underscores instead.
That may be the PEP
On Sat, Sep 20, 2014 at 11:16 PM, Nicholas Cannon
wrote:
> I have created my first python program and I have learnt a lot about python
> from this group and wanted some feedback. I am still improving it and trying
> to tackle some performance and GUI stuff so keep that in mind. I don't think
>
Juan Christian wrote:
[...]
> In the API, the module users.py has a class 'SteamUser' and I want to
> mimic it's usage on my code, like this:
>
> import steamapi
>
> [...]
>
> class User(Inheritance from API):
What do you mean, "Inheritance from API"? You can't inherit from an API,
only from c
I have the following structure:
Third-party API installed via pip:
steamapi /
app.py
consts.py
core.py
users.py
[...]
My script:
test.py
In the API, the module users.py has a class 'SteamUser' and I want to mimic
it's usage on my code, like this:
import steamapi
[...]
class User(Inheritance
I have created my first python program and I have learnt a lot about python
from this group and wanted some feedback. I am still improving it and trying to
tackle some performance and GUI stuff so keep that in mind. I don't think it is
the best program but is a good product of 3 months of python
Nagy László Zsolt wrote:
>
>>> bytes/str.ljust()
>>>
>> def pad(b, n=16, c=b"\x0f"):
>>> ... length = (len(b)+n-1)//n*n
>>> ... return b.ljust(length, c)
>> Thanks!
> One more question. How do I create a single char binary string from a
> number? E.g.
>
> >>> bytes([65])
> b'A'
>
>
bytes/str.ljust()
def pad(b, n=16, c=b"\x0f"):
... length = (len(b)+n-1)//n*n
... return b.ljust(length, c)
Thanks!
One more question. How do I create a single char binary string from a
number? E.g.
>>> bytes([65])
b'A'
It seems to be wrong again. The bytes constructor requires a
Nagy László Zsolt wrote:
> I can figure out way for example this:
>
> >>> b'T'+bytearray([32])
>
> but it just don't seem right to create a list, then convert it to a byte
> array and then convert it to a binary string. What am I missing?
By the way, you can repeat bytes (and strings) by multip
bytes/str.ljust()
def pad(b, n=16, c=b"\x0f"):
... length = (len(b)+n-1)//n*n
... return b.ljust(length, c)
Thanks!
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
--
https://mail.python.org/mailman/listinfo/python-li
Nagy László Zsolt wrote:
> >>> BS = 16
> >>> pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
> >>> pad('L')
> 'L\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f'
> >>> pad(b'L')
> Traceback (most recent call last):
>File "", line 1, in
>File "", line 1, in
Nagy László Zsolt wrote:
> >>> BS = 16
> >>> pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
> >>> pad('L')
> 'L\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f'
> >>> pad(b'L')
> Traceback (most recent call last):
>File "", line 1, in
>File "", line 1, in
>>> BS = 16
>>> pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
>>> pad('L')
'L\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f'
>>> pad(b'L')
Traceback (most recent call last):
File "", line 1, in
File "", line 1, in
TypeError: can't concat bytes to str
How do I
18 matches
Mail list logo