Just installed python and it says python34.dll is missing

2015-10-07 Thread Lisa Twede
I tried re-downloading python and it gave me an option to repair, so I tried 
that.  But it still throws the same error.

I downloaded Python 3.5.0 for Windows.
Lisa Twede
Staff Software Developer
Products

[email protected]
PHONE (818) 955-4311
FAX
[Entertainment Partners: an employee owned company]

Disclaimer - October 6, 2015

This email and any attachments are confidential and intended solely for 
[email protected]. If you are not a named addressee you are prohibited 
from reviewing, printing, disseminating, distributing, copying or altering this 
email or any part of it. If you have received this communication in error, 
please notify the sender of the error immediately, do not read or use the 
communication in any manner, destroy all copies, and delete it from your system 
if the communication was sent via email. Warning: Although Entertainment 
Partners has taken reasonable precautions to ensure no viruses are present in 
this email, the recipient is responsible for checking for and deleting viruses. 
Entertainment Partners does not accept responsibility for any loss or damage 
arising from the use of this email or attachments.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Windows 32-bit Python 3.5 Install Failure

2015-10-07 Thread Chris Angelico
On Wed, Oct 7, 2015 at 9:39 AM, Ben Thompson  wrote:
> My guess is that what is advertised as a 32-binary installer actually
> installed a 64-bit version (because the error message described above is
> what I get if I try and run a 64-bit binary). To check that I had not
> accidentally downloaded the wrong installer I checked: I downloaded and ran
> python-3.5.0.exe not python-3.5.0-amd64.exe.

Actually, the problem is that Windows XP can't handle Python 3.5. You
should be able to use 3.4, or alternatively, upgrade to Windows 7/8/10
(or Xubuntu or anything else...). There's an open tracker issue to
make the message a bit clearer:

http://bugs.python.org/issue25143

but ultimately, this isn't going to be supported, ever.

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


Re: Just installed python and it says python34.dll is missing

2015-10-07 Thread Chris Angelico
On Wed, Oct 7, 2015 at 2:39 AM, Lisa Twede  wrote:
>
> I tried re-downloading python and it gave me an option to repair, so I tried 
> that.  But it still throws the same error.
>
>
>
> I downloaded Python 3.5.0 for Windows.

Exactly what did you install, on what system, and what's throwing the
error? From the sound of things, something's looking for Python 3.4,
but you have 3.5 installed.

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


Re: Finding Blank Columns in CSV

2015-10-07 Thread Peter Otten
Peter Otten wrote:

> I really meant it when I asked you to post the code you actually ran, and
> the traceback it produces.

Anyway, here's a complete script that should work. It uses indices instead 
names, but the underlying logic is the same.

#!/usr/bin/env python
import csv
import sys
from contextlib import contextmanager


if sys.version_info.major == 3:
READ_MODE = "r"
WRITE_MODE = "w"
else:
READ_MODE = "rb"
WRITE_MODE = "wb"


@contextmanager
def ext_open(file, mode):
"""Open a file if passed a string, pass on everything else unchanged.

"-", b"-", and None indicate stdin or stdout depending on `mode`.

>>> with ext_open(None, "w") as f:
... print("foo", file=f)
foo
>>> with ext_open(["one\\n", "two\\n"], "r") as f:
... for line in f: print(line, end="")
one
two
"""
if file is None or file == "-" or file == b"-":
yield sys.stdout if "w" in mode else sys.stdin
elif isinstance(file, (str, bytes)):
with open(file, mode) as stream:
yield stream
else:
yield file


def non_empty_columns(infile):
"""Find indices of columns that contain data.

Doesn't check the first row assumed to contain the fieldnames.
"""
with ext_open(infile, READ_MODE) as instream:
reader = csv.reader(instream)
colcount = len(next(reader))
empty_columns = set(range(colcount))
for row in reader:
assert len(row) == colcount
empty_columns = {i for i in empty_columns if not row[i]}
if not empty_columns:
break
return [i for i in range(colcount) if i not in empty_columns]


def copy_csv(infile, outfile, columns):
"""Copy the specified columns from infile to outfile.
"""
with ext_open(infile, READ_MODE) as instream:
with ext_open(outfile, WRITE_MODE) as outstream:
reader = csv.reader(instream)
writer = csv.writer(outstream)
for row in reader:
writer.writerow([row[i] for i in columns])


def main():
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("infile", nargs="?", default=sys.stdin)
parser.add_argument("outfile", nargs="?", default=sys.stdout)
args = parser.parse_args()

if args.infile is sys.stdin or args.infile == "-":
args.infile = list(sys.stdin)

copy_csv(
args.infile, args.outfile,
columns=non_empty_columns(args.infile))


if __name__ == "__main__":
main()


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


Re: Pyserial and Ubuntu Linux kernel 3.13.0-65-generic

2015-10-07 Thread Dave Farrance
Rob Gaddi  wrote:

>So, this is odd.  I'm running Ubuntu 14.04, and my system did a kernel 
>upgrade from the repository from 3.13.0-63-generic to 3.13.0-65-generic.  
>And pyserial (2.7, installed through pip) stopped working.

When KDE's "Plasma 5" appeared with Kubuntu 15.04, I found it to be too
new and have too many dysfunctions, so I reverted to Kubuntu 14.04 LTS.

Now this problem.  Looking at the Ubuntu 14.04 repository, I found that
it contained a backported version of the kernel used in 15.04.  So...

Remove "meta" packages that have latest 3.13 kernel as dependencies:

sudo apt-get purge linux-generic linux-signed-generic

Install meta packages that pull in the latest 3.19 kernel:

sudo apt-get install linux-generic-lts-vivid
  linux-signed-generic-lts-vivid

Serial now works fine. The later kernel introduces no functional changes
in (K)ubuntu 14.04 that I can discern.  I presume that since it is a
"backported" version of the 3.19 kernel, that its video drivers have
been matched to Ubuntu 14.04's version of X.Org, and so on.

Anyway, that's what works for me. I could've put a "hold" on the
3.13.0-63 kernel, but this seems a better fix.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: reg multiple login python

2015-10-07 Thread harirammanohar159
On Thursday, 1 October 2015 12:35:01 UTC+5:30, [email protected]  wrote:
> Hi All,
> 
> Is there anyway i can login to remote servers at once and do the activity, i 
> can do one by one using for loop..
> 
> Thanks in advance.

how to handle this ? any one pls help...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Windows 32-bit Python 3.5 Install Failure

2015-10-07 Thread Laura Creighton
In a message of Tue, 06 Oct 2015 23:39:19 +0100, Ben Thompson writes:
>Hi,
>
>I just tried using the 32-bit Python 3.5 installer for Windows from 
>python.org. The program seemed to run OK, I ticked the path box but 
>there seems to be no working python 3.5 on my (32-bit, XP) computer. The 
>screenshot shows that python 2.7 is still installed, path contains 
>Python 3 (albeit it a weird place) but if I give the full path to what I 
>assume is the Python 3.5 binary, I get a window telling me that the 
>program is not a valid application.
>
>My guess is that what is advertised as a 32-binary installer actually 
>installed a 64-bit version (because the error message described above is 
>what I get if I try and run a 64-bit binary). To check that I had not 
>accidentally downloaded the wrong installer I checked: I downloaded and 
>ran python-3.5.0.exe not python-3.5.0-amd64.exe.

Your problem is that 3.5 does not run on XP at all.  There is a bug
fix going in to tell XP users this when they try to install 3.5 and
later.  python.org has given up support of XP for 3.5 and later releases.

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


Hiding code from intruders, a different slant on an old question

2015-10-07 Thread cl
I know questions similar to this are often asked but my reasons for
wanting to do this (and thus ways it can be done) are slightly different.

I have a number of little utility scripts (python and others) which I
use to automate the process of decrypting and displaying things like
files containing passwords.  

The encryption I use is reasonably secure anyway but I'd like to hide
the programs/methods I use so that:-

1 - The encrypted files are not identifiable as encrypted data (the file
command just returns 'data' so they can't be identified by that).  If
there's a script in my ~/bin directory that relates directly to the
files it's obvious they're encrypted.

2 - The method used for encryption isn't obvious, again an obvious
script will show the program I have used.


I *could* write a C program which just exec()'s the required programs,
if they're done separately this would be fairly well hidden but I was
wondering if there's anything more obvious I can do that enables me to
do things easily in Python.


This is for protecting against any possible intruder who has gained
access to my system by breaking an ssh password or stealing my laptop
for example.  It's *not* for hiding code that I'm giving to others,
I'd be quite happy to give the code in question to people who might
want to use it.

-- 
Chris Green
·
-- 
https://mail.python.org/mailman/listinfo/python-list


certifi or tornadoweb broken? What is happening here?

2015-10-07 Thread Nagy László Zsolt
Here is an MWE:

import certifi
import tornado.ioloop
import tornado.httpclient

io_loop = tornado.ioloop.IOLoop.current()

def test():
global io_loop
url =
"https://www.saaspass.com/sd/rest/applications/x/tokens?password=x";
# Just a test application!
http_client = tornado.httpclient.HTTPClient()
request = tornado.httpclient.HTTPRequest(url = url, method = "GET",
ca_certs=certifi.where())
response = http_client.fetch(request)
print(response.body)



print("Certifi version:",certifi.__version__)

io_loop.add_callback(test)
io_loop.start() # forgive me, will never stop, but this is just a test


Here is what happens on Windows 7:

c:\Temp\aaa>py -3 test.py
Certifi version: 2015.09.06.2
ERROR:tornado.application:Exception in callback
functools.partial(.null_wrapper at 0x033AC598>)
Traceback (most recent call last):
  File "C:\Python35\lib\site-packages\tornado\ioloop.py", line 592, in
_run_call
back
ret = callback()
  File "C:\Python35\lib\site-packages\tornado\stack_context.py", line
275, in nu
ll_wrapper
return fn(*args, **kwargs)
  File "test.py", line 12, in test
response = http_client.fetch(request)
  File "C:\Python35\lib\site-packages\tornado\httpclient.py", line 102,
in fetch

self._async_client.fetch, request, **kwargs))
  File "C:\Python35\lib\site-packages\tornado\ioloop.py", line 445, in
run_sync
return future_cell[0].result()
  File "C:\Python35\lib\site-packages\tornado\concurrent.py", line 215,
in resul
t
raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
tornado.httpclient.HTTPError: HTTP 400: Bad Request

And here is what happens on Ubuntu:

test@vps014:~$ python3 test.py
Certifi version: 2015.09.06.2
WARNING:tornado.general:SSL Error on 9 ('104.154.49.147', 443): [Errno
1] _ssl.c:392: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
ERROR:tornado.application:Exception in callback
functools.partial()
Traceback (most recent call last):
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/ioloop.py",
line 592, in _run_callback
ret = callback()
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/stack_context.py",
line 275, in null_wrapper
return fn(*args, **kwargs)
  File "test.py", line 12, in test
response = http_client.fetch(request)
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/httpclient.py",
line 102, in fetch
self._async_client.fetch, request, **kwargs))
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/ioloop.py",
line 445, in run_sync
return future_cell[0].result()
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/concurrent.py",
line 215, in result
raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/stack_context.py",
line 314, in wrapped
ret = fn(*args, **kwargs)
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/gen.py",
line 212, in 
future, lambda future: callback(future.result()))
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/concurrent.py",
line 215, in result
raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/gen.py",
line 876, in run
yielded = self.gen.throw(*exc_info)
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/tcpclient.py",
line 174, in connect
server_hostname=host)
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/gen.py",
line 870, in run
value = future.result()
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/concurrent.py",
line 215, in result
raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
  File
"/usr/local/lib/python3.2/dist-packages/tornado-4.2.1-py3.2-linux-x86_64.egg/tornado/iostream.py",
line 1243, in _do_ssl_handshake
self.socket.do_handshake()
  File "/usr/lib/python3.2/ssl.py", line 458, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [Errno 1] _ssl.c:392: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed


The certifi package has the very same version on both systems. I have
compared the cacert.pem file provided by certifi on both systems and
they are identical. The URL is also identical.

What is happening here? How it is possible that the Ubuntu system gives
an SSL handshake error, but the Windows system does the SSL handshake -
using the same CA cert list?

Thanks

   Laszlo

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


Re: Finding Blank Columns in CSV

2015-10-07 Thread Jaydip Chakrabarty
On Tue, 06 Oct 2015 20:20:40 +0200, Peter Otten wrote:

> Jaydip Chakrabarty wrote:
> 
>> On Tue, 06 Oct 2015 14:33:51 +0200, Peter Otten wrote:
>> 
>>> Jaydip Chakrabarty wrote:
>>> 
 On Tue, 06 Oct 2015 01:34:17 +1100, Chris Angelico wrote:
 
> On Tue, Oct 6, 2015 at 1:06 AM, Tim Chase
>  wrote:
>> That way, if you determine by line 3 that your million-row CSV file
>> has no blank columns, you can get away with not processing all
>> million rows.
> 
> Sure, although that effectively means the entire job is moot. I
> kinda assume that the OP knows that there are some blank columns
> (maybe lots of them). The extra check is unnecessary unless it's
> actually plausible that there'll be no blanks whatsoever.
> 
> Incidentally, you have an ordered_headers list which is the blank
> columns in order; I think the OP was looking for a list of the
> _non_blank columns. But that's a trivial difference, easy to tweak.
> 
> ChrisA
 
 Thanks to you all. I got it this far. But while writing back to
 another csv file, I got this error - "ValueError: dict contains
 fields not in fieldnames: None". Here is my code.
 
 rdr = csv.DictReader(fin, delimiter=',')
 header_set = set(rdr.fieldnames)
 for r in rdr:
 header_set = set(h for h in header_set if not r[h])
 if not header_set:
 break
 
 for r in rdr:
 data = list(r[i] for i in header_set)
 
 dw = csv.DictWriter(fout, header_set)
 dw.writeheader()
 dw.writerows(data)
>>> 
>>> Sorry, this is not the code you ran. I could guess what the missing
>>> parts might be, but it is easier for both sides if you provide a small
>>> script that actually can be executed and a small dataset that shows
>>> the behaviour you describe. Then post the session and especially the
>>> traceback. Example:
>>> 
>>> $ cat my_data.csv 0 $ cat my_code.py print
>>> 1/int(open("my_data.csv").read())
>>> $ python my_code.py Traceback (most recent call last):
>>>   File "my_code.py", line 1, in 
>>> print 1/int(open("my_data.csv").read())
>>> ZeroDivisionError: integer division or modulo by zero
>>> 
>>> Don't retype, use cut and paste. Thank you.
>> 
>> I downloaded gmail contacts in google csv format. There are so many
>> columns. So I was trying to create another csv with the required
>> columns.
>> Now when I tried to open the gmail csv file with csv DictReader, it
>> said the file contained NULL characters.
>> So first I did -
>> 
>> data = open(fn, 'rb').read()
>> fout = open(ofn, 'wb')
>> fout.write(data.replace('\x00', ''))
>> fout.close()
>> shutil.move(ofn, fn)
>> 
>> Then I found, there were some special characters in the file. So, once
>> again I opened the file and did -
>> 
>> data = open(fn, 'rb').read()
>> fout = open(ofn, 'wb')
>> fout.write(data.replace('\xff\xfe', ''))
>> fout.close()
>> shutil.move(ofn, fn)
> 
> Uh this looks like the file is in UTF-16. Use
> 
> import codecs fn = ...
> ofn = ...
> with codecs.open(fn, encoding="utf-16") as f:
> with codecs.open(ofn, "w", encoding="utf-8") as g:
> g.writelines(f)
> ...
> 
> to convert it to UTF-8 which is compatible with the csv module of Python
> 2.
> 
>> Now it seemed right.
> 
> Only if all characters are encodable as iso-8859-1.
> 
>> So I started to remove empty columns.
>> 
>> fin = open(fn, 'rb')
>> fout = open(ofn, 'wb')
>> 
>> rdr = csv.DictReader(fin, delimiter=',')
>> flds = rdr.fieldnames header_set = set(rdr.fieldnames)
>> for r in rdr:
>> header_set = set(h for h in header_set if not r[h])
>> if not header_set:
>> break
>> for r in rdr:
>> data = list(r[i] for i in header_set)
>> 
>> dw = csv.DictWriter(fout, data[0].keys())
>> dw.writeheader()
>> dw.writerows(data)
>> 
>> fin.close()
>> fout.close()
>> 
>> But, I am getting error at dw.writerows(data). I put the whole code
>> here.
>> Please help.
> 
> I really meant it when I asked you to post the code you actually ran,
> and the traceback it produces.
> 
> When I fill in the blanks by guessing
> 
> $ cat in.csv one,two,three foo,,
> bar,,baz $ cat remove_empty_colums.py import csv fn = "in.csv"
> ofn = "out.csv"
> 
> fin = open(fn, 'rb')
> fout = open(ofn, 'wb')
> 
> rdr = csv.DictReader(fin, delimiter=',')
> flds = rdr.fieldnames header_set = set(rdr.fieldnames)
> for r in rdr:
> header_set = set(h for h in header_set if not r[h])
> if not header_set:
> break
> for r in rdr:
> data = list(r[i] for i in header_set)
> 
> dw = csv.DictWriter(fout, data[0].keys())
> dw.writeheader()
> dw.writerows(data)
> 
> fin.close()
> fout.close()
> 
> and then run the resulting script I get
> 
> $ python remove_empty_colums.py Traceback (most recent call last):
>   File "remove_empty_colums.py", line 18, in 
> dw = csv.DictWriter(fout, data[0].keys())
> NameError: name 'data' is not defined
> 
> So this is my traceback, and while the NameError is trivial to fix

Re: Hiding code from intruders, a different slant on an old question

2015-10-07 Thread Littlefield, Tyler
On 10/7/2015 5:38 AM, [email protected] wrote:
> I know questions similar to this are often asked but my reasons for
> wanting to do this (and thus ways it can be done) are slightly different.
>
> I have a number of little utility scripts (python and others) which I
> use to automate the process of decrypting and displaying things like
> files containing passwords.  
>
> The encryption I use is reasonably secure anyway but I'd like to hide
> the programs/methods I use so that:-
>
> 1 - The encrypted files are not identifiable as encrypted data (the file
> command just returns 'data' so they can't be identified by that).  If
> there's a script in my ~/bin directory that relates directly to the
> files it's obvious they're encrypted.
>
> 2 - The method used for encryption isn't obvious, again an obvious
> script will show the program I have used.
>

You have two options here:
1) Use a strong encryption like aes256 etc and don't bother trying to
"hide" the code because it's just a blob of data and they'll not crack it.
2) Encrypt the whole drive if you use something like *nix/*bsd.
The only thing hiding the code will do is make them guess at the method.
But if you use a good method in the firstplace, you shouldn't have any
issues because it's not going to be cracked.

> I *could* write a C program which just exec()'s the required programs,
> if they're done separately this would be fairly well hidden but I was
> wondering if there's anything more obvious I can do that enables me to
> do things easily in Python.
>
>
> This is for protecting against any possible intruder who has gained
> access to my system by breaking an ssh password or stealing my laptop
> for example.  It's *not* for hiding code that I'm giving to others,
> I'd be quite happy to give the code in question to people who might
> want to use it.
>


-- 
Take care,
Ty
http://tds-solutions.net
He that will not reason is a bigot; he that cannot reason is a fool; he that 
dares not reason is a slave.

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


Re: Hiding code from intruders, a different slant on an old question

2015-10-07 Thread alister
On Wed, 07 Oct 2015 10:38:37 +0100, cl wrote:

> I know questions similar to this are often asked but my reasons for
> wanting to do this (and thus ways it can be done) are slightly
> different.
> 
> I have a number of little utility scripts (python and others) which I
> use to automate the process of decrypting and displaying things like
> files containing passwords.
> 
> The encryption I use is reasonably secure anyway but I'd like to hide
> the programs/methods I use so that:-
> 
> 1 - The encrypted files are not identifiable as encrypted data (the file
> command just returns 'data' so they can't be identified by that).  If
> there's a script in my ~/bin directory that relates directly to the
> files it's obvious they're encrypted.
> 
> 2 - The method used for encryption isn't obvious, again an obvious
> script will show the program I have used.
> 
> 
> I *could* write a C program which just exec()'s the required programs,
> if they're done separately this would be fairly well hidden but I was
> wondering if there's anything more obvious I can do that enables me to
> do things easily in Python.
> 
> 
> This is for protecting against any possible intruder who has gained
> access to my system by breaking an ssh password or stealing my laptop
> for example.  It's *not* for hiding code that I'm giving to others,
> I'd be quite happy to give the code in question to people who might want
> to use it.

The general rule with all forms of encryption is that the method is not 
secret. it is the key that needs to be kept secret.

in the same way that the mechanical principles of the lock on your front 
door are public knowledge, the profile of the key itself (which is needed 
to unlock the door) is unknown.

Example:

With a simple Cesar the method is "shift the alphabet by 'X' characters 
and X is the key

if the key is unknown then the attacker still has to brute force the 
method (admittedly with only 25 options this is not difficult)



-- 
Down with categorical imperative!
-- 
https://mail.python.org/mailman/listinfo/python-list


change data in large excel file(more than 240 000 rows on sheet)

2015-10-07 Thread gall . pavgal . gall
Hi Guys,
I need to change data in large excel file(more than 240 000 rows on sheet), 
it's possible through win32com.client, but i need use Linux OS ...
Please, could you advise some-thing suitable!

best regards, Pavel.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: change data in large excel file(more than 240 000 rows on sheet)

2015-10-07 Thread Mark Lawrence

On 07/10/2015 15:13, [email protected] wrote:

Hi Guys,
I need to change data in large excel file(more than 240 000 rows on sheet), 
it's possible through win32com.client, but i need use Linux OS ...
Please, could you advise some-thing suitable!

best regards, Pavel.



http://www.python-excel.org/

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: Trouble running

2015-10-07 Thread Denis McMahon
On Mon, 05 Oct 2015 19:06:04 +0100, Cameroni123 ™ wrote:

> Hi I have recently installed python on windows 10 and I’m trying to save
> in order to run the module and I cant I don’t know why, could you please
> help?

Based on the comprehensive problem description I have waved my magic 
wand. It should work now. If it still doesn't work, please provide more 
details about the problem.

-- 
Denis McMahon, [email protected]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: reg multiple login python

2015-10-07 Thread Emile van Sebille

On 10/7/2015 2:24 AM, [email protected] wrote:

On Thursday, 1 October 2015 12:35:01 UTC+5:30, [email protected]  wrote:

Hi All,

Is there anyway i can login to remote servers at once and do the activity, i 
can do one by one using for loop..

Thanks in advance.


how to handle this ? any one pls help...



the best you're likely to do to get them running near simultaneously is 
to launch a detached process for each request.  you could adapt your 
current for loop to do so.


emile


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


Re: certifi or tornadoweb broken? What is happening here?

2015-10-07 Thread Laura Creighton
There is discussion here about problems with ubuntu certificate handling.
https://bugs.python.org/issue23476, with links to ubuntu bugs that
you should read.  No promises that this is your bug, but seems possible.

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


Re: change data in large excel file(more than 240 000 rows on sheet)

2015-10-07 Thread Joel Goldstick
On Wed, Oct 7, 2015 at 10:18 AM, Mark Lawrence 
wrote:

> On 07/10/2015 15:13, [email protected] wrote:
>
>> Hi Guys,
>> I need to change data in large excel file(more than 240 000 rows on
>> sheet), it's possible through win32com.client, but i need use Linux OS ...
>> Please, could you advise some-thing suitable!
>>
>> best regards, Pavel.
>>
>>
> http://www.python-excel.org/
>
> --
> My fellow Pythonistas, ask not what our language can do for you, ask
> what you can do for our language.
>
> Mark Lawrence
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

I agree with Mark's link.  Is there any reason why you can't get these
files as csv?  That would also simplify things
-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Trouble running

2015-10-07 Thread Gene Heskett
On Wednesday 07 October 2015 12:05:08 Denis McMahon wrote:

> On Mon, 05 Oct 2015 19:06:04 +0100, Cameroni123 ™ wrote:
> > Hi I have recently installed python on windows 10 and I’m trying to
> > save in order to run the module and I cant I don’t know why, could
> > you please help?
>
> Based on the comprehensive problem description I have waved my magic
> wand. It should work now. If it still doesn't work, please provide
> more details about the problem.
>
> --
> Denis McMahon, [email protected]

You are a piece of work Dennis, love it. ;-)

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


error installation GR python

2015-10-07 Thread halim hamadi

I want to install GR plot in python using pip, but I receive an error when 
installing GR.

Collecting gr
  Using cached gr-0.16.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "", line 20, in 
  File 
"C:\Users\HALIMH~1\AppData\Local\Temp\pip-build-vhpiefs2\gr\setup.py", line 
200, in 
class check_ext(Command, build_static):
TypeError: Cannot create a consistent method resolution
order (MRO) for bases build_static, Command

Can anyone help please?

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


Re: error installation GR python

2015-10-07 Thread Mark Lawrence

On 08/10/2015 03:32, halim hamadi wrote:


I want to install GR plot in python using pip, but I receive an error when 
installing GR.

Collecting gr
   Using cached gr-0.16.0.tar.gz
 Complete output from command python setup.py egg_info:
 Traceback (most recent call last):
   File "", line 20, in 
   File "C:\Users\HALIMH~1\AppData\Local\Temp\pip-build-vhpiefs2\gr\setup.py", 
line 200, in 
 class check_ext(Command, build_static):
 TypeError: Cannot create a consistent method resolution
 order (MRO) for bases build_static, Command

Can anyone help please?

Thank you.



I can reproduce the above with 3.3, 3.4 and 3.5 whereas 2.7 gives the 
infamous "Unable to find vcvarsall.bat".  That plus taking a look at 
pypi leads to the conclusion is that it's Python 2 only.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Is there a Windows Python SIG?

2015-10-07 Thread Anthony Papillion
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Over the next few months,  I'll be working on a project using Python on 
Microsoft Windows.  While I'm doing this project, I'd also like to contribute 
in any way I can to making Python in Windows better.

Does anyone know if there is a Windows SIG? I went to the Python website where 
I thought I'd seen one but it doesn't seem to be there now. Any thoughts?

Anthony

- --
Phone:  +1.845.666.3312
Skype:   CajunTechie
SIP/VoIP:  [email protected]
PGP Key:   0x53B04B15
Fingerprint:   C5CE  E687  DDC2  D12B 9063  56EA  028A DF74  53B0  4B15

-BEGIN PGP SIGNATURE-
Version: APG v1.1.1

iQJJBAEBCgAzBQJWFfvuLBxBbnRob255IFBhcGlsbGlvbiA8YW50aG9ueUBjYWp1
bnRlY2hpZS5vcmc+AAoJEAKK33RTsEsVWbQP+wQesUBBum1FvswZqav3HnSDxKJ0
tkytRhaXCEtAwK5OShYyK9ktxUb7P3gCKCZix30UegtW9RcXqvqSCq/aWqKCtV0Q
yqV8Jcr0cuinIMWLLIEWNZolERStMr2U2HVL0tAXvVwYqvAqfEbWm+akSFbAy+s4
J2ta3gnynD5jIkh0BlLFOBxqg06EbSY0pO8o0K1rEtSGBY2IjXElFwQnJ/IwvxHq
x2a0SUGaGrlFCWoJ7agHIS0kZOZonn930U4QHdf1fLNWtQq8t9xy5qIV2PCn87m9
YxnZuWY+XuFO47Z5lS++lZFkwE9pu6PKjzusyZQ/BQlkh5QjtuJhjUSMA8ZaTPIO
L3P3aun+cKNTEROMN95b4ygiVWljY6QVwGVxdcxbyudisIdnNaaG6+gtNJ7HKbgG
BHH+3w/BQ2MdX5dhQrDBbBFLNcUBP2/HT470bf4UY8cXssB0ZfkOtMCxsKA5XP8U
8sZ2KHEMV7doD7SvHNgeg5PUwl+p98ymHgoSZqfq8W4A24Ltk8RvIQZjIOioEY1G
kAzUyx06JjbcOlxGtP0Wk0+4v8NGzu2agWWQQgSHSaYpb4aOdoQ28ryYi7srd8gP
vRYRpBYQhoAIClwcfaoO0pQnfnSf0V6lpnBJ3/gNCgW1F+RquvN285aD4BlPj3N+
MkwZBgzxIx4ybh17
=xqD0
-END PGP SIGNATURE-

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


Re: Is there a Windows Python SIG?

2015-10-07 Thread Chris Angelico
On Thu, Oct 8, 2015 at 4:15 PM, Anthony Papillion
 wrote:
> Over the next few months,  I'll be working on a project using Python on 
> Microsoft Windows.  While I'm doing this project, I'd also like to contribute 
> in any way I can to making Python in Windows better.
>
> Does anyone know if there is a Windows SIG? I went to the Python website 
> where I thought I'd seen one but it doesn't seem to be there now. Any 
> thoughts?
>

Awesome! Contributors are always welcome. There's the python-win32 mailing list:

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

Also, search bugs.python.org for anything that interests you - often,
an issue will languish because it can't be replicated, or because
there aren't enough details to move forward with it. I use Linux
everywhere, so for me to fire up a Windows VM and test something is
extra effort (plus there's the question of whether the bug can even be
replicated in that environment). You could help out enormously without
any knowledge of Python's internals, or of C, or anything!

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


Access a class in another python script

2015-10-07 Thread DBS
Hello,

I'm using Python 3.5 and have two python scripts where one needs access to a 
class in the other script for authentication purposes.

The scripts runs through GitHub to poll for all pull requests and pull requests 
that meet a certain condition.

The call from the second script to the class and variables in the first script 
are working, but I'm getting prompted for credentials several times.

I wrapped the credentials in a class and created an object in the second script 
to access the class so that I would not be prompted for credentials in the 
second script.  I've include both scripts below.  

I'm still new to python, but I think it's how I'm calling the class or the 
import in the second script???

Thanks in advance for your time.

main_en_pr script:

#! /usr/bin/python
import os
import github3
from github3 import login, GitHub, authorize
from getpass import getuser, getpass
import requests
import csv
import configparser
import sys
import datetime
import codecs

sys.__stdout__ = codecs.getwriter('utf8')(sys.stdout)



# Class to authenticate to GitHub
class GitAuth:
gh = None
def authentication(self):

try:
user = input('GitHub username: ')
except KeyboardInterrupt:
user = getuser()

password = getpass('GitHub token for {0}: '.format(user))


self.gh = login(user, password)
return user

# Assign the class to an object
myobjectx = GitAuth()

# Assign the variable user to the function inside the class
user = myobjectx.authentication()

# Read the contents of the config file to pull in the repo name
config = configparser.ConfigParser()
config.read('repo.ini')
repo = config.get('repos', 'repo1')


result = myobjectx.gh.repository(user, repo).pull_requests('open')

# Define function to list all pull requests
def list_all_prs():
# open csv file and create header rows

with open('c:\\pull.csv', 'w+', newline='') as f:
csv_writer = csv.writer(f)
csv_writer.writerow(['Id', 'Login', 'Title', 'Commits', 'Changed 
Files'])

# iterate through repo for pull requests based on criteria and output to 
csv file
for pr in result:
data = pr.as_dict()
changes = (myobjectx.gh.repository(user, 
repo).pull_request(data['number'])).as_dict()
# keep print to console statement for testing purposes
# print(changes['id'], changes['user']['login'], changes['title'], 
changes['commits'], changes['changed_files'])


with open('c:\\pull.csv','a+',newline='') as f:
csv_writer = csv.writer(f)

csv_writer.writerow([changes['id'], changes['user']['login'], 
changes['title'], changes['commits'],
 changes['changed_files']])


list_all_prs()

# Call the validation script
exec(open("one_commit_one_file_change.py").read())

+++

one_commit_one_file_change script:

#! /usr/bin/python
import os
import github3
from github3 import login, GitHub, authorize
from getpass import getuser, getpass
import requests
import csv
import configparser
import sys
import main_en_pr
from main_en_pr import GitAuth
import codecs
sys.__stdout__ = codecs.getwriter('utf8')(sys.stdout)

myobjecty = GitAuth()

user = myobjecty.authentication()



def one_commit_one_file_change_pr():

#open csv file and create header rows
with open('c:\\commit_filechange.csv', 'w+') as f:
csv_writer = csv.writer(f)
csv_writer.writerow(['Login', 'Title', 'Commits', 'Changed 
Files','Deletions', 'Additions'])

#iterate through repo for pull requests based on criteria and output to csv file
for pr in main_en_pr.result:
data = pr.as_dict()
changes = (myobjecty.gh.repository(user, 
main_en_pr.repo).pull_request(data['number'])).as_dict()   

if changes['commits'] == 1 and changes['changed_files'] == 1:
#keep print to console statement for testing purposes
#print changes['user']['login']


with open('c:\\commit_filechange.csv', 'a+') as f:
csv_writer = csv.writer(f)

csv_writer.writerow([changes['user']['login'], 
changes['title'], changes['commits'], changes['changed_files']])

one_commit_one_file_change_pr()
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Access a class in another python script

2015-10-07 Thread Terry Reedy

On 10/8/2015 2:24 AM, DBS wrote:

I'm using Python 3.5 and have two python scripts where one needs
access to a class in the other script for authentication purposes.


Any python .py file can be either run as a main program or module (ie, 
script) or imported as a module by another module.  If a file is meant 
for both, it should end with


if __name__ == '__main__:


The latter is ofter to call a function main() defined previously.  If 
you have a problem with this, write a **minimal** example with at most 
10 lines per file and post.



--
Terry Jan Reedy

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