how to install paramiko correctly?
My system:win7+python3.4 . I have installed Crypto and Paramiko . C:\Windows\system32>pip3.4 install Crypto Requirement already satisfied (use --upgrade to upgrade): Crypto in d:\python34\ lib\site-packages Cleaning up... C:\Windows\system32>pip3.4 install Paramiko Requirement already satisfied (use --upgrade to upgrade): Paramiko in d:\python3 4\lib\site-packages Cleaning up... when import paramiko : >>> import paramiko Traceback (most recent call last): File "", line 1, in File "D:\Python34\lib\site-packages\paramiko\__init__.py", line 30, in from paramiko.transport import SecurityOptions, Transport File "D:\Python34\lib\site-packages\paramiko\transport.py", line 49, in from paramiko.dsskey import DSSKey File "D:\Python34\lib\site-packages\paramiko\dsskey.py", line 26, in from Crypto.PublicKey import DSA ImportError: No module named 'Crypto' When i change the F:\Python34\Lib\site-packages\crypto into F:\Python34\Lib\site-packages\Crypto , import paramiko Traceback (most recent call last): File "", line 1, in File "F:\Python34\lib\site-packages\paramiko-1.13.0-py3.4.egg\paramiko\__in _.py", line 31, in File "F:\Python34\lib\site-packages\paramiko-1.13.0-py3.4.egg\paramiko\tran rt.py", line 30, in File "F:\Python34\lib\site-packages\paramiko-1.13.0-py3.4.egg\paramiko\util ", line 34, in File "F:\Python34\lib\site-packages\paramiko-1.13.0-py3.4.egg\paramiko\comm py", line 129, in ImportError: cannot import name 'Random' How can i solve the problem? -- https://mail.python.org/mailman/listinfo/python-list
which is the right file path format in python3.4 ?
My system is :win7+python3.4 . I want to write a new file "named names.txt" in disk f: >>> ff=open(r"F:\names.txt","w") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: 'F:\\names.txt' >>> ff=open(r"F:/names.txt","w") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: 'F:/names.txt' >>> ff=open(r"F://names.txt","w") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: 'F://names.txt' >>> ff=open(r"f://names.txt","w") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: 'f://names.txt' >>> ff=open(r"f:/names.txt","w") Traceback (most recent call last): File "", line 1, in OSError: [Errno 22] Invalid argument: 'f:/names.txt' which is the right file path format in python3.4 ? -- https://mail.python.org/mailman/listinfo/python-list
How to import sqlite3 in my python3.4 successfully?
There are two python version in my debian7, one is python2.7 the system default version, the other is python3.4 which compiled to install this way. | apt-get update apt-get upgrade apt-get install build-essential wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz tar-zxvfPython-3.4.0.tgz cdPython-3.4.0 mkdir/usr/local/python3.4 ./configure--prefix=/usr/local/python3.4 make make install ln-s/usr/local/python3.4/bin/python3.4/usr/bin/python3.4 ln-s/usr/local/python3.4/bin/pip3.4/usr/bin/pip3.4| I have installed sqlite this way on my debian. |sudo apt-get install sqlite3 libsqlite3-dev| In python2.7 |root@rebuild:~# python Python 2.7.3 (default, Mar 14 2014, 11:57:14) [GCC4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. import sqlite3| In python3.4 |root@rebuild:~# python3.4 Python 3.4.0 (default, Nov 27 2014, 13:54:17) [GCC4.7.2] on linux Type "help", "copyright", "credits" or "license" for more information. import sqlite3 Traceback (most recent calllast): File "", line1, in File "/usr/local/python3.4/lib/python3.4/sqlite3/__init__.py", line23, in from sqlite3.dbapi2import * File "/usr/local/python3.4/lib/python3.4/sqlite3/dbapi2.py", line26, in from _sqlite3import * ImportError: No module named'_sqlite3'| How can i import sqlite3 in my python3.4 successfully? -- https://mail.python.org/mailman/listinfo/python-list
Re: help me ?
On Mon, 26 Feb 2018 01:40:16 -0800 (PST), sotaro...@gmail.com wrote: >Define 2 lists. The first one must contain the integer values 1, 2 and 3 and >the second one the string values a, b and c. Iterate through both lists to >create another list that contains all the combinations of the A and B >elements. The final list should look like one of the 2 lists: >1. [1a, 1b, 1c, 2a, 2b, 2c, 3a, 3b, 3c] >2. [a1, a2. a3, b1, b2, b3, c1, c2, c3] >BONUS: Make the final list contain all possible combinations : [1a, a1, 1b, >b1, 1c, c1, 2a, a2, 2b, b2, 2c, c2, 3a, a3, 3b, b3, 3c, c3] > >Help me ! #a list of integers nums = [1, 2, 3] #a list of letters ltrs = ['a', 'b', 'c'] #a list to hold the result rslt = [] for i in nums: for j in ltrs: rslt.append(str(i) + j) #for bonus points uncomment the following line #rslt.append(j + str(i)) print(rslt) '''RESULT ['1a', '1b', '1c', '2a', '2b', '2c', '3a', '3b', '3c'] BONUS RESULT ['1a', 'a1', '1b', 'b1', '1c', 'c1', '2a', 'a2', '2b', 'b2', '2c', 'c2', '3a', 'a3', '3b', 'b3', '3c', 'c3'] ''' -- https://mail.python.org/mailman/listinfo/python-list
Web Hosting
Hi, With web hosting, does the ISP you chose have to support the framework you work with as well? Im looking at making a site in Python, however, Im lost as to what ISPs actually support. Some ISPs say they support Python so does that mean if I wanted to use TurboGears It would just work anyway? If an ISP just mentions Python support, does it mean CGI only scripting? I always assumed a framework was just a set of libraries you import into your project and things just start working...like a jar file in Java. Thanks for your time, -- http://mail.python.org/mailman/listinfo/python-list
Some general questions about using "stdin","stdout"....
Hi!I'm new in Python and i'd like to ask some general questions about stdin,stdout... Firstly... if we type like something like : cat "file.txt"|python somefile.py #somefile.py import sys text=sys.stdin.read() ...then "sys.stdin.read()" will read from "cat"s stdout... However,if i type inside a program,something like #someprog.py import sys print "hello"|sys.stdin.read() .the screen hangs..why is that?isn't the same situation as "cat"? in addition to this... Why can't i "write" to the stdin? Isn't it being used as a file object like all the others? for example sys.stdin.close() or open('sys.stdin','w+') or sys.stdin.write("something") etc... don't work... At last,let's consider "sys.stdin.read(3)" If i type that,the program "waits" for me to type some characters,and then prints the first three... However,doesn't this action actually include a "writing" to stdin and then a "reading" from that? I'm really confused... Any help would be highly appreciated... Thanks a lot. _ Free blogging with MSN Spaces http://spaces.msn.com/?mkt=nl-be -- http://mail.python.org/mailman/listinfo/python-list
RE: Some general questions about using "stdin","stdout"....
thank you very much for your help... my big mistake,was to believe that "|" is the pipe symbol for both,unix and python... it is really annoying,how such a simple thing can mess things Thank you for clearing this out. _ Free blogging with MSN Spaces http://spaces.msn.com/?mkt=nl-be -- http://mail.python.org/mailman/listinfo/python-list
Re: Reading and Writing
Hi, [EMAIL PROTECTED] wrote: How should I: Open a Text file, read from it, modify it, print to another .txt? For instance: Read a string, sort it, write the sorted string. What do you mean by "sorting"? If you want to sort the lines contained in a file, you could do something like this. $ cat in.txt foo bar baz ham spam $ cat process.py #!/usr/bin/env python lines = open("in.txt").readlines() lines.sort() out = open("out.txt", "w") for line in lines: out.write(line) out.close() $ python process.py $ cat out.txt bar baz foo ham spam Regards G. -- http://mail.python.org/mailman/listinfo/python-list
Re: Calendar GUI
On Feb 6, 12:59 am, Michael Torrie wrote: > Gabriel wrote: > > On Fri, Feb 5, 2010 at 9:08 PM, William Gaggioli > > wrote: > >> I'm working on setting up some software for a Peruvian non-profit to help > >> them organize their incoming volunteers. One of the features I'd like to > >> add > >> is acalendar-like view of the different volunteers arrival dates and > >> staying time, with potentially some other info through some double-click > >> action. Rather than writing acalendarguimyself, is there some open-source > >>calendarprogram you guys could recommend that I could plug into? It has to > >> be run locally, as the internet isn't so reliable down here, but other than > >> that something simple and clean is ideal. > > > I wrote a gtkguifor googlecalendar. > > > Maybe you can adapt it to your needs. > > >http://code.google.com/p/googlecalendar-gtk/ > > Would this work without an internet connection? The original poster > stated that internet isn't so reliable, hence the need for a local solution. The functionality of Google calendar would be perfect, but it needs to be run locally. -- http://mail.python.org/mailman/listinfo/python-list
Subclassing datetime.date
Hi all, I recently attempted to subclass the datetime.date object resulting in horror and confusion, before submitting to a has-a relationship. That's all fine and dandy, but out of curiosity I'd like to know what I'm missing. I was attempting to allow more flexible instancing of an object, like so: import datetime class MyDate(datetime.date): def __init__(self,*args,**kw): if len(kw) + len(args) > 1: self.construct(*args,**kw) def construct(self,d,m=None,y=None,**kw): today = datetime.date.today() if m is None: m = today.month if y is None: y = today.year datetime.date.__init__(self,y,m,d,**kw) However, it wasn't having the desired effect. Indeed, I could still only instance it with 3 variables lest I get errors, and when I did call it with 3 variables it didn't reflect the order change I had implemented. Indeed, the properties were already set before it even got to the construct method. Is there some kind of built in I'm missing here? Thanks all, Will -- http://mail.python.org/mailman/listinfo/python-list
Could not initilalize crash reporting DB
I have a script that chooses a paragraph at random from a text file then uses that paragraph to generate and send an email message. It's set up to run on Windows 7 startup. It has run without issue more than 400 times. Recently two consecutive runs produced the following messages... Could not initialize crash reporting DB Cannot init crashpad with status: CRASHPAD_INIT_DB_ERROR Despite the messages the script otherwise ran as expected. Google searches turned up nothing useful. I was hoping that maybe someone here could tell me what these messages mean. -- https://mail.python.org/mailman/listinfo/python-list
Re: Can a print overwrite a previous print ?
On Fri, 8 May 2020 16:25:52 +0200, ast wrote: >Hello > > >Suppose we want that: > >print("abcdef"); print("ghi") > >produces: > >ghidef > >The 2nd print overwrites the first one. >Is it feasible ? > >It should since the progress bar tdqh seems to do that > >try: > >from tkdm import tkdm > >for i in tqdm(range(100_000_000)): > pass > >It produces a progress bar like this: >100%|???| >1/1 [00:56<00:00, 1781611.52it/s] print('abcdef', end='\r'); print('ghi', end='') -- https://mail.python.org/mailman/listinfo/python-list