Re: Anybody familiar with pygments ?

2013-05-10 Thread ChrisKwpolskaWarrick
On Thu, May 9, 2013 at 10:40 AM, Fábio Santos  wrote:
>
> On 9 May 2013 05:19, "dabaichi"  wrote:
>>
>> And hereis the output file:
>
> That's not the output file. That is just an HTML fragment to put on your
> page. A full HTML file will need more things, which is the reason why you
> don't see color output.
>
>> I want to know why output html file with no color ?
>
> Because there is no CSS. The output  has a lot of  tags with classes.
> You are supposed to use a CSS file along with it.
>
> So, first put that output into a complete HTML document (with a head, a
> body...) And in that document add or link to your CSS file with the color
> information. I never used pygments but there may be some readily available.
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

First off, the Python code was unnecessary in this case, because it
would be cheaper to use the pygmentize app included.

Second off, CSS is available at
https://github.com/richleland/pygments-css or by running `pygmentize
-f html -O full FILE`.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: in need of some help...

2013-05-12 Thread ChrisKwpolskaWarrick
(slightly offtopic, sorry.)

On Sun, May 12, 2013 at 12:20 AM, Jens Thoms Toerring  wrote:
> PS: If I may ask you a favor: consider refraining from using Google's
> completely broken interface to newsgroups - your post consists
> of nearly 200 lines of text containing all I wrote, with an empty
> line inserted between each of them, and a single line of text
> you wrote. It's rather annoying to have to sieve through that
> much of unrelated stuff just to find thar one line that's re-
> levant.

Gmail automatically hides long quotes.  This is helpful in situations
like this one.  More mail software should implement that
functionality.  Seriously: once you go Gmail, you never go back.

> And this Google groups crap seems to make it nearly
> impossible to do it any other way. If you don't believe me see
> e.g.
>
>   http://wiki.python.org/moin/GoogleGroupsPython
>
> There are much better alternatives to "Google groups",
> using a real usenet news server and a program that does
> not mess up content of news group postings. They've been
> developed with 30 years of experience with newsgroups.

Or something even better: a mailing list.
http://mail.python.org/mailman/listinfo/python-list is where you can
find it.  Much friendlier than Usenet, and the software itself is
developed by the FLUFL.

> If I'd be conspiracy theorist I would conclude that Google
> is up to something bad in trying to make using newsgroups
> nearly impossible by their badly broken stuff (and, to add
> credibility to such a claim, their complete disregard for
> all the criticism they got over the years, actually making
> each version of Google groups even worse), but it's rather
> likely just another case of pure incompetence (or a "why
> should we care" attitude:-(

They shouldn’t care because Usenet users often yell “Get off my
lawn!”.  Young people don’t use newsgroups.  They don’t even know what
Usenet is.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ssl proxy server

2013-05-14 Thread ChrisKwpolskaWarrick
On Tue, May 14, 2013 at 2:34 PM, 23alagmy  wrote:
> ssl proxy server
>
> hxxp://natigtas7ab.blogspot.com/2013/05/ssl-proxy-server.html
> --
> http://mail.python.org/mailman/listinfo/python-list

I have been seeing those mails for a long time.  Why didn’t anybody
ban that guy?  If it comes from Usenet (and headers say it does), and
you can’t destroy stuff easily there, maybe just put a ban on the
Mailman side of things, making the world much better for at least some
people?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ssl proxy server

2013-05-15 Thread ChrisKwpolskaWarrick
On Tue, May 14, 2013 at 9:14 PM, Skip Montanaro  wrote:
> I haven't touched the SpamBayes setup for the usenet-to-mail gateway
> in a long while.  For whatever reason, this message was either held
> and then approved by the current list moderator(s), or (more likely)
> slipped through unscathed.  No filter is perfect.
>
> Skip

A filter on this guy altogether would be.  He sent 24 messages there
since February 25.  All of them spam.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 378: Format Specifier for Thousands Separator

2013-05-21 Thread ChrisKwpolskaWarrick
On Tue, May 21, 2013 at 8:49 PM, Carlos Nepomuceno
 wrote:
> Thank you, but let me rephrase it. I'm already using str.format() but I'd 
> like to use '%' (BINARY_MODULO) operator instead.

There is no real reason to do this.  `str.format()` is the new shiny
thing you should be using all the time.  Also, '%' is BINARY_MODULO
(where did you even get that name from?) if and only if you have two
numbers, and it performs the modulo division (eg. 27 % 5 = 2)

> So, the question is: Where would I change the CPython 2.7.5 source code to 
> enable '%' (BINARY_MODULO) to format using the thousands separator like 
> str.format() does, such as:
>
sys.stderr.write('%,d\n' % 1234567)
> 1,234,567

This will make your code unportable and useless, depending on one
patch you made.  Please don’t do that.  Instead,

> >>> sys.stdout.write('Number = %s\n' % '{:,.0f}'.format(x))
> Number = 12,345
>
> 'x' is unsigned integer so it's like using a sledgehammer to crack a nut!

In Python?  Tough luck, every int is signed.  And it isn’t just a
sledgehammer, it’s something worse.  Just do that:

>>> sys.stdout.write('Number = {:,.0f}\n'.format(x))

Much more peaceful.

You can also do a print, like everyone sane would.  Where did you
learn Python from?  “Python Worst Practice for Dummies”?

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems with python and pyQT

2013-05-27 Thread ChrisKwpolskaWarrick
On Mon, May 27, 2013 at 11:26 AM,   wrote:
> Hi,
> i'm new with python: so excuse me for my questions
> i have this code:
>
> def updateLog(self, text):
> self.ui.logTextEdit.moveCursor(QTextCursor.End)
> self.ui.logTextEdit.insertHtml(""+text)
> self.ui.logTextEdit.moveCursor(QTextCursor.End)
>
> logTextEdit is a QTextEdit object.With this code,i can display only ascii 
> characters: how can i diplay text as hex and binary values?
> Thanks
> --
> http://mail.python.org/mailman/listinfo/python-list

You would need to convert them to strings first.  You may want bin()
and hex() for that.  And if you want to convert 'q' to 0x71,
hex(ord("q")).  And if you want to turn 'hello' into 0x68656c6c6f, you
would need to iterate over 'hello' and run the above function over
every letter.

Also, you are able to display Unicode characters, too.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Apache and suexec issue that wont let me run my python script

2013-06-04 Thread ChrisKwpolskaWarrick
On Tue, Jun 4, 2013 at 4:49 PM, Mark Lawrence  wrote:
> I don't know much about the Python suexec module, can you please explain
> where it's documented.  Or is suexec nothing to do with Python?

From Wikipedia:
> Apache suEXEC is a feature of the Apache Web server. It allows users to run 
> CGI and SSI applications as a different user - normally, all web server 
> processes run as the default web server user (often wwwrun, Apache or nobody).

In other words: Nikolaos is trying to do something HORRIBLY WRONG
(just like always).  The proper way would be to run the python scripts
through WSGI as the standard nobody user.  Or do proper file
permissions.  And WSGI should be used through something intelligent
(flask/pyramid/…)

--- OT START ---
On Tue, Jun 4, 2013 at 4:33 PM, Chris Angelico  wrote:
> You should try power surging your drivers. Have you got a spare power cord?
>
> ChrisA
>
> [1] http://www.oocities.org/timessquare/4753/bofh.htm
> --
> http://mail.python.org/mailman/listinfo/python-list

Please link and read at the BOFH’s page.  [0] is the page and [1] is
this exact story.

[0]: http://bofh.ntk.net/BOFH/index.php
[1]: http://bofh.ntk.net/BOFH//bastard07.php

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread ChrisKwpolskaWarrick
On Tue, Jun 4, 2013 at 7:23 PM, Νικόλαος Κούρας  wrote:
> What on eart is this damn error: Michael tried to explain to me about 
> surrogates but dont think i understand it.
>
> Encoding giving me trouble years now.
>
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Original exception 
> was:
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] Traceback (most 
> recent call last):
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59]   File "files.py", 
> line 72, in 
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] 
> cur.execute('''SELECT url FROM files WHERE url = %s''', (fullpath,) )
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59]   File 
> "/usr/local/lib/python3.3/site-packages/PyMySQL3-0.5-py3.3.egg/pymysql/cursors.py",
>  line 108, in execute
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] query = 
> query.encode(charset)
> [Tue Jun 04 20:19:53 2013] [error] [client 46.12.95.59] UnicodeEncodeError: 
> 'utf-8' codec can't encode character '\\udcd3' in position 61: surrogates not 
> allowed
>
>
>
> PLEASE TELL EM WHAT TO TRY, PLEASE FOR THE LOVE OF GOD, IAM SO FRUSTRATED NOT 
> BEING ABLE TO DEAL WITH THIS.
> --
> http://mail.python.org/mailman/listinfo/python-list

1. Try re-naming the files to real utf-8.  Make sure your terminal
works on UTF-8 characters.
2. Get rid of your bullshit system and use Flask or Pyramid.  It will
make your life much easier.
3. Put the files in a directory on your server and tell Apache to
create an index, making your life easier, but not as easy as it would
if you did (2) and anywhere near as easy as (2) and (3) combined.
--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-04 Thread ChrisKwpolskaWarrick
On Tue, Jun 4, 2013 at 8:27 PM, Νικόλαος Κούρας  wrote:
> 2. No idea wht is flask or pyramid or wsgi

http://lmgtfy.com/?q=flask+python
http://lmgtfy.com/?q=pyramid+python
http://lmgtfy.com/?q=wsgi+python

> 3. Files are located in '/home/nikos/www/data/apps' and they appear in 
> browser direcory listing. Create an index.html you mean?

If they do, they are already indexed.  Now link stuff to that
directory instead of your fancy files.py thing.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A few questiosn about encoding

2013-06-09 Thread ChrisKwpolskaWarrick
On Sun, Jun 9, 2013 at 12:44 PM, Νικόλαος Κούρας  wrote:
> A few questiosn about encoding please:
>
>>> Since 1 byte can hold up to 256 chars, why not utf-8 use 1-byte for
>>> values up to 256?
>
>>Because then how do you tell when you need one byte, and when you need
>>two? If you read two bytes, and see 0x4C 0xFA, does that mean two
>>characters, with ordinal values 0x4C and 0xFA, or one character with
>>ordinal value 0x4CFA?
>
> I mean utf-8 could use 1 byte for storing the 1st 256 characters. I meant up 
> to 256, not above 256.

It is required so the computer can know where characters begin.
0x0080 (first non-ASCII character) becomes 0xC280 in UTF-8.  Further
details here: http://en.wikipedia.org/wiki/UTF-8#Description

>>> UTF-8 and UTF-16 and UTF-32
>>> I though the number beside of UTF- was to declare how many bits the
>>> character set was using to store a character into the hdd, no?
>
>>Not exactly, but close. UTF-32 is completely 32-bit (4 byte) values.
>>UTF-16 mostly uses 16-bit values, but sometimes it combines two 16-bit
>>values to make a surrogate pair.
>
> A surrogate pair is like itting for example Ctrl-A, which means is a 
> combination character that consists of 2 different characters?
> Is this what a surrogate is? a pari of 2 chars?

http://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B1_to_U.2B10

Long story short: codepoint - 0x1 (up to 20 bits) → two 10-bit
numbers → 0xD800 + first_half 0xDC00 + second_half.  Rephrasing:

We take MATHEMATICAL BOLD CAPITAL B (U+1D401).  If you have UTF-8: 𝐁

It is over 0x, and we need to use surrogate pairs.  We end up with
0xD401, or 0b11010101.  Both representations are worthless, as
we have a 16-bit number, not a 20-bit one.  We throw in some leading
zeroes and end up with 0b11010101.  Split it in half and
we get 0b110101 and 0b01, which we can now shorten to
0b110101 and 0b1, or translate to hex as 0x0035 and 0x0001.  0xD800 +
0x0035 and 0xDC00 + 0x0035 → 0xD835 0xDC00.  Type it into python and:

>>> b'\xD8\x35\xDC\x01'.decode('utf-16be')
'𝐁'

And before you ask: that “BE” stands for Big-Endian.  Little-Endian
would mean reversing the bytes in a codepoint, which would make it
'\x35\xD8\x01\xDC' (the name is based on the first 256 characters,
which are 0x6500 for 'a' in a little-endian encoding.

Another question you may ask: 0xD800…0xDFFF are reserved in Unicode
for the purposes of UTF-16, so there is no conflicts.

>>UTF-8 uses 8-bit values, but sometimes
>>it combines two, three or four of them to represent a single code-point.
>
> 'a' to be utf8 encoded needs 1 byte to be stored ? (since ordinal = 65)
> 'α΄' to be utf8 encoded needs 2 bytes to be stored ? (since ordinal is > 127 )

yup.  α is at 0x03B1, or 945 decimal.

> 'a chinese ideogramm' to be utf8 encoded needs 4 byte to be stored ? (since 
> ordinal >  65000 )

Not necessarily, as CJK characters start at U+2E80, which is in the
3-byte range (0x0800 through 0x) — the table is here:
http://en.wikipedia.org/wiki/UTF-8#Description

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Don't feed the troll...

2013-06-15 Thread ChrisKwpolskaWarrick
On Sat, Jun 15, 2013 at 5:40 PM, Steven D'Aprano
 wrote:
> On Sat, 15 Jun 2013 07:58:27 -0400, D'Arcy J.M. Cain wrote:
>
>> I suggested including the poster that you are replying to.
>
> In the name of all that's good and decent in the world, why on earth
> would you do that when replying to a mailing list??? They're already
> getting a reply. Sending them TWO identical replies is just rude.

Mailman is intelligent enough not to send a second copy in that case.
This message was sent with a CC, and you got only one copy.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread ChrisKwpolskaWarrick
On Fri, Jun 14, 2013 at 5:25 AM, alex23  wrote:
> On Jun 14, 2:24 am, Νικόλαος Κούρας  wrote:
>> iam researchign a solution to this as we speak.
>
> Spamming endless "ZOMG HELP ME I'M INCOMPETENT" posts isn't "research".
> --
> http://mail.python.org/mailman/listinfo/python-list

BTW: Do we have a Greek around that is not Nikos, who is willing to
report him to the Police for publishing personal data of his clients?
http://superhost.gr/?page=pelatologio.py has PHONE NUMBERS of people
according to Google Translate.  And that doesn’t seem to be legal.  I
have already thrown an e-mail address to the domain registrar.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Don't feed the troll...

2013-06-15 Thread ChrisKwpolskaWarrick
On Sat, Jun 15, 2013 at 7:07 PM, D'Arcy J.M. Cain  wrote:
> On Sat, 15 Jun 2013 18:41:41 +0200
> Chris “Kwpolska” Warrick  wrote:
>> On Sat, Jun 15, 2013 at 5:40 PM, Steven D'Aprano
>>  wrote:
>> > In the name of all that's good and decent in the world, why on earth
>> > would you do that when replying to a mailing list??? They're already
>> > getting a reply. Sending them TWO identical replies is just rude.
>>
>> Mailman is intelligent enough not to send a second copy in that case.
>> This message was sent with a CC, and you got only one copy.
>
> Actually, no.  Mailman is not your MTA.  It only gets the email sent to
> the mailing list.  Your MTA sends the other one directly so Steve is
> correct.  He gets two copies.  If his client doesn't suppress the
> duplicate then he will be presented with both.

The source code seems to think otherwise:

http://bazaar.launchpad.net/~mailman-coders/mailman/3.0/view/head:/src/mailman/handlers/avoid_duplicates.py

On Sat, Jun 15, 2013 at 7:12 PM, Steven D'Aprano
 wrote:
> Wrong. I got two copies. One via comp.lang.python, and one direct to me.

You are subscribed through Usenet and not
<http://mail.python.org/mailman/listinfo/python-list>, in which case
the above doesn’t apply, because Mailman throws the mail to Usenet and
not you personally.

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread ChrisKwpolskaWarrick
On Sat, Jun 15, 2013 at 7:29 PM, Nick the Gr33k  wrote:
> On 15/6/2013 8:11 μμ, Chris “Kwpolska” Warrick wrote:
>>
>> On Fri, Jun 14, 2013 at 5:25 AM, alex23  wrote:
>>>
>>> On Jun 14, 2:24 am, Νικόλαος Κούρας  wrote:
>>>>
>>>> iam researchign a solution to this as we speak.
>>>
>>>
>>> Spamming endless "ZOMG HELP ME I'M INCOMPETENT" posts isn't "research".
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>>
>> BTW: Do we have a Greek around that is not Nikos, who is willing to
>> report him to the Police for publishing personal data of his clients?
>> http://superhost.gr/?page=pelatologio.py has PHONE NUMBERS of people
>> according to Google Translate.  And that doesn’t seem to be legal.  I
>> have already thrown an e-mail address to the domain registrar.
>>
>> --
>> Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
>> stop html mail| always bottom-post
>> http://asciiribbon.org| http://caliburn.nl/topposting.html
>>
>
> How much of a bastard can you be?
>
> --
> What is now proved was at first only imagined!
> --
> http://mail.python.org/mailman/listinfo/python-list

Does saving that page count?

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: RFD: rename comp.lang.python to comp.support.superhost

2013-06-15 Thread ChrisKwpolskaWarrick
On Sat, Jun 15, 2013 at 7:52 PM, Alister  wrote:
> On Sat, 15 Jun 2013 20:29:09 +0300, Nick the Gr33k wrote:
>
>> On 15/6/2013 8:11 μμ, Chris “Kwpolska” Warrick wrote:
>>> On Fri, Jun 14, 2013 at 5:25 AM, alex23  wrote:
>>>> On Jun 14, 2:24 am, Νικόλαος Κούρας  wrote:
>>>>> iam researchign a solution to this as we speak.
>>>>
>>>> Spamming endless "ZOMG HELP ME I'M INCOMPETENT" posts isn't
>>>> "research".
>>>> --
>>>> http://mail.python.org/mailman/listinfo/python-list
>>>
>>> BTW: Do we have a Greek around that is not Nikos, who is willing to
>>> report him to the Police for publishing personal data of his clients?
>>> http://superhost.gr/?page=pelatologio.py has PHONE NUMBERS of people
>>> according to Google Translate.  And that doesn’t seem to be legal.  I
>>> have already thrown an e-mail address to the domain registrar.
>>>
>>> --
>>> Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16 stop html mail
>>> | always bottom-post http://asciiribbon.org|
>>> http://caliburn.nl/topposting.html
>>>
>>>
>> How much of a bastard can you be?
>
> Were that my data I would be calling him a hero.
>
> please learn how to secure data before allowing your sites to escape onto
> the internet

Actually, Nikolaos should be happy I didn’t bother to learn Greek and
pony up €6 to actually call those seventeen numbers, as roaming is
friggin’ expensive, and that’s assuming that a minute would be enough
to tell those people what is going on, and not forgetting that I live
in a country where the minimum wage is less than €400, and that the
number includes taxes and such.

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-16 Thread ChrisKwpolskaWarrick
On Sun, Jun 16, 2013 at 12:33 PM, Steven D'Aprano
 wrote:
>
> On Sun, 16 Jun 2013 11:28:00 +0300, Nick the Gr33k wrote:
>
> > On 16/6/2013 8:06 πμ, Steven D'Aprano wrote:
> >> Nikos,
> >>
> >> Have you considered subscribing to this?
> >>
> >> http://mail.python.org/mailman/listinfo/python-greece
>
> [...]
> > I prefer staying here but i can also subscribe there as well if you teel
> > me what the groups name.
>
> Nikos, this is exactly the sort of thing that makes it painful to try to
> help you. I've given you the URL. The name of the list is in the URL, and
> even if it isn't, you can just click on it and see for yourself.
>
> Let me repeat the URL in case you cannot see it above:
>
> http://mail.python.org/mailman/listinfo/python-greece

Nikos wants Usenet:

> Thank you Steven i don't want to enter there as mail but wish to find it as a 
> newsgroups, which i tried to subscribe but TB couldn't find it.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Greek mailing list [was Re: Why 'files.py' does not print the filenames into a table format?]

2013-06-16 Thread ChrisKwpolskaWarrick
On Sun, Jun 16, 2013 at 1:09 PM, Mark Lawrence  wrote:
> On 16/06/2013 11:57, Ferrous Cranus wrote:
>>
>> i did Steven that why i asked in the 1st place
>>
>> To post a message to all the list members, send email to
>> python-gre...@python.org.
>>
>> this is not a valid nrewgroup name/
>>
>
> Not valid in the same way that supp...@superhost.gr is not valid?

http://en.wikipedia.org/wiki/Usenet#Organization

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Version Control Software

2013-06-16 Thread ChrisKwpolskaWarrick
On Sun, Jun 16, 2013 at 1:14 AM, Chris Angelico  wrote:
> Hmm. ~/cpython/.hg is 200MB+, but ~/pike/.git is only 86MB. Does
> Mercurial compress its content? A tar.gz of each comes down, but only
> to ~170MB and ~75MB respectively, so I'm guessing the bulk of it is
> already compressed. But 200MB for cpython seems like a lot.

Next time, do a more fair comparison.

I created an empty git and hg repository, and created a file promptly
named “file” with DIGIT ONE (0x31; UTF-8/ASCII–encoded) and commited
it with “c1” as the message, then I turned it into “12” and commited
as “c2” and did this one more time, making the file “123” at commit
named “c3”.

[kwpolska@kwpolska-lin .hg@default]% cat * */* */*/* 2>/dev/null | wc -c
1481
[kwpolska@kwpolska-lin .git@master]% cat * */* */*/* */*/*/* 2>/dev/null | wc -c
16860 ← WRONG!

There is just one problem with this: an empty git repository starts at
15216 bytes, due to some sample hooks.  Let’s remove them and try
again:

[kwpolska@kwpolska-lin .git@master]% rm hooks/*
[kwpolska@kwpolska-lin .git@master]% cat * */* */*/* */*/*/* */*/*/*
2>/dev/null | wc -c
2499

which is a much more sane number.  This includes a config file (in the
ini/configparser format) and such.  According to my maths skils (or
rather zsh’s skills), new commits are responsible for 1644 bytes in
the git repo and 1391 bytes in the hg repo.

(I’m using wc -c to count the bytes in all files there are.  du is
unaccurate with files smaller than 4096 bytes.)

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A few questiosn about encoding

2013-06-16 Thread ChrisKwpolskaWarrick
On Sat, Jun 15, 2013 at 10:35 PM, Benjamin Schollnick
 wrote:
> Nick,
>
> The only thing that i didn't understood is this line.
> First please tell me what is a byte value
>
> \x1b is a sequence you find inside strings (and "byte" strings, the
> b'...' format).
>
>
> \x1b is a character(ESC) represented in hex format
>
> b'\x1b' is a byte object that represents what?
>
>
 chr(27).encode('utf-8')
> b'\x1b'
>
 b'\x1b'.decode('utf-8')
> '\x1b'
>
> After decoding it gives the char ESC in hex format
> Shouldn't it result in value 27 which is the ordinal of ESC ?
>
>
> I'm sorry are you not listening?
>
> 1b is a HEXADECIMAL Number.  As a so-called programmer, did you seriously
> not consider that?
>
> Try this:
>
> 1) Open a Web browser
> 2) Go to Google.com
> 3) Type in "Hex 1B"
> 4) Click on the first link
> 5) In the Hexadecimal column find 1B.
>
> Or open your favorite calculator, and convert Hexadecimal 1B to Decimal
> (Base 10).
>
> - Benjamin
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Better: a programmer should know how to convert hexadecimal to decimal.

0x1B = (0x1 * 16^1) + (0xB * 16^0) = (1 * 16) + (11 * 1) = 16 + 11 = 27

It’s that easy, and a programmer should be able to do that in their
brain, at least with small numbers.  Or at least know that:
http://lmgtfy.com/?q=0x1B+in+decimal

Or at least `hex(27)`; or '`{:X}'.format(27)`; or `'%X' % 27`.  (I
despise hex numbers with lowercase letters, but that’s my personal
opinion.)

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Loop Question

2013-06-24 Thread ChrisKwpolskaWarrick
On Mon, Jun 24, 2013 at 8:42 PM, John Gordon  wrote:
> In  
> christheco...@gmail.com writes:
>
>> On Sunday, June 23, 2013 6:18:35 PM UTC-5, christ...@gmail.com wrote:
>> > How do I bring users back to beginning of user/password question once they
>> >
>> > fail it? thx
>
>> Can't seem to get this to cooperate...where does the while statement belong?
>
> while True:
> username = raw_input("Please enter your username: ")
> password = raw_input("Please enter your password: ")
>
> if username == "john doe" and password == "fopwpo":
> print "Login Successful"
> break
>
> else:
> print "Please try again"

You didn’t test the code, did you?  Because the code you posted is
right.  Remember to always test code before submitting.  And note that
the getpass module is what you should use for that second thing in
real life, for the security of your users.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unable to import NHunspell.dll using ctypes in Python

2013-06-25 Thread ChrisKwpolskaWarrick
On Tue, Jun 25, 2013 at 9:45 AM, Dave Angel  wrote:
> You're on Linux or similar, and dll's are the way a Windows executable is
> named.

dll’s are libraries for windows, not executables (/lib not /bin)

> Try going back to where you downloaded this file, and see if you can get the
> one for your OS.

That is not necessary.  Because it is a sane OS, it is likely that
hunspell is packaged in the repositories of OP’s system, and might be
even installed there.  And if the package is installed, hunspell
should reside in /usr/lib/libhunspell.so or a similar place.
--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unable to import NHunspell.dll using ctypes in Python

2013-06-25 Thread ChrisKwpolskaWarrick
On Tue, Jun 25, 2013 at 10:04 AM,   wrote:
> @Chris
> I understand that. But then I am supposed to create something that works on a 
> Windows environment using a Windows Dll.Aaandd Im stuck.
> --
> http://mail.python.org/mailman/listinfo/python-list

Then you need to get your hands on a copy of Windows.  Or try messing
with Wine (you would need to install the Python interpreter for
Windows there), but that might not work properly.

And ctypes is used to use functions provided by C libraries on your
system, that is .dll files on Windows and .so files (shared object
files) everywhere else.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OSError [Errno 26] ?!?!

2013-07-02 Thread ChrisKwpolskaWarrick
On Tue, Jul 2, 2013 at 11:40 AM, Νίκος  wrote:
> Στις 2/7/2013 10:21 πμ, ο/η Cameron Simpson έγραψε:
>>
>> On 02Jul2013 08:57, Νίκος  wrote:
>> | Thank you, the error have been caused due to the fact that the
>> | uploading procedure of my edited 'pelatologio.py' hadn't been
>> | completed yet, while i was requesting the execution of the script
>> | via browser.
>> |
>> | I didn't had to do anything it solved by itself, after upload was
>> | successful and file got  unlocked for access.
>>
>> If you're uploading using sftp (or, worse, ftp), might I suggest
>> using rsync instead? Amongst other features, it uploads to a temporary
>> file and then renames the temporary file to the real file. There is
>> no window where the "live" file is being written to. The live file
>> is the old one, and then later it is the new one.
>
>
>
> Actually i'm uploading via Notepad++'s NPPFtp plugin, which i'm afraid is
> pure ftp and not even sftp.

The only thing SFTP and FTP have in common is that they are Internet
protocols.  Inside, they are much, much different.  And you should
NEVER use FTP.  (also, why Notepad++?  I’d suggest getting a better
editor first.)

> If i try to upload via FileZilla instead(which i can use as sftp on port
> 22), then it messes the cgi scripts encoding by uploading it as iso-8859-7
> which then i need to ssh to the remote host and change it back to utf-8.

You need to reconfigure FileZilla then.  Site Manager (first icon on
the toolbar) → your site → Charset → Force UTF-8.

> Also sometimes it takes a lot of time even with Notepad++ to even upload a
> 50 KB script.
>
> Please tell me how to use the rsync method especially it would be best if i
> cna use it via text editor, Notepad++ or even better with Sublime Text.

Under Windows?  I suggest installing Cygwin or switching over to
Linux, for your sanity.  If you don’t want either, look for a Windows
port of rsync.  The next step is to read the included man page.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OSError [Errno 26] ?!?!

2013-07-02 Thread ChrisKwpolskaWarrick
On Tue, Jul 2, 2013 at 2:39 PM, Νίκος  wrote:
> How and from where should i use rsync?

From your computer, in the command line.

> I currently ditched FileZilla and start using CrossFTP Pro.
> I searched inside it but i have seen  no rsync command/method just
> "Synchronized Browsing"

Look for a rsync client, not a FTP/SFTP client.

> Is rsync a command on the remote server or can be found as a standalone tool
> too?

Both.

> Please suggest an editor that has built in rsync ability so to immediately
> upload my cgi-scripts when i hit save in the text editor.

CGI?  Is this 2000?  Nobody uses that wording these days.

I’ve yet to see a Windowsy editor with rsync support.  But you should
choose the editor that works the best for you, not the editor which
has rsync support.

> How do you guys upload your files/scripts to remote hosts ?

I, for one, use sftp or edit directly on the server with vim, my
editor of choice.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: hex dump w/ or w/out utf-8 chars

2013-07-09 Thread ChrisKwpolskaWarrick
On Tue, Jul 9, 2013 at 11:34 AM,   wrote:
> Note the difference between SS and ẞ
> 'FRANZ-JOSEF-STRAUSS-STRAẞE'

This is a capital Eszett.  Which just happens not to exist in German.
Germans do not use this character, it is not available on German
keyboards, and the German spelling rules have you replace ß with SS.
And, surprise surprise, STRASSE is the example the Council for German
Orthography used ([0] page 29, §25 E3).

[0]: http://www.neue-rechtschreibung.de/regelwerk.pdf

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I get the OS System Font Directory(Cross-Platform) in python?

2013-07-11 Thread ChrisKwpolskaWarrick
On Thu, Jul 11, 2013 at 5:32 PM, Metallicow  wrote:
> How do I get the OS System Font Directory(Cross-Platform) in python?
>
> Need a simple script for
> Windows, Linux, Mac, etc..
>
> Or using wxPython.
>
> I can't seem to find anything that works, and I don't want to hard-code paths.
> --
> http://mail.python.org/mailman/listinfo/python-list

Why do you want the paths to the fonts?  You do not need them 99.9% of
the time.  So, what *exactly* are you trying to accomplish?
--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How do I get the OS System Font Directory(Cross-Platform) in python?

2013-07-11 Thread ChrisKwpolskaWarrick
On Thu, Jul 11, 2013 at 08:54:17AM -0700, Metallicow wrote:
> For a portable font install tool.
> 
> Finding if a particular font exists,
> useful when testing apps in virtual environent,
> rendering text from a font,
> Font file manipulations,
> etc..
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Then do a nice little `if` checking the user’s OS.

http://docs.python.org/2/library/sys.html#sys.platform hints what to use,
and you need to do:

if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
FONTDIRS = [os.path.join(os.environ['WINDIR'], 'Fonts')
elif sys.platform.startswith('darwin'):
# [see below and devise it yourself]
else: # linux, *bsd and everything else
# [see below, commit suicide and develop this bit]

Windows:
The easiest of those three, all the fonts are in %WINDIR%/Fonts.
In Python: os.path.join(os.environ['WINDIR'], 'Fonts')

Mac OS X:
http://support.apple.com/kb/ht2435 (and not all of them are
guaranteed to exist).  `os.expanduser()` may be useful for
that first one.

Linux, and everything else running that fancy open stuff (eg. *BSD):
Hardcore.  You just need to parse a nice tiny 155-line XML file.

It’s /etc/fonts/fonts.conf, and it has some  tags.
Some of them may have a `prefix="xdg"` attribute which makes you
prepend the value with $XDG_DATA_HOME (~/.local/share if that is
empty).  You also need `os.expanduser()`.

Oh: and you need to go recursively through them, as subdirectories
are also checked for fonts (and it probably goes further)

-- 
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html


pgpyE7rGDxSU2.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about mailing list rules

2013-07-12 Thread ChrisKwpolskaWarrick
On Fri, Jul 12, 2013 at 12:47 PM, Chris Angelico  wrote:
> On Fri, Jul 12, 2013 at 8:44 PM, Devyn Collier Johnson
>  wrote:
>> I am going to love this mailing list even more.
>>
>> Really, only Python code? I wanted to ask Python users about Perl! (^u^)
>>
>> Devyn Collier Johnson
>
> Heh. You'd be surprised what comes up. If it's at least broadly
> related to Python (maybe you're comparing constructs in Python and
> Perl??), it'll probably be accepted. And even stuff that's completely
> off-topic does at times get discussed.
>
> One small thing, though. Please avoid top-posting; the convention on
> this list is to quote text above, and write yours underneath. Makes it
> easier to follow the flow of conversation. Thanks!
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list

One more thing Devyn should do is watch the “To:” field and make sure
it says python-list@python.org, because the above message was sent to
Chris only, and that is not what should happen most of the time.
Another option is to use Reply All, but it will make old Usenet hags
angry, because they would get two copies.

--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about mailing list rules

2013-07-12 Thread ChrisKwpolskaWarrick
On Fri, Jul 12, 2013 at 2:25 PM, Devyn Collier Johnson
 wrote:
>
> On 07/12/2013 07:11 AM, Chris “Kwpolska” Warrick wrote:
>>
>> On Fri, Jul 12, 2013 at 12:47 PM, Chris Angelico  wrote:
>>>
>>> On Fri, Jul 12, 2013 at 8:44 PM, Devyn Collier Johnson
>>>  wrote:
>>>>
>>>> I am going to love this mailing list even more.
>>>>
>>>> Really, only Python code? I wanted to ask Python users about Perl! (^u^)
>>>>
>>>> Devyn Collier Johnson
>>>
>>> Heh. You'd be surprised what comes up. If it's at least broadly
>>> related to Python (maybe you're comparing constructs in Python and
>>> Perl??), it'll probably be accepted. And even stuff that's completely
>>> off-topic does at times get discussed.
>>>
>>> One small thing, though. Please avoid top-posting; the convention on
>>> this list is to quote text above, and write yours underneath. Makes it
>>> easier to follow the flow of conversation. Thanks!
>>>
>>> ChrisA
>>> --
>>> http://mail.python.org/mailman/listinfo/python-list
>>
>> One more thing Devyn should do is watch the “To:” field and make sure
>> it says python-list@python.org, because the above message was sent to
>> Chris only, and that is not what should happen most of the time.
>> Another option is to use Reply All, but it will make old Usenet hags
>> angry, because they would get two copies.
>>
>> --
>> Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
>> stop html mail| always bottom-post
>> http://asciiribbon.org| http://caliburn.nl/topposting.html
>
> Thank you and sorry about that.
>
> Kwpolska, I noticed your email shows "stop html mail" at the bottom. I have
> Thunderbird setup to use HTML mail. Are my emails coming up as plain text or
> HTML on this mailing list?
>
> Devyn Collier Johnson

Apparently, it comes in plaintext.  Mailman does not say that it
removed HTML, so it should be fine.  Either way, there should be a
switch in the new message window to set what should be sent.

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Beginner - GUI devlopment in Tkinter - Any IDE with drag and drop feature like Visual Studio?

2013-07-21 Thread ChrisKwpolskaWarrick
On Sun, Jul 21, 2013 at 1:14 PM, Dave Cook  wrote:
> On 2013-07-20, Aseem Bansal  wrote:
>
>> Do I need to use QtCreator with PySide if I want drag-and-drop
>> feature for GUI development?
>
> No, you just need the layout part of QtCreator, called QtDesigner, and
> any decent Python editor or IDE (e.g. Idle):

…and one more thing: pyside-uic, for transforming the .ui files into
(ugly) .py files.  It seems to be in /PythonXY/Scripts according to
Stack Overflow if you have PySide installed.
--
Kwpolska  | GPG KEY: 5EAAEA16
stop html mail| always bottom-post
http://asciiribbon.org| http://caliburn.nl/topposting.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread ChrisKwpolskaWarrick
On Sat, Jul 27, 2013 at 12:58 PM, Devyn Collier Johnson
 wrote:
> Linux systems with the proper software can use the "notify-send" command. Is
> there a cross-platform Python3 equivalent?
>
> Mahalo,
>
> Devyn Collier Johnson
> devyncjohn...@gmail.com
> --
> http://mail.python.org/mailman/listinfo/python-list

You already asked this on Thursday.  And the answer is probably “no”.  Creating

Under X11-based systems, you would have to call the dbus notification
APIs and pray that the user has something to handle it running (KDE,
GNOME Shell, XFCE4’s notification daemon).  Under Mac OS X 10.7 and
further, you need to work with some system APIs, and that may not be
easy, but possible (eg. https://github.com/alloy/terminal-notifier for
Ruby).

But Windows?  GOOD LUCK!  The following options exist, none of which
is easy to implement, and one of which is not usable with most
clients:

a) Toast Notifications in Windows 8/Server 2012, which is not a
   popular platform and may require quite a lot of magic in terms of
   coding and else (VS2012);
b) Create a tray icon and do a balloon (2000 and up?, definitely in XP);
c) Create your very own Windows toast notifications framework.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Cross-Platform Python3 Equivalent to notify-send

2013-07-27 Thread ChrisKwpolskaWarrick
Whoops!

On Sat, Jul 27, 2013 at 1:30 PM, Chris “Kwpolska” Warrick
 wrote:
> You already asked this on Thursday.  And the answer is probably “no”.  
> Creating

…a solution for this is not the easiest thing one can do.
-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Critic my module

2013-07-27 Thread ChrisKwpolskaWarrick
On Sat, Jul 27, 2013 at 3:19 PM, Devyn Collier Johnson
 wrote:
> About the aliases, I have tried setting pwd() as an alias for "os.getcwd()",
> but I cannot type "pwd()" and get the desired output. Instead, I must type
> "pwd". I tested this in Guake running Python3.3.
>
>>>> os.getcwd()
> '/home/collier'
>>>> pwd = os.getcwd()
>>>> pwd()
> Traceback (most recent call last):
>   File "", line 1, in 
> TypeError: 'str' object is not callable
>>>> pwd
> '/home/collier'
>>>> pwd() = os.getcwd()
>   File "", line 1
> SyntaxError: can't assign to function call
>
>
> How could I make pwd() work?
>
>
> Mahalo,
>
> DCJ
> --
> http://mail.python.org/mailman/listinfo/python-list

>>> import os
>>> pwd = os.getcwd
>>> pwd()
'/home/kwpolska'
>>> os.chdir('/')
>>> pwd()
'/'
>>>

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread ChrisKwpolskaWarrick
On Wed, Nov 13, 2013 at 3:17 PM, Ferrous Cranus  wrote:
> $ mkdir temp
> $ cd temp
> $ wget http://www.python.org/ftp/python/3.4/Python-3.4.tar.bz2
> $ tar -xjvf Python-3.4.tar.bz2
> $ cd Python-3.3.2
> $ ./configure
> $ make && make test
> $ su
> # make install
> # exit
> $ $ cd ../ && rm -rf Python-3.4
>
>
> root@secure [/home/nikos/www/cgi-bin]# python3 -V
> Python 3.4.0a4
>
>
> can yu please tell me where python 3.4a was placed in the system?
>
> i tried
>
> #!/usr/bin/python3
> #!/usr/local/bin/python3
>
> and also is there a way to call it like #!/usr/bin/python
>
> i know it can be done via ln 0s but i have to know where the newest python
> got installed.
>
> Thank you.
> --
> https://mail.python.org/mailman/listinfo/python-list

The command you are looking for is: which python3
Alternatively, you could run `where python3` to see how big the mess
on your system is (i.e. how many interpreters you have).

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trying tcompile an use the Python 3.4a

2013-11-13 Thread ChrisKwpolskaWarrick
On Wed, Nov 13, 2013 at 5:38 PM, Ferrous Cranus  wrote:
> Στις 13/11/2013 6:13 μμ, ο/η Steven D'Aprano έγραψε:
>
>
>>> and also is there a way to call it like #!/usr/bin/python
>>
>>
>> Of course there is, but only if you wish to break your system. The OS
>> will be expecting /usr/bin/python to be Python 2. Leave it be.
>
>
> Okey i will leave it be although i dislike the idea of using the shebang
> constructor as #~/usr/local/bin/python3
> Is there any way that i can use it as it was #!/usr/bin/python but firing
> python3 instead of python 2.6.6 ?

You can link it to /usr/bin/python3.  There should be no problem when
you do this.

> Also i'm tryong 'yum install python-pip' because some modules like 'pymysql'
> and 'pygeoip' are missing but CentOS doesn't seem able to detect it.

That should install it for the Python 2.6.6 you have, and possibly
under the name `python-pip` because of various shenanigans in the
redhatesque repos.

> Please help me install 'pip' so i can install the modules.

http://www.pip-installer.org/en/latest/installing.html#install-or-upgrade-setuptools

Get ez_setup.py and get-pip.py, and run them with the desired Python.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Odd msg received from list

2013-11-15 Thread ChrisKwpolskaWarrick
On Fri, Nov 15, 2013 at 12:30 AM, Gregory Ewing
 wrote:
> Verde Denim wrote:
>>
>> The message also listed my
>> account password, which I found odd.
>
>
> You mean the message contained your actual password,
> in plain text? That's not just odd, it's rather worrying
> for at least two reasons. First, what business does a
> message like that have carrying a password, and second,
> it means the server must be keeping passwords in a
> readable form somewhere, which is a really bad idea.

From the info page at https://mail.python.org/mailman/listinfo/python-list:

> You may enter a privacy password below. This provides only mild
> security, but should prevent others from messing with your
> subscription. **Do not use a valuable password** as it will
> occasionally be emailed back to you in cleartext.

> If you choose not to enter a password, one will be automatically
> generated for you, and it will be sent to you once you've confirmed
> your subscription.  You can always request a mail-back of your
> password when you edit your personal options. Once a month, your
> password will be emailed to you as a reminder.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Static Website Generator

2013-11-16 Thread ChrisKwpolskaWarrick
On Nov 16, 2013 3:45 PM, "Silvio Siefke"  wrote:
>
> Hello,
>
> i want try a static Website Generator. Has someone an advice for a simple
> and easy System to use? I want run my blog with it, so the system should
> run with my design of Website.
>
> I has try Pelican, but its i dont know that themeing make me crazy.

I love (full disclosure: and co-develop) Nikola — http://getnikola.com/

Theming Nikola is not hard, takes a few minutes tops.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Self-defence

2013-11-17 Thread ChrisKwpolskaWarrick
On Sun, Nov 17, 2013 at 6:09 PM, Zero Piraeus  wrote:
> :
>
> Note: I drafted a version of this post earlier today. I had been waiting
> to see whether Nikos succeeded in baiting the list into yet another
> round of unpleasantness before sending it, because I didn't want to
> worsen the situation, but at this point things are completely out of
> hand, and even what looks like a consensus attempt to ignore Nikos out
> of existence is
>
> a) failing: I count eighteen emails so far today.
>
> b) going to lead casual visitors to assume either that we ignore
> requests for help or that the list is Nikos' personal echo chamber.
>
> At this point I consider Nikos' actions a conscious attack on the list.
> There is simply no way, after the many times he's been told not to
> repost, that this is anything other than a direct and deliberate attempt
> to annoy as many people as he can.
>
> That being the case, I'd like to know whether there are technical
> measures that can be taken to prevent him from posting here.
>
> I understand that the mail/news gateway might complicate that, and that
> any measures taken could be bypassed by someone with sufficient skill. I
> suspect that in this particular case the latter issue is less relevant
> than it might otherwise be.
>
> I don't believe that killfiles are a sufficient response in this
> situation.
>
> I can, of course, stop Nikos' posts reaching me, and without too much
> hassle also stop replies to his posts reaching me. He would, however,
> continue to pollute the list in public, and his posts, whether replied
> to or not at the volume he's now sending them, would continue to damage
> the reputation of the list and, ultimately, I think possibly kill it.

We could report abuse to his server, eternal-september.org[0].  I
tried to do this, but they wanted fancy usenetty headers, and I am not
equipped to get them.

Now, we can try reporting for (a) abusive trolling; (b) excessive
morphing for killfile evasion (my original attempted report); (c) spam
(if I understand the Breidbart Index correctly, we might have to wait
for this, at least two emails to be precise)

[0]: http://www.eternal-september.org/index.php?showpage=abuse

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Terry Jones: "Monty Python to reunite for stage show"

2013-11-19 Thread ChrisKwpolskaWarrick
On Tue, Nov 19, 2013 at 3:08 PM, Thomas Heller  wrote:
> "All of the surviving members of comedy group Monty Python are to reform for
> a stage show, one of the Pythons, Terry Jones, has confirmed."
>
> See: http://www.bbc.co.uk/news/entertainment-arts-24999401
>
> Thomas
> --
> https://mail.python.org/mailman/listinfo/python-list

The PSF should buy all the tickets and give them out to Python devs.
Or even invite the group to PyCon 2014.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: SetupTools

2013-11-25 Thread ChrisKwpolskaWarrick
On Mon, Nov 25, 2013 at 9:35 AM, Chandru Rajendran
 wrote:
>
> Hi all,
> How can we set the target folder for the package in Setuptools?

The answer likely is *you are not allowed to do this*.  It’s up to the
user to set it.

Unless you are the user, and want to have the packages you install go
to a place desired by you, then the --prefix parameter may be of help
(although you are better off by using a virtualenv which makes it
unnecessary)

>  CAUTION - Disclaimer *
> [snip]
> ***INFOSYS End of Disclaimer INFOSYS***


Tell your legal department that such notices have no legal power
whatsoever and are just a waste of everyone’s bandwidth, time and the
like.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is It Bug?

2013-12-08 Thread ChrisKwpolskaWarrick
On Sun, Dec 8, 2013 at 2:22 AM, Roy Smith  wrote:
> There's nothing you can do with raw strings that you can't do with
> regular strings, but they're easier to read when you start to use
> backslashes.

Unfortunately, there is one.  A raw string cannot end with a backslash.

>>> r'a\a'
'a\\a'
>>> r'a\'
  File "", line 1
r'a\'
^
SyntaxError: EOL while scanning string literal
>>> r'\'
  File "", line 1
r'\'
   ^
SyntaxError: EOL while scanning string literal

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Islam is the fastest growing religion in the world especially since sept. 11.

2013-12-13 Thread ChrisKwpolskaWarrick
 against America (at least most of them).
>>
>> In fact it was to the advantage of the Americans to make statements that
>> would help divide the Muslims over the situation existing in Afghanistan and
>> the situation that was sure to occur. By making this statement, he left the
>> door open for the Muslims who did not want to see any problem between the
>> materialism of the West (which they personally enjoyed or would like to
>> enjoy) and the sacrificing of those who were willing to stand up against the
>> tyranny and oppression of the Western society and all that comes along with
>> it.
>>
>> So the strategy was to say things that made certain Muslims look bad while
>> at the same time not exactly attacking Islam. This led up to the next
>> desirable situation for shaytan (the devil): Divide the Muslims against each
>> other. So, now we had "mainstream Muslims" and "fundamentalist Muslims" and
>> "terrorist Islam" and "modern Islam." It worked too. The Muslims did the
>> thing that the non-Muslims could never have done. The Muslims defeated
>> themselves. Anytime that Muslims fight Muslims and Muslims kill Muslims,
>> then Allah's Protection is lifted from them and they will loose. That is
>> what happened.
>>
>> People Want to Know
>>
>> Still in the midst of all of this negative propaganda and bad press,
>> non-Muslim people were curious to learn more of this "cult" of Islam, its
>> people and their beliefs. Books about Islam and Muslims were disappearing
>> off the shelves of the bookstores faster than they could replenish them.
>> Unfortunately almost every single book was written either by a non-Muslim or
>> authors from the various deviant sects of Muslims. So the people were still
>> not getting the real message of the true Islam.
>>
>> Websites, chat rooms, email and message boards became alive with
>> information (and misinformation) about Islam, Muslims, Quran, Muhammad,
>> peace be upon him. Some people wanted to know the truth, others wanted to
>> hide it. Discussions and arguments about what Islam is about and what
>> Muslims do were very common place. This was the most exposure that these
>> subjects had ever had in the world at one time.
>>
>>
>> Open Communication Between Muslim & Non-Muslim
>>
>> The good news came when the various dialogs between the Muslims and
>> Christians began to take place. When the non-Muslims began to enter the
>> masjids and sit with the Muslims and shared together in discussions and
>> shared together enjoying the food and traditions of other cultures an
>> amazing thing began to happen. They opened their minds and their hearts to
>> the true message of the submission and surrender and obedience to the One
>> True God, Allah -- in Islam.
>>
>> Back to Islam
>>
>> Since September 11th, I have seen a huge increase in the interest of
>> people wanting to know about Islam and at the same time a marked increase in
>> the "dawah" (invitation) to Islam on the part of the Muslims around the
>> world. This is how the people are coming to Islam. The same way people have
>> come to Islam for 1,400 years. By learning the true message and being with
>> real Muslims. Those who are inclined to "revert" back to the natural state
>> of baby-like submission and peace with Allah, are finding their way back to
>> Islam.
>>
>>
>> Many New Muslims
>>
>> Islam today, is growing faster than ever. It is the Will of Allah, for
>> only He Guides. The people want to know. The interest is keen. The materials
>> are available in more simple terms in many languages. The Muslims are
>> starting to carry the responsibility of sharing the message of the true
>> "Peace With God in Islam."
>>
>> Islam In Every Home
>>
>> Somewhere in the middle of all of this is occurred to me an expression of
>> our prophet Muhammad, peace be upon him. When he said what might translate
>> to English as:
>>
>> "The Last Day will not come until Islam has entered every house on earth,
>> whether it is made of animal skins or from the earth."
>>
>>
>> http://www.islamhouse.com/185804/en/en/articles/Islam_is_the_fastest_growing_religion_in_the_world_especially_since_sept._11.
>>
>> http://www.islamtomorrow.com
>>
>> thank you
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread ChrisKwpolskaWarrick
On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller  wrote:
> And besides, again, a commercially licensed PyQt itself isn't *that*
> expensive.

> The cost of a commercial PyQt license for a single developer is £350
> (GBP). You may pay in either US Dollars, Euros or GBP.

(£420 incl. VAT for UK and select EU entities)

> one [license] per developer

For some people, it might be a lot.  Why waste money on something,
that has an almost-identical free-for-everyone version? (which also is
easier to install, BTW)

> PyQt does not include Qt itself. You must also obtain an
> appropriately licensed copy (either the commercial version from
> Digia or the LGPL version from the Qt Project).

So, you have four options:

a) use PySide and Qt@Project, pay $0 and be sane (albeit saner than
   person B);
b) use PyQt4 and Qt@Digia, pay £350/£420 + £??? and be sane;
c) use PySide and Qt@Digia, pay £??? and look like a hypocrite (albeit
   less than person D);
d) use PyQt4 and Qt@Project, pay £350/£420 and look like a hypocrite.

DISCLAIMER: Some things are based on assumptions, many of which may be
incorrect.

PS. For those living in the past without proper Unicode support: £ = GBP.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unicode to human readable format

2013-12-22 Thread ChrisKwpolskaWarrick
On Sun, Dec 22, 2013 at 1:24 PM,   wrote:
> Hi,
> i'm looking for solution the unicode string translation to the more readable 
> format.
> I've got string like s=s=[u'\u0105\u017c\u0119\u0142\u0144'] and have no idea 
> how to change to the human readable format. please help!
>
> regards,
> tomasz
> --
> https://mail.python.org/mailman/listinfo/python-list

While printing the string, instead of the list/seeing the list’s repr,
Python shows a nice human-friendly representation.

>>> s=[u'\u0105\u017c\u0119\u0142\u0144']
>>> s
[u'\u0105\u017c\u0119\u0142\u0144']
>>> s[0]
u'\u0105\u017c\u0119\u0142\u0144'
>>> print s
[u'\u0105\u017c\u0119\u0142\u0144']
>>> print s[0]
ążęłń

However, that is only the case with Python 2, as Python 3 has a
human-friendly representation in the repr, too:

>>> s=[u'\u0105\u017c\u0119\u0142\u0144']
>>> s
['ążęłń']

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Apache restart after source changes

2013-12-26 Thread ChrisKwpolskaWarrick
On Thu, Dec 26, 2013 at 7:36 AM, Fredrik Bertilsson  wrote:
>> Also, it's not a python issue, it's an issue with your particular
>> stack. Other stacks do automatic reloading (for example, the web
>> server that Django uses).
>
> Which web server do you suggest instead of Apache, which doesn't have this 
> problem? (I am not planning to use Django)
> --
> https://mail.python.org/mailman/listinfo/python-list

It depends.  Some other frameworks (like Flask) also offer auto-reload
in debug mode — auto-reload can be bad for you and is not supported by
production environments, in which uWSGI (in Emperor mode if
possible/makes sense on Windows) and nginx is the best solution
around, and auto-reload isn’t supported (for good reasons, as
mentioned before).
-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Editor for Python

2014-01-08 Thread ChrisKwpolskaWarrick
On Wed, Jan 8, 2014 at 4:53 PM, Jean-Michel Pichavant
 wrote:
> I tried to negotiate this with my IT guys, but it looks like it's now 
> mandatory, something related to being in the USA stock market.
> I have no way to remove it, it's added by the email server. I apologise for 
> the noise.

But you have a way to hide it for people whose clients do support
that.  Simply, instead of signing your letters with “JM” yourself and
having your employer add this spam, simply have your mail client add
the sequence below as your signature.  Some clients offer adding the
separator automatically and you only have to type JM in the signature
field.

The “magical” sequence is: -- \nJM

(that is 0x2D 2D 20 0A 4A 4D, with a trailing space)


> JM
>
>
> -- IMPORTANT NOTICE:
>
> The contents of this email and any attachments are confidential and may also 
> be privileged. If you are not the intended recipient, please notify the 
> sender immediately and do not disclose the contents to any other person, use 
> it for any purpose, or store or copy the information in any medium. Thank you.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: imperative mood in docstrings

2014-02-09 Thread ChrisKwpolskaWarrick
On Sun, Feb 9, 2014 at 5:52 PM, Roy Smith  wrote:
> In article ,
>  bagrat lazaryan  wrote:
>
>> pep 257 -- docstring conventions, as well as a myriad of books and other
>> resources, recommend documenting a function's or method's effect as a command
>> ("do this", "return that"), not as a description ("does this", "returns
>> that"). what's the logic behind this recommendation?
>>
>> bagratte
>
> Methods are verbs, and should be described as such.  If I had:
>
> class Sheep:
>def fly(self):
>   "Plummet to the ground."
>
> I'm defining the action the verb performs.  If, on the other hand, I had:
>
> class Sheep:
>def fly(self):
>   "Plummets to the ground"
>
> I'm no longer describing the action of flying, I'm describing what the
> sheep does when it attempts to perform that action.

This can also be seen with a (monolingual) dictionary.  For example:
https://www.google.com/search?q=define+fly (that’s actually from the
New Oxford American Dictionary):

fly, verb: 1. move through the air under control. 2. move or be hurled
quickly through the air.

Those could be valid docstrings (if sheep could fly, of course…) — so,
in other words, act as if you were writing a dictionary and not Python
code.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to turn a package into something pip can install

2014-02-15 Thread ChrisKwpolskaWarrick
On Sat, Feb 15, 2014 at 3:26 AM, Roy Smith  wrote:
> In article ,
>  Ryan Gonzalez  wrote:
>
>> python setup.py sdist
>
> OK, I run that and I get a metar-1.4.0.tar.gz under dist.  If I move
> that tarfile to my packages directory, and run pip, I get:
>
> $ pip install --no-index --quiet --find-links packages metar==1.4.0
[snip]
> ValueError: unknown url type: packages

The path to your cache directory is incorrect.  I suggest using
absolute paths (eg. /home/user/packages) instead of relative paths,
which is likely what caused this issue.

On Fri, Feb 14, 2014 at 7:47 PM, Roy Smith  wrote:
> What I can't figure out is what I need to do to go from a clone of the
> github repo to a tarball I can drop into our packages directory.  Is
> there some tutorial somewhere that explains this?

Actually, you could even tar up that entire repo (or even get a nice
ready tarball from GItHub) and you will get something usable with pip.
 For example, we in the Nikola project
(https://github.com/getnikola/nikola) upload the GitHub tarballs to
PyPI because we ship 99.9% of our tree anyways and hiring `setup.py
sdist` would be a waste of time (and would produce two
almost-identical-but-not-quite tarballs).

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to turn a package into something pip can install

2014-02-16 Thread ChrisKwpolskaWarrick
On Sat, Feb 15, 2014 at 11:35 PM, Roy Smith  wrote:
> In article ,
>  Roy Smith  wrote:
>
>> > > $ pip install --no-index --quiet --find-links packages metar==1.4.0
>> > [snip]
>> > > ValueError: unknown url type: packages
>> >
>> > The path to your cache directory is incorrect.  I suggest using
>> > absolute paths (eg. /home/user/packages) instead of relative paths,
>> > which is likely what caused this issue.
>>
>> No, that's not it.  It doesn't work with an absolute path either.
>
> OK, I figured this out.  The on-line docs
> (http://www.pip-installer.org/en/latest/reference/pip_wheel.html) say
> you can give --find-links a path, but it looks like it insists on it
> being a valid URL.  If I prepend "file:" to the absolute path, it works.
>
> Maybe this is something which has changed in newer versions of pip?
> I've got 1.1 (and python 2.7.3).  I'm pretty sure both of these are what
> came with Ubuntu Precise.
> --
> https://mail.python.org/mailman/listinfo/python-list

It’s heavily outdated, and that IS the cause of your problem.  pip 1.5
accepts such paths just fine.  Please upgrade your pip.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Requests script to login to a phpbb forum

2014-02-19 Thread ChrisKwpolskaWarrick
On Wed, Feb 19, 2014 at 12:46 PM, Leo  wrote:
> Hi there,
>
> I have decided to jump in at the deep end to try and learn python. I have
> been able to get requests to pull the login page off the server and I think
> send the login request. I don't get logged in though. Please let me know if
> I would be better off asking in a phpBB related group or forum.
> Here is my code without username and password included:

You need cookies.  In order to do it, simply use sessions instead of
the “global” API.  Code:

import requests

payload = {'username': 'username', 'password': 'password'}
session = requests.Session()
r = session.post("http://www.tt-forums.net/ucp.php?mode=login",data=payload)
sidStart = r.text.find("sid")+4
sid = r.text[sidStart:sidStart+32]
parameters = {'mode': 'login', 'sid': sid}
r = 
session.post("http://www.tt-forums.net/ucp.php",params=parameters,data=payload)
if "Logout" in r.text: print("We are in")

(for the record, I added the session creation line and replaced
requests. with session. so it uses your session.  This code was not
tested on a real phpBB forum; if everything you coded is correct, it
will work.)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Wheezy.web - is it been developed?

2014-02-19 Thread ChrisKwpolskaWarrick
On Wed, Feb 19, 2014 at 8:18 AM, Andriy Kornatskyy
 wrote:
> I believe the web framework should not be something cryptic (requiring 
> community to exchange ideas about workarounds) nor something that involves 
> infinitive development cycle.

Having lots of humans give support is much better when you have
problems.  You are more likely to get a quick response from a big
group of humans than from one developer.

On Wed, Feb 19, 2014 at 12:31 PM, Marcio Andrey Oliveira
 wrote:
> I navigated in its site. I just feel strange that no one wrote tutorials of 
> it (not counting some speed testing) and that there is no Wheezy.web 
> community (yet).

I personally suggest trying something more popular, like Flask,
Bottle, Pyramid, or Django (though it’s quite big and complicated).
Lots of tutorials exist for those.  There are big, vivid communities
offering help and support.  You can often find good solutions for
popular problems (like user accounts) without reinventing wheels.
Flask is the easiest option, and it’s very popular.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: The sum of numbers in a line from a file

2014-02-20 Thread ChrisKwpolskaWarrick
On Thu, Feb 20, 2014 at 7:16 PM,   wrote:
> What I've got is
> def stu_scores():
> lines = []
> with open("file.txt") as f:
> lines.extend(f.readlines())
> return ("".join(lines[11:]))

This returns a string, not a list.  Moreover, lines.extend() is
useless. Replace this with:

def stu_scores():
with open("file.txt") as f:
lines = f.readlines()
return lines[11:]

> scores = stu_scores()
> for line in scores:

`for` operating on strings iterates over each character.

> fields = line.split()

Splitting one character will turn it into a list containing itself, or
nothing if it was whitespace.

> name = fields[0]

This is not what you want it to be — it’s only a single letter.

> sum1 = int(fields[4]) + int(fields[5]) + int(fields[6])

Thus it fails here, because ['n'] has just one item, and not nine.

> sum2 = int(fields[7]) + int(fields[8])
> average1 = sum1 / 3.0
> average2 = sum2 / 2.0
> print ("%s %f %f %") (name, average1, average2)
>
> It says that the list index is out of range on the sum1 line. I need 
> stu_scores because the table from above starts on line 11.
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: test

2014-03-16 Thread ChrisKwpolskaWarrick
On Sun, Mar 16, 2014 at 4:41 AM, Mark H Harris  wrote:
> I have been having a fit with gg, and its taken just a little time to get a
> real news-reader client for posting. What a fit. Google does really well
> with some things, but gg is not one of them, IMHO.

Why not use the mailing list instead?  It’s a much easier way to
access this place.

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

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Github down?

2014-03-21 Thread ChrisKwpolskaWarrick
On Fri, Mar 21, 2014 at 2:48 PM, Skip Montanaro  wrote:
> On Fri, Mar 21, 2014 at 8:24 AM, Larry Martell  
> wrote:
>> https://twitter.com/githubstatus
>
> Thanks for the pointer. I'm an old fart and don't use social media
> much (in fact, just closed my FB account a couple days ago). Does that
> mean I'm a curmudgeon? :-)

If you dislike social media (or prefer a nice website with graphs and
such), then go there:

https://status.github.com/

(though GitHub could qualify as social media for some…)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Time we switched to unicode?

2014-03-25 Thread ChrisKwpolskaWarrick
On Tue, Mar 25, 2014 at 9:05 AM, Marko Rauhamaa  wrote:
> Chris Angelico :
>
>> On Tue, Mar 25, 2014 at 4:14 PM, Mark H Harris  wrote:
>>>>>> Π¹ = pi
>>
>> That's good! (Although typing Π¹ quicker than pi is majorly pushing it.
>
> It don't think that's good. The lower-case letter π² should be used. The
> upper-case letter is used for a product, although unicode dedicates a
> separate character for the purpose: ∏³.
>
> I often see Americans, especially, confuse upper and lower-case letters
> in symbols ("KM" for "km", "L" for "l" etc).


“L” is actually valid, and so is “l”.  This happens mainly because
humans (and computers) tend to write “1 l” (one liter, one-ell) in a
way that makes it harder to distinguish (becoming eleven or ell-ell),
especially if you don’t include the space (which is invalid).

On Tue, Mar 25, 2014 at 9:23 AM, Chris Angelico  wrote:
> If you can type a capital ∏³, you can type a lower-case π², unless there's 
> something very weird going on.

Nitpick time!  (because we all love it so much!)

Π¹ = U+03A0 GREEK CAPITAL LETTER PI
π² = U+03C0 GREEK SMALL LETTER PI
∏³ = U+220F N-ARY PRODUCT

“If you can type an N-ARY PRODUCT, you can type a GREEK SMALL LETTER
PI, unless there’s something very weird going on.”

…like, the user is in the past and is using ISO 8859-7 (instead of a
21st-century encoding, like UTF-8).  An encoding which has support for
Π¹ and π², but not for ∏³… (of course, this assumes that, if we add
those new characters into python, we allow any encoding, somehow.)

That’s not too weird, other than the ancient encoding being used.
(though that’s a bit less weird on Windows, but that’d be
Windows-1253.)

Oh: and speaking of fancy Unicode characters that are worthless
~duplicates, spot the difference here:

µ μ

If you are lucky enough (and, luckiness may involve reading this
e-mail in Helvetica (not Neue though) on a Mac), you can clearly see
that they are different.  If you are using a font that does not
differentiate them, you may think they’re the same.  If you ask some
intelligent software (like `unicodedata.name()` in Python), you’ll
quickly find out the first is MICRO SIGN, and the other is GREEK SMALL
LETTER MU.  Such craziness is what makes Unicode Unicode.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Calculating time differences given daylight savings time

2014-04-03 Thread ChrisKwpolskaWarrick
On Thu, Apr 3, 2014 at 3:45 AM, Washington Ratso  wrote:
> I am running Python 2.7 and would like to be able to calculate to the second 
> the time difference between now and some future date/time in the same 
> timezone while taking into account daylight savings time.  I do not have 
> pytz.  Any ideas how to do it?
>
> If it requires having pytz, how would I do it with pytz?
>
> Thank you.
> --
> https://mail.python.org/mailman/listinfo/python-list

It requires having pytz, or dateutil, in order to get timezone
objects*.  You can also create those objects yourself, but that’s
tricky — and you SHOULD NOT do time zones on your own and just use
something else.  Why?  See [0].

Example with pytz:

# Necessary imports
import pytz
from datetime import datetime

# the timezone in this example is Europe/Warsaw — use your favorite one
tz = pytz.timezone('Europe/Warsaw')

now = datetime.now(tz)
# Note I’m not using the tzinfo= argument of datetime(), it’s flaky
and seemingly uses a historic WMT (+01:24) timezone that is dead since
1915.
future = tz.localize(datetime(2014, 12, 24))

# And now you can happily do:

delta = future - now

# and you will get the usual timedelta object, which you can use the usual way.


###

* pytz ships the Olson tz database, while dateutil maps uses your
system’s copy of the tz database (if you are on Linux, OS X or
anything else that is not Windows, really) or maps to the Windows
registry.  Use whichever suits you.

[0]: http://www.youtube.com/watch?v=-5wpm-gesOY

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: change spacing to two instead of four with pep8 or flake8?

2014-04-08 Thread ChrisKwpolskaWarrick
On Tue, Apr 8, 2014 at 5:06 AM, Dennis  wrote:
> Hi,
>
> In Pylint you can change the spacing multiplier from 4 spaces to two
> in its pylintrc, but for the life of me I cannot find a way to do this
> with the flake8 / pep8 utilities.
>
> I want to avoid ignoring E111 altogether if at all possible, because
> it may catch other spacing problems that are not as obvious.
>
> hacky/non-hacky solutions welcome of course.
>
> If this is too specific and I should go to the pep8/flake8 MLs that is
> welcome advice too.
>
> Thanks,
>
> Dennis
> --
> https://mail.python.org/mailman/listinfo/python-list

You are trying to use tools that enforce a set of rules, one of which
is “use 4 spaces per indentation level”.  If you don’t agree with this
rule, simply don’t use tools that enforce these rules.  It’s that
easy.

But note, that E111 is “indentation is not a multiple of four”.  Which
you are never going to listen to anyways if you want 2 spaces per
indentation level.  If you *really* want to do 2 spaces (and look
weird), then just ignore that.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: TeX $\times$ symbol not working in matplotlib?

2014-04-18 Thread ChrisKwpolskaWarrick
On Fri, Apr 18, 2014 at 6:18 PM, gwhite  wrote:
> I am trying to understand how to get the TeX "\times" symbol to work.  It is 
> in the title() string in the code I pasted in.  The "\circ" symbol seems 
> fine, by comparison.  "\times" ends up as "imes" in the figure title.
>
> I am probably doing something dumb (hey, maybe a lot of dumb things!), but if 
> you can spot and describe my mistake, I would be quite happy about that.

> plt.title('$\mathrm{poles}$ $(\times)$ \
>$\mathrm{\&}$ $\mathrm{zeros}$ \
>$(\circ)$ $\mathrm{of}$ $T(s)T(-s)$',\
>fontsize=16)

You’re using a regular string.  In which backspaces can be used in
escapes.  \t is one of those escapes, it is the tab character.  In
order to fix, add the letter "r" before the opening quote.  Like this:

> plt.title(r'$\mathrm{poles}$ $(\times)$ \
>$\mathrm{\&}$ $\mathrm{zeros}$ \
>$(\circ)$ $\mathrm{of}$ $T(s)T(-s)$',\
>fontsize=16)

Moreover, in the next two things, you already did it right in the first place:

> plt.xlabel(r'$\sigma$', fontsize=16)
> plt.ylabel(r'$\mathrm{j}\omega$', fontsize=16)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Shared web hosting where python is *not* a second class citizen

2014-05-25 Thread ChrisKwpolskaWarrick
On Sun, May 25, 2014 at 7:25 PM, memilanuk  wrote:
> Right now we have a fairly basic shared hosting plan via bluehost.com,
> running WordPress for a club web site.  I've looked at setting up python
> on this account, but the default is the version of python that comes
> with the OS (CentOS 5.x currently).  There are some basic instructions on
> upgrading that at a user level to 2.7... but nothing for python3, and most
> of the python posts in their user forums go unanswered.  Not exactly
> confidence inspiring!  The irony is that one of my web searches included a
> review of shared hosting and listed BlueHost as the number one
> recommendation!
>
> So I'm left wondering if there is someplace that people here would recommend
> (for this kind of plan or others) where python isn't a second class citizen.
> Really not interested (for my current uses) in a VPS.  I just want some
> place where it doesn't feel like python support is some sort of bone thrown
> out there just to say that they 'support' python.

Heroku, Google App Engine, or pretty much any other
Platform-as-a-Service provider.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ImportError: No module named appengine.ext

2013-07-31 Thread ChrisKwpolskaWarrick
On Wed, Jul 31, 2013 at 7:51 PM, Jaiky  wrote:
> hey learning python
>
> problem facing is under when typing on interpreter
>
>
>>>> from google.appengine.ext import db
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named appengine.ext
>
>
> what to do please help .
> --
> http://mail.python.org/mailman/listinfo/python-list

You do not have the Google AppEngine packages installed on your
system.  You may want to get the AppEngine SDK or the AppEngine
development server.
-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP8 revised: max line lengths

2013-08-02 Thread ChrisKwpolskaWarrick
On Fri, Aug 2, 2013 at 2:51 AM, Roy Smith  wrote:
> In article ,
>  Terry Reedy  wrote:
>
>> Newly revised this morning:
>> http://www.python.org/dev/peps/pep-0008/#maximum-line-length
>> summary:
>> 72 for text block (comments, triple-quoted strings)
>> 79 for normal code
>> 99 for code that is really more readable with extra
>
> And the people did rejoice and did feast upon the lambs and toads and
> tree-sloths and fruit-bats and orangutans and breakfast cereals.

The 99-characters rule does not apply for the stdlib.  And outside of
the stdlib, PEP 8 is not mandated by Python (but it might be by the
project leader or similar entities).  If someone wanted long lines,
then they could do so ALL THE TIME.

So, what are you feasting for?  Nothing?

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: New VPS Provider needed

2013-08-27 Thread ChrisKwpolskaWarrick
On Tue, Aug 27, 2013 at 1:21 PM, Νικόλαος  wrote:
> Actually it is.
> Poeple are web programmers here and lots of them doing hosting.

Fortunately, most of them would not trust you.  And in case they
would, a quick search through what happened on this list a while ago
should fix that.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Moving to Python for web

2013-08-29 Thread ChrisKwpolskaWarrick
On Thu, Aug 29, 2013 at 4:18 AM, Sam Fourman Jr.  wrote:
> there are MANY micro frameworks, I have been following these guys for a few
> years
> http://www.pocoo.org/

+1.  The Pocoo team makes many awesome things.

> specifically jinja2 and flask looks to be the best choice out of all the
> options out there

Jinja2 is a standalone templating engine, something like Smarty for
PHP.  And Flask is a microframework, which adds on top of Jinja2 (not
mandatory) and Werkzeug (another Pocoo project) to make a nice and
easy webdevelopment base.  IMO it is the best choice in terms of
microframeworks.

But microframeworks are, as the name states, micro.  The big
frameworks include tons of abstractions and fancy features.  Some
people may like them, others may not.  (Those features can obviously
be implemented in the microframeworks on one’s own or through existing
open-source code.)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Moving to Python for web

2013-08-29 Thread ChrisKwpolskaWarrick
On Thu, Aug 29, 2013 at 2:45 PM, Andreas Ecaz  wrote:
> I've decided to go with Flask! It's now running on UWSGI with NGINX. 
> Hopefully I can get some stuff done :)

How are you running uWSGI?  On sane (non-Windows) OSes, I recommend
using the uWSGI Emperor, which will protect you from your website
going down when something crashes.  You run the Emperor through your
OS’s init system (e.g. upstart in Ubuntu, systemd in many others).

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie: use of built-in exceptions

2013-09-01 Thread ChrisKwpolskaWarrick
On Sun, Sep 1, 2013 at 1:17 PM, Rui Maciel  wrote:
> Are there any guidelines on the use (and abuse) of Python's built-in 
> exceptions, telling where
> it's ok to raise them and where it's preferable to define custom exceptions 
> instead?

There are no rules.  You should use common sense instead: if the
exception fits your needs (eg. ValueError when incorrect output
occurs) then use it.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What does mean @ sign in first of statement

2013-09-01 Thread ChrisKwpolskaWarrick
On Sun, Sep 1, 2013 at 8:53 PM, Mohsen Pahlevanzadeh
 wrote:
> Dear all,
>
> What does mean @ sign in first of statement such as:
>
> //
> @hybrid_property
> def fullname(self):
> return self.firstname + " " + self.lastname
> ///
>
> Sorry for cheap question.
>
> Yours,
> Mohsen
>
> --
> http://mail.python.org/mailman/listinfo/python-list

@hybrid_property is a decorator.  Great resource:
http://simeonfranklin.com/blog/2012/jul/1/python-decorators-in-12-steps/

--
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How can I remove the first line of a multi-line string?

2013-09-02 Thread ChrisKwpolskaWarrick
On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion  wrote:
> Hello Everyone,
>
> I have a multi-line string and I need to remove the very first line from
> it. How can I do that? I looked at StringIO but I can't seem to figure
> out how to properly use it to remove the first line. Basically, I want
> to toss the first line but keep everything else.  Can anyone put me on
> the right path? I know it is probably easy but I'm still learning Python
> and don't have all the string functions down yet.
>
> Thanks,
> Anthony
> --
> http://mail.python.org/mailman/listinfo/python-list

Use split() and join() methods of strings, along with slicing.  Like this:

fullstring = """foo
bar
baz"""

sansfirstline = '\n'.join(fullstring.split('\n')[1:])

The last line does this:
1. fullstring.split('\n') turns it into a list of ['foo', 'bar', 'baz']
2. the [1:] slice removes the first element, making it ['bar', 'baz']
3. Finally, '\n'.join() turns the list into a string separated by
newlines ("""bar
baz""")

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to display ReST properly on pypi?

2013-09-14 Thread ChrisKwpolskaWarrick
On Sat, Sep 14, 2013 at 11:08 AM, Michel Albert  wrote:
> In general, I write my README files using the ReST syntax. But when I do, 
> they don't show up formatted on pypi (see for example 
> https://pypi.python.org/pypi/config_resolver/3.3.0).
>
> How do I get it to be formatted properly?
>
> Also, is there a way to specify that the "description" field in setup.py is 
> formatted as ReST?
> --
> https://mail.python.org/mailman/listinfo/python-list

rst2html crashes with your file.  Also, `py:class` is Sphinx-only and
won’t work with the Cheeseshop and produce garbage in the output.

[kwpolska@kwpolska-lin config_resolver-3.3.0]% rst2html README.rst
README.rst:67: (WARNING/2) Inline emphasis start-string without end-string.
README.rst:108: (ERROR/3) Unknown interpreted text role "py:class".
README.rst:115: (ERROR/3) Unknown interpreted text role "py:class".
README.rst:121: (ERROR/3) Unknown interpreted text role "py:class".
README.rst:142: (SEVERE/4) Problems with "include" directive path:
InputError: [Errno 2] No such file or directory: 'CHANGES'.
Exiting due to level-4 (SEVERE) system message.
[kwpolska@kwpolska-lin config_resolver-3.3.0]% echo $?
1
[kwpolska@kwpolska-lin config_resolver-3.3.0]%

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: In Python language, what is (void) referring to?

2013-09-21 Thread ChrisKwpolskaWarrick
On Sat, Sep 21, 2013 at 11:10 AM, Don Sylvia  wrote:
> void...?
> --
> https://mail.python.org/mailman/listinfo/python-list

void does not exist in Python, unless you named a variable “void”.  In
that case, it means whatever you set it to.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to login to a website using Python 3.x?

2013-09-25 Thread ChrisKwpolskaWarrick
On Tue, Sep 24, 2013 at 10:39 AM, Mark Lawrence  wrote:
> On 24/09/2013 09:09, Osumo Clement wrote:
>>
>>   Hi. I am new to Python. I am making a script where logging in to a
>> website is the first step.. I am using Python 3.3 All of the help I have
>> seen online uses urllib2 which in Python 3 aint there. I will greatly
>> appreciate any help
>>
>
> urllib2 has been renamed in Python 3 see
> http://www.python.org/dev/peps/pep-3108/#urllib-package

Note that, for sanity, you should use <http://python-requests.org/> (a
third-party package) instead.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread ChrisKwpolskaWarrick
On Wed, Sep 25, 2013 at 2:45 PM, Νίκος  wrote:
> Hello, i decided am ong other os.environ variables to also grab the
> 'HTTP_REFERER' fiel but when i try to run my script i was seeing a KeyError
> complaining that 'HTTP_REFERER' didnt exist.
>
> So, to see what existed in the os.environ dictionary i issues a print(
> os.environ ) to see all available keys and their values:

The Referer header is not mandatory by any means.  Your client
probably does not send it.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-09-29 Thread ChrisKwpolskaWarrick
On Sun, Sep 29, 2013 at 1:51 PM, Νίκος  wrote:
> Στις 29/9/2013 2:46 μμ, ο/η Dave Angel έγραψε:
>>
>> On 29/9/2013 07:25, Νίκος wrote:
>>
>>
>>>
>>> Thank you for being willing to look this further.
>>
>>
>> Willing, but probably not able.  I think I know a lot about the
>> language, and less about the libraries.  I know very little about the
>> administration side of internet use. The reference to /etc/hosts is
>> only a guess, as I said.
>>
>>
>>
>>
> Can you please point me to a direction that someone will be able to help me
> with this since the provider doesn't care to do so?

I can point you to “find a sysadmin that will work for you and fix
your problems for money”.  Where can you find one?  That’s not a
question for me.  I suggest looking around Greek websites, as someone
speaking the same language as you could help you better.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: JUST GOT HACKED

2013-10-01 Thread ChrisKwpolskaWarrick
On Tue, Oct 1, 2013 at 3:15 PM, Νίκος  wrote:
> Στις 1/10/2013 4:06 μμ, ο/η Mark Lawrence έγραψε:
>>
>> On 01/10/2013 10:58, Νίκος wrote:
>>>
>>> Just logged in via FTP to my server and i saw an uploade file named
>>> "Warnign html"
>>>
>>> Contents were:
>>>
>>> WARNING
>>>
>>> I am incompetent. Do not hire me!
>>>
>>> Question:
>>>
>>> WHO AND MOST IMPORTNTANLY HOW DID HE MANAGED TO UPLOAD THIS FILE ON MY
>>> ACCOUNT?
>>>
>>> PLEASE ANSWER ME, I WONT GET MAD, BUT THIS IS AN IMPORTANT SECURITY RISK.
>>>
>>> SOMEONES MUST HAVE ACCESS TO MY ACCOUNT, DOES THE SOURCE CODE OF MY MAIN
>>> PYTHON SCRIPT APPEARS SOMEPLACE AGAIN?!?!
>>
>>
>> Would you please stop posting, I've almost burst my stomach laughing at
>> this.  You definetely have a ready made career writing comedy.
>
>
> Okey smartass,
>
> Try to do it again, if you be successfull again i'll even congratulate you
> myself.
>
> --
> https://mail.python.org/mailman/listinfo/python-list

It looks like you are accusing someone of doing something without any
proof whatsoever.  Would you like help with the fallout of the lawsuit
that I hope Mark might (should!) come up with?

Speaking of “try again”, I doubt it would be hard…  As long as a FTP
daemon is running somewhere (and you clearly do not know better); or
even you have a SSH daemon and you do not know better, an attacker
can:

a) wait for you to publish your password yet again;
b) get you to download an exploit/keylogger/whatever;
c) brute-force.

Well, considering it’s unlikely you actually have a long-as-shit
password, (c) is the best option.  Unless your password is very long,
in which case is not.

I’m also wondering what language your password is in.  If you actually
used a Greek phrase, how long will it take you to get locked out due
to encoding bullshit?

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: JUST GOT HACKED

2013-10-01 Thread ChrisKwpolskaWarrick
Why is this list not setting Reply-To correctly again?

-- Forwarded message --
From: Chris “Kwpolska” Warrick 
Date: Tue, Oct 1, 2013 at 3:55 PM
Subject: Re: JUST GOT HACKED
To: Νίκος 


On Tue, Oct 1, 2013 at 3:42 PM, Νίκος  wrote:
> Στις 1/10/2013 4:27 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:
>>
>> On Tue, Oct 1, 2013 at 3:15 PM, Νίκος  wrote:
>>>
>>> Στις 1/10/2013 4:06 μμ, ο/η Mark Lawrence έγραψε:
>>>>
>>>>
>>>> On 01/10/2013 10:58, Νίκος wrote:
>>>>>
>>>>>
>>>>> Just logged in via FTP to my server and i saw an uploade file named
>>>>> "Warnign html"
>>>>>
>>>>> Contents were:
>>>>>
>>>>> WARNING
>>>>>
>>>>> I am incompetent. Do not hire me!
>>>>>
>>>>> Question:
>>>>>
>>>>> WHO AND MOST IMPORTNTANLY HOW DID HE MANAGED TO UPLOAD THIS FILE ON MY
>>>>> ACCOUNT?
>>>>>
>>>>> PLEASE ANSWER ME, I WONT GET MAD, BUT THIS IS AN IMPORTANT SECURITY
>>>>> RISK.
>>>>>
>>>>> SOMEONES MUST HAVE ACCESS TO MY ACCOUNT, DOES THE SOURCE CODE OF MY
>>>>> MAIN
>>>>> PYTHON SCRIPT APPEARS SOMEPLACE AGAIN?!?!
>>>>
>>>>
>>>>
>>>> Would you please stop posting, I've almost burst my stomach laughing at
>>>> this.  You definetely have a ready made career writing comedy.
>>>
>>>
>>>
>>> Okey smartass,
>>>
>>> Try to do it again, if you be successfull again i'll even congratulate
>>> you
>>> myself.
>>>
>>> --
>>> https://mail.python.org/mailman/listinfo/python-list
>>
>>
>> It looks like you are accusing someone of doing something without any
>> proof whatsoever.  Would you like help with the fallout of the lawsuit
>> that I hope Mark might (should!) come up with?i'am
>>
>>
>> Speaking of “try again”, I doubt it would be hard…  As long as a FTP
>> daemon is running somewhere (and you clearly do not know better); or
>> even you have a SSH daemon and you do not know better, an attacker
>> can:
>>
>> a) wait for you to publish your password yet again;
>> b) get you to download an exploit/keylogger/whatever;
>> c) brute-force.
>>
>> Well, considering it’s unlikely you actually have a long-as-shit
>> password, (c) is the best option.  Unless your password is very long,
>> in which case is not.
>>
>> I’m also wondering what language your password is in.  If you actually
>> used a Greek phrase, how long will it take you to get locked out due
>> to encoding bullshit?
>
>
> Like i use grek letter for my passwords

Did you know that you just lowered the amount of characters an
attacker should check while brute-forcing your password from 256/164
(UTF-*/ISO-8859-7) to just 95?  No?  Congratulations anyways, Nikos!

--
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense


-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: JUST GOT HACKED

2013-10-02 Thread ChrisKwpolskaWarrick
On Wed, Oct 2, 2013 at 1:48 AM, Tim Delaney  wrote:
> On 2 October 2013 09:28, Νίκος  wrote:
>>
>>
>> con = pymysql.connect( db = 'mypass', user = 'myuser', passwd =
>> 'mysqlpass', charset = 'utf8', host = 'localhost' )
>>
>> That was viewable by the link Mark have posted.
>>
>> But this wasnt my personal's account's login password, that was just the
>> mysql password.
>>
>> Mysql pass != account's password
>
>
> Because there's no chance with the brilliance you display that there could
> be any possibility of login details being kept in plaintext in your
> database.

Or the statement is a blatant lie and was meant to be

mysql_password is not account_password

as they have the same value, but are set independently.  (too much Python Ale…)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Database statements via python but database left intact

2013-10-06 Thread ChrisKwpolskaWarrick
On Sun, Oct 6, 2013 at 12:51 AM, Chris Angelico  wrote:
> On Sun, Oct 6, 2013 at 8:39 AM, Ned Batchelder  wrote:
>> Now is a good time to go read about transactions, and committing, and the
>> difference between MyISAM and InnoDB.  Please don't ask more about it here.
>
> It's because of threads like this that I would really like Python to
> nudge people towards something stronger than MySQL. Would it kill
> Python to incorporate PostgreSQL bindings automatically?

It would require Postgres around people’s (or at least packagers’)
systems, and it often gets messy when we have such requirements.
Psycopg2, the most popular binding, is licensed under LGPL3 + Zope (or
such, there is a little mess here) which MAY pose a problem (IANAL
though).  Also, Postgres is much harder to configure than MySQL,
especially if you have no experience or an asshole OS.  Moreover, the
stdlib is where packages come to die.

So, instead of this, maybe we should work on getting psycopg2 to the
top result on Googling “python sql”, or even “python mysql” with an
anti-MySQL ad? (like vim was doing some time ago on Googling “emacs”)

We should also educate people on how PostgreSQL works with a nice,
human-friendly tutorial.  Especially in some non-standard things and
things that differ between PostgreSQL and MySQL — like how to make an
auto-incrementing ID field (use sequences), or how PostgreSQL arrays
work, among others.  The wiki (that nobody reads anyways) could also
use some marketing fixes.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Database engine bindings for Python (was: Database statements via python but database left intact)

2013-10-06 Thread ChrisKwpolskaWarrick
Reposting what I said in the other thread:

On Sun, Oct 6, 2013 at 12:51 AM, Chris Angelico  wrote:
> On Sun, Oct 6, 2013 at 8:39 AM, Ned Batchelder  wrote:
>> Now is a good time to go read about transactions, and committing, and the
>> difference between MyISAM and InnoDB.  Please don't ask more about it here.
>
> It's because of threads like this that I would really like Python to
> nudge people towards something stronger than MySQL. Would it kill
> Python to incorporate PostgreSQL bindings automatically?

It would require Postgres around people’s (or at least packagers’)
systems, and it often gets messy when we have such requirements.
Psycopg2, the most popular binding, is licensed under LGPL3 + Zope (or
such, there is a little mess here) which MAY pose a problem (IANAL
though).  Also, Postgres is much harder to configure than MySQL,
especially if you have no experience or an asshole OS.  Moreover, the
stdlib is where packages come to die.

So, instead of this, maybe we should work on getting psycopg2 to the
top result on Googling “python sql”, or even “python mysql” with an
anti-MySQL ad? (like vim was doing some time ago on Googling “emacs”)

We should also educate people on how PostgreSQL works with a nice,
human-friendly tutorial.  Especially in some non-standard things and
things that differ between PostgreSQL and MySQL — like how to make an
auto-incrementing ID field (use sequences), or how PostgreSQL arrays
work, among others.  The wiki (that nobody reads anyways) could also
use some marketing fixes.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Database statements via python but database left intact

2013-10-06 Thread ChrisKwpolskaWarrick
On Sun, Oct 6, 2013 at 1:36 PM, rusi  wrote:
> On Sunday, October 6, 2013 2:35:24 PM UTC+5:30, Chris “Kwpolska” Warrick 
> wrote:
>> So, instead of this, maybe we should work on getting psycopg2 to the
>> top result on Googling “python sql”, or even “python mysql” with an
>> anti-MySQL ad? (like vim was doing some time ago on Googling “emacs”)
>
> Do you have any accessible data about this?
> Reasons I ask:
> 1. The decreasing popularity of emacs wrt vi seems out of proportion to the 
> actual functionality
> 2. The downward emacs-curve is all the more striking considering the reverse 
> situation some 15-20 years ago

I have a screenshot:
https://dl.dropboxusercontent.com/u/1933476/screenshots/emacs.png —
Dropbox claims it was taken at around 2011-03-19T11:32:24Z.  Earlier
today, the exact same ad appeared while searching for “vim”, but not
“emacs” (why bother when you are the first hit for this query
anyways?).

Now, for statistics, how many hits it got, or whatnot — go ask the Vim
developers.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Image manipulation

2013-10-06 Thread ChrisKwpolskaWarrick
On Sun, Oct 6, 2013 at 3:19 PM,   wrote:
> Image consists of pixels. Each pixel has its RGBA values. In python whidout 
> any extra downloadable modules, is there a way to get those values. I know 
> PIG has it but i hav Python 3.3.2 so PIG wont do.

PIG?  Did you mean PIL?  In that case, go use Pillow, the Python
3-compatible fork.
-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Mysql's mysql module

2013-10-07 Thread ChrisKwpolskaWarrick
On Oct 7, 2013 9:36 PM, "Duncan Booth"  wrote:
>
> Skip Montanaro  wrote:
>
> > On Mon, Oct 7, 2013 at 1:08 PM, Tobiah  wrote:
> >> I just noticed this:
> >>
> >>
> >> http://dev.mysql.com/doc/connector-python/en/index.html
> >
> > * Does it adhere to the Python database API?
> > http://www.python.org/dev/peps/pep-0249/
> >
> > * Is source available?
> >
> > * Does it have a reasonable open source license?
> >
> > These questions come immediately to mind because at work we briefly
> > considered, then rejected, a similar offering from the Sybase folks
> > for connecting to (big surprise) Sybase. We never needed to ask the
> > first and third questions, because the answer to the second was, "no",
> > and they only offered a version built against Python 2.6. Since we use
> > Python 2.4 and 2.7, that was an immediate nonstarter.
> >
> > Skip
>
> Based on a quick look at the link given, I think the answers to questions
1
> and 3 are yes and no respectively. No idea about #2.

Number two is "yes", unless there are deceptive statements on that page.
>
> --
> Duncan Booth http://kupuguy.blogspot.com
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread ChrisKwpolskaWarrick
On Thu, Oct 10, 2013 at 4:37 PM, Skip Montanaro  wrote:
> Thanks. "disabled" did the trick. Turns out you can't disable
> individual items. Instead, you have to (hackishly) change the display
> of entries somehow to indicate their inappropriateness...

Removing inappropriate entries is not much of a hack.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OT: looking for best solutions for tracking projects and skills

2013-10-13 Thread ChrisKwpolskaWarrick
On Sun, Oct 13, 2013 at 8:40 PM, Jason Friedman  wrote:
> I highly recommend JIRA, free for non-profit use:
> https://www.atlassian.com/software/jira.

As usual, the free version is hidden and available only on request:
https://www.atlassian.com/software/views/open-source-license-request

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: indentation blocking in Python

2013-10-27 Thread ChrisKwpolskaWarrick
On Sun, Oct 27, 2013 at 4:31 PM,   wrote:
> hello all,
>
> This has got me a tad bit confused I think.  I am running 3.3.0 and I know 
> that Python looks to group code together that is supposed to be in the same 
> block.  But the question is, where are the rules for this?  For instance, if 
> I type the following in a PY file, it errors out and I don't see the DOS 
> window with the output in Vista:

It’s called the command prompt.
> a=1;
>if a==1: print(1)
>else: print(0)
> wait = input("press key")
>
> However, if I don't indent anything at all, it works!
>
> a=1;
> if a==1: print(1)
> else: print(0)
> wait = input("press key")

You indented the wrong thing.  You put your if/else statement in a
non-standard way (which works, but is discouraged).  Also, you ended
the first line with a semicolon (same case).  So, the proper code
would be:

a=1
if a==1:
print(1)
else:
print(0)
wait = input("press key")

(I resisted the urge to add spaces around `=` and `==`, something most
people want you to do.)

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread ChrisKwpolskaWarrick
On Thu, Oct 31, 2013 at 10:31 AM, E.D.G.  wrote:
> Posted by E.D.G. on October 31, 2013
>
>   The following are several relatively basic questions regarding
> Python's capabilities.  I am not presently using it myself.  At the moment a
> number of people including myself are comparing it with other programs such
> as XBasic for possible use.
>
> 1.  How fast can Python do math calculations compared with other languages
> such as Fortran and fast versions of Basic.  I would have to believe that it
> is much faster than Perl for doing math calculations.

Depends on what do you want to calculate.  Also, note that Python is
liked by the scientific community to use for calculations.  This might
be a hint.

> 2.  Can Python be used to create CGI programs?  These are the ones that run
> on Internet server computers and process data submitted through Web site
> data entry screens etc.  I know that Perl CGI programs will do that.

Yes.  Although most people in the Python community dislike the
old-style “CGI” and use “web apps” instead.  They are also connected
with a different philosophy, for example we do not store .py files in
/cgi-bin/, we never expose our .py files and put it somewhere else on
the system and let the web server act as a proxy to a WSGI server
(gunicorn/uwsgi).

> 3.  If Python can be used for CGI programming, can it draw charts such as
> .png files that will then display on Web pages at a Web site?

Yes, but you need to install additional libraries for that.

> 4.  How well does Python work for interactive programming.  For example, if
> a Python program is running on a PC and is drawing a chart, can that chart
> be modified by simply pressing a key while the Python program is running.  I
> have Perl and Gnuplot program combinations that can do that.  Their
> interactive speed is not that great.  But it is adequate for my own uses.

Doable, but I cannot give you any information on the speed.

> 5.  Can a running Python program send information to the Windows operating
> system as if it were typed in from the keyboard?  Perl can do that and I
> would imagine that Python probably has that same capability.

Definitely possible, but might take you a bit of work and knowledge of
Windows internals (go ask Google).

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread ChrisKwpolskaWarrick
On Thu, Oct 31, 2013 at 11:38 AM, E.D.G.  wrote:
> Posted by E.D.G. October 31, 2013

no need to write that.

>
> Hi Chris,
>
>   Thanks for the responses. Several of my questions were answered.
>
>   The calculation speed question just involves relatively simple math
> such as multiplications and divisions and trig calculations such as sin and
> tan etc. Presently I am using Perl to do those types of calculations. And I
> am starting to run into problems with how long it takes Perl to do thousands
> and even millions of calculations like that even though they are relatively
> simple.

I suggest that you try Python out yourself, on your data.  I can’t

>   The version of Perl that I am presently using has the usual Print
> statements for printing to the Perl program window.  It sends Windows
> programs or files information in the following manner:
>
> Win32::GuiTest::SendKeys("The text within these two parentheses marks will
> print as text in an active Notepad window.");
>
>   It would be my guess that Python has some type of statement like that.
>

Looks like you want something like [0] (requires pywin32 from [1]).

[0]: http://win32com.goermezer.de/content/view/136/254/
[1]: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: To whoever hacked into my Database

2013-11-07 Thread ChrisKwpolskaWarrick
On Thu, Nov 7, 2013 at 3:58 PM, Neil Cerutti  wrote:
> On 2013-11-07, Chris Angelico  wrote:
>> (Please don't start your text with a double-hyphen - that's a common
>> convention for the start of your signature, and many people and UAs
>> will ignore text after it.)
>
> It's '-- ', with a space after, to be precise.

To be even more precise, it’s those three characters on a line all by itself.

> But I like it the way he's doing it! His messages are greatly
> improved from where I'm sitting..

Gmail automatically hides all longer quotes (Google Groups does the
same, so they don’t get to see their double-spaced nonsense) AS WELL
AS signatures.  Well, world couldn’t be more wonderful than Nikos
posting nothing.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Immediate requirement - Sr. Business Analyst for Pricewaterhouse Coopers (PwC) in Tampa, FL.

2013-11-07 Thread ChrisKwpolskaWarrick
On Thu, Nov 7, 2013 at 8:45 PM,   wrote:
> Hi,
>
> Immediate requirement - Sr. Business Analyst for Pricewaterhouse Coopers 
> (PwC) in Tampa, FL.
> [snip]
> https://mail.python.org/mailman/listinfo/python-list

This is a Python list.  You ARE NOT hiring Python programmers.
Moreover, this list/newsgroup IS NOT the valid place for job offers,
Python or otherwise.  Please stop sending them.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: To whoever hacked into my Database

2013-11-10 Thread ChrisKwpolskaWarrick
On Nov 10, 2013 9:01 PM, "Rod Person"  wrote:
> Tortoise? What's a tortoise?
Is that a real question? If yes, then it's an animal, similar to a turtle.
Ask Google or Wikipedia for more details.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Install Tkinter for Windows 7 64-bit

2013-11-11 Thread ChrisKwpolskaWarrick
On Mon, Nov 11, 2013 at 5:38 PM,   wrote:
> But i have no luck runn the Tkinter example file i downloaded in idel, it 
> still says no module called Tkinter.
IDLE*
> ===
> Traceback (most recent call last):
>   File "D:\Python33\test2.py", line 16, in 
> from Tkinter import Tk, Canvas, Frame, BOTH
> ImportError: No module named 'Tkinter'
> ===

In Python 3, 'Tkinter' was renamed to 'tkinter' (both sans quotes).
Please change the file to reflect that (as the traceback points out,
line 16).

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: can I get 0./0. to return nan instead of exception?

2014-06-19 Thread ChrisKwpolskaWarrick
On Thu, Jun 19, 2014 at 1:31 PM, Joel Goldstick
 wrote:
>
> On Jun 19, 2014 7:05 AM, "Neal Becker"  wrote:
>>
>> Can I change behavior of py3 to return nan for 0./0. instead of raising an
>> exception?
>
> There is no nan in python.

Wrong:

>>> float('nan')
nan
>>>

also:

https://docs.python.org/2/library/math.html#math.isnan

> Check if the float x is a NaN (not a number). For more information on NaNs, 
> see the IEEE 754 standards.

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: What can Nuitka do?

2014-06-28 Thread ChrisKwpolskaWarrick
On Sat, Jun 28, 2014 at 7:40 AM, CM  wrote:
> I'm confused as to why it's not just a .py file.

On Linux, the `nuitka` script would be run.  Things in $PATH tend not
to have an extension, and you don’t need one to run Python.  (you
can’t import files that don’t end in .py, though)

> The nuitka.bat, aside from some remarks, is this:
>
> @echo off
> setlocal
>
> "%~dp0..\python" "%~dp0nuitka" %*
>
> endlocal
>

This is a very fancy way of running Nuitka in the local python
interpreter, with all the arguments.  For example, this:

C:\Python27\Scripts\nuitka.bat foo bar

will make the script run:

C:\Python27\python C:\Python27\Scripts\nuitka foo bar

This is to make Windows users’ life easier, to provide them
executables that work just as `nuitka` (and not `nuitka.py`).
However, a more modern method than the one used here is setuptools
entrypoints, which produces a nicer .exe file.

--
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: why i can't install ez_setup

2014-06-28 Thread ChrisKwpolskaWarrick
On Sat, Jun 28, 2014 at 1:49 PM, 水静流深 <1248283...@qq.com> wrote:
> I have downloaoded ez_setup.py ,when i install it ,the wrong message:
>
>>python  d:\ez_setup.py
> Downloading
> https://pypi.python.org/packages/source/s/setuptools/setuptools-5.2.
> zip
> Exception calling "DownloadFile" with "2" argument(s): "Unable to connect to
> th
> e remote server"
> At line:1 char:152
> + [System.Net.WebRequest]::DefaultWebProxy.Credentials =
> [System.Net.Credential
> Cache]::DefaultCredentials; (new-object System.Net.WebClient).DownloadFile
> <<<<
>  ('https://pypi.python.org/packages/source/s/setuptools/setuptools-5.2.zip',
> 'C
> :\\Users\\pengsir\\setuptools-5.2.zip')
> + CategoryInfo  : NotSpecified: (:) [],
> MethodInvocationException
> + FullyQualifiedErrorId : DotNetMethodException
>
> Traceback (most recent call last):
>   File "d:\ez_setup.py", line 332, in 
> sys.exit(main())
>   File "d:\ez_setup.py", line 327, in main
> downloader_factory=options.downloader_factory,
>   File "d:\ez_setup.py", line 287, in download_setuptools
> downloader(url, saveto)
>   File "d:\ez_setup.py", line 192, in download_file_powershell
> _clean_check(cmd, target)
>   File "d:\ez_setup.py", line 169, in _clean_check
> subprocess.check_call(cmd)
>   File "d:\Python27\lib\subprocess.py", line 540, in check_call
> raise CalledProcessError(retcode, cmd)
> subprocess.CalledProcessError: Command '['powershell', '-Command',
> "[System.Net.
> WebRequest]::DefaultWebProxy.Credentials =
> [System.Net.CredentialCache]::Default
> Credentials; (new-object
> System.Net.WebClient).DownloadFile('https://pypi.python
> .org/packages/source/s/setuptools/setuptools-5.2.zip',
> 'C:Userspengsir\\
> \\setuptools-5.2.zip')"]' returned non-zero exit status 1
>
> what is wrong with it?

Either (a) pypi, or (b) you were offline when trying to install.

Also, you generally want to use get-pip.py instead, it will also get
you pip in addition to setuptools:

https://bootstrap.pypa.io/get-pip.py

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PEP8 and 4 spaces

2014-07-04 Thread ChrisKwpolskaWarrick
On Thu, Jul 3, 2014 at 7:31 PM, Tobiah  wrote:
> Anyway, I gave up the 80 char line length long
> ago, having little feeling for some dolt on
> a Weiss terminal that for some reason needs to
> edit my code.

And yet, you did not give up an even more insane line length limit, in
e-mail.  The longest line in your original message is a measly 57
characters long.  The median line length is 46 characters.  Which is
pretty insane, and ultra-hard to read.  You can do more in e-mail.

> Each line of characters MUST be no more than 998 characters, and
> SHOULD be no more than 78 characters, excluding the CRLF.

That's the standard, [RFC 5322][]; the exact same quote appeared back
in [RFC 2822][].  However, many places actually want you to use a bit
less; common values include 70 or 72.  But still, it is MUCH more
roomy and readable than the value you use.

Here are the line lengths in the original message:

[47, 45, 45, 46, 46, 47, 45, 5, 46, 43, 46, 47, 47, 49, 31, 57, 52,
 34, 42, 23]

[RFC 5322]: http://tools.ietf.org/html/rfc5322#section-2.1.1
[RFC 2822]: http://tools.ietf.org/html/rfc2822#section-2.1.1

-- 
Chris “Kwpolska” Warrick <http://kwpolska.tk>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What does (A ``quote'' is the character used to open the string, i.e. either ' or ".) mean?

2014-07-10 Thread ChrisKwpolskaWarrick
On Thu, Jul 10, 2014 at 4:04 PM, fl  wrote:
> Hi,
>
> For me, it is difficult to understand the last line of the paragraph below in
> parenthesis (A ``quote'' is the character used to open the string,
> i.e. either ' or ".)
>
> It talks about triple-quoted strings. Where is ``quote'' from? It has two ` 
> and '.
> What this different ` and ' do for here?
>
> The link is here:
> https://docs.python.org/2.0/ref/strings.html
>
> Thank you for helping me to learn Python.

Please don’t learn from this link.  It’s from 2001.  You should learn
from modern documentation: https://docs.python.org/ (if not running
3.4.x, change the version in the top)

You also should not read the language reference, it’s meant for people
who really care about what’s under the hood.  The official tutorial is
better for learning: https://docs.python.org/3/tutorial/index.html

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I am confused about ' and "

2014-07-10 Thread ChrisKwpolskaWarrick
On Jul 10, 2014 7:53 PM, "fl"  wrote:
>
> Hi,
>
> It is still in the Regular expression operations concept, this link:
>
> has example using single quote mark: '
>
> https://docs.python.org/2/library/re.html#re.split
>
>
> While in this link:
>
> https://docs.python.org/3/howto/regex.html
>
>
> It gives table with quote: "
>
> Regular String  Raw string
> "ab*"   r"ab*"
> "section"   r"\\section"
> "\\w+\\s+\\1"   r"\w+\s+\1"
>
>
> and link:
>
> https://docs.python.org/2/library/re.html
>
>
> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
>
>
> Please tell me because I have looked it around for one hour about it.
>
> Thanks,
> --
> https://mail.python.org/mailman/listinfo/python-list

Both characters (' and ") are interchangeable, the only difference
being the one you need to escape if you want to use in a string:
"you're" vs 'you\'re', and the other way around.

Also, please read the Python tutorial[0] before getting into bigger
things, and please don’t mix documentation versions.  If you were to
read the tutorial, you’d quickly find out, that

> 3.1.2. Strings
>
> Besides numbers, Python can also manipulate strings, which can be
> expressed in several ways. They can be enclosed in single quotes
> ('...') or double quotes ("...") with the same result [2]. \ can be
> used to escape quotes.
>
> [snip]
>
> [2] Unlike other languages, special characters such as \n have the
> same meaning with both single ('...') and double ("...") quotes.
> The only difference between the two is that within single quotes
> you don’t need to escape "(but you have to escape \') and vice
> versa.


[0]: https://docs.python.org/2/tutorial/index.html

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3 is killing Python

2014-07-16 Thread ChrisKwpolskaWarrick
A little more off-topic:

On Wed, Jul 16, 2014 at 3:57 AM, MRAB  wrote:
> On 2014-07-16 00:53, Rick Johnson wrote:
>> Some folks even have software that "blabs" about how great a job it
>> is doing […], so if you see […] some pretentious line
>> about "this was sent from my i-phone" -- send that crap to the
>> bitbucket!
>>
> "This was sent from my iPhone" == "I have an iPhone!"

I personally parse those lines as “sent from my iPhone, which has an
on-screen touch keyboard, and it’s harder to type on it”.

> Also annoying is some footnote that says that the email contains
> confidential information and that if you're not the intended recipient
> you should delete it, etc.
>
> That's somewhat pointless if it's being sent to a public forum!

Corporate lawyers for the win!  99.9% of people who send e-mail with
this line are forced to do so by their corporation’s legal department.

Also, the correct solution for all those is getting a sane client that
can hide quotes and signatures.  Like Gmail (which defaults to
top-posting, but fixing this is one click per message away*).  And if
someone brings the “people need to download it anyway” argument: it’s
2014, people: hard-drives are large nowadays (or you can just use
IMAP) and if you’re paying $100 per kilobyte, you’re doing it wrong
and should not be online in the first place.

* trickier on mobile, though.

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I am stuck on OOP

2014-07-18 Thread ChrisKwpolskaWarrick
On Fri, Jul 18, 2014 at 1:40 PM, Nicholas Cannon
 wrote:
> Just quickly i am quite stuck on OOP and i really need like a good video and 
> i cant find any. If anyone knows any please link it i really need it because 
> i know OOP is important.

> video

There’s your problem: video tutorials are the most evil invention of
the human race.  It’s hard to learn from them.  You should not watch
any — use text tutorials instead.

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.4.1 64 bit Version

2014-07-18 Thread ChrisKwpolskaWarrick
On Fri, Jul 18, 2014 at 3:29 PM,   wrote:
> The version given on Python.org is "Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 
> 2014, 10:45:13) [MSC v.1600 64 bit (AMD64)] on win32".
>
> This question is prompted by difficulties installing PyScripter.  What does 
> "on win32" mean in the above.  I was using PyScripter on an AMD64 processor 
> with Python 2.7.  Now, with an attempt to move to Python 3, I have grief.
>
> How does one install "python-3.4.1.amd64-pdb"?
>
> I would welcome any advice.
>
> Thanks,
>
> Colin W.
> --
> https://mail.python.org/mailman/listinfo/python-list

“win32” is the name given to the Windows API as of Windows NT 3.1 and
Windows 95.  The “AMD64” part in parentheses tells the truth, that
you’re actually running the 64-bit version (which can cause problems,
though — it’s better to use the 32-bit version, IMO)

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: I am stuck on OOP

2014-07-18 Thread ChrisKwpolskaWarrick
On Jul 18, 2014 8:36 PM, "Steven D'Aprano" <
steve+comp.lang.pyt...@pearwood.info> wrote:
> I would normally agree with you about
> text being better than video, but I watched a video explaining git and it
> made much more sense than anything I've read.

Yes, exceptions do exist. But most video tutorials are produced by people
without enough knowledge, and people that should not be working on
educational material. This is especially visible in videos about basic
things: they can be produced by just about anyone with a microphone — which
never leads to anything good. (In order to be more precise, I'd have to be
politically incorrect.)

-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
Sent from my SGS3.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 3.4.1 64 bit Version

2014-07-18 Thread ChrisKwpolskaWarrick
On Fri, Jul 18, 2014 at 3:54 PM, Zachary Ware
 wrote:
> On Fri, Jul 18, 2014 at 8:48 AM, Chris “Kwpolska” Warrick
>  wrote:
>> “win32” is the name given to the Windows API as of Windows NT 3.1 and
>> Windows 95.  The “AMD64” part in parentheses tells the truth, that
>> you’re actually running the 64-bit version (which can cause problems,
>> though — it’s better to use the 32-bit version, IMO)
>
> What problems have you run into with the 64-bit version?  The only
> issues I've had have been my own problems with installing some
> versions as 32-bit and others as 64, and forgetting which was which.

This is one of the issues: you can easily mess up 32-bit and 64-bit,
and not even notice that (AppVeyor had an issue with that lately —
they switched python to 64 but left VC++ as 32).

It’s also slightly easier to find pre-made binaries for 32-bit than
64-bit.  In general, life in 64-bits on Windows is kinda hard, for
everyone involved.


-- 
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >