On Mon, Dec 15, 2014 at 1:29 AM, Ben Finney wrote:
> How can I get that ‘__import__’ call, complete with its ‘fromlist’
> parameter, working correctly under both Python 2 and Python 3, keeping
> the ‘unicode_literals’ setting?
How about "str('bar')"?
> If some kind of kludge is needed to make it
jean-michel richer writes:
> Hi,
> I am new to python and I am trying to use pycuda but get some
> error on the following script. My environement is :
>
> Python 2.7.6
> libboost 1.54
> gcc/g++ 4.8.2
> CUDA 6.5
> ...
> from six.moves import range, zip, intern, input
> ImportError: cannot im
Howdy all,
What should I do, in a world where all text literals are Unicode by
default, to make ‘__import__’ work in both Python 2 and 3?
I'm slowly learning about making Python code that will run under both
Python 2 (version 2.6 or above) and Python 3 (version 3.2 or above).
This entails, I be
On Mon, Dec 15, 2014 at 4:38 PM, Michael Torrie wrote:
> Thought I had indirectly, since I've been using this print technique for
> the last few days. Good to know it works either way, though. Guess the
> future import is only to make not having parens and error.
Yeah. I usually recommend using
On Sun, Dec 14, 2014 at 11:38 PM, Michael Torrie wrote:
> Guess the future import is only to make not having parens and error.
Python 2.7.8+ (default, Nov 2 2014, 00:32:19) [MSC v.1500 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(1, 2)
On 12/14/2014 10:32 PM, Chris Angelico wrote:
> Did you actually test that?
>
> Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit
> (Intel)] on win32
> Type "copyright", "credits" or "license()" for more information.
print("hello")
> hello
>
> Since print is a keyword when not
On Mon, Dec 15, 2014 at 4:27 PM, Michael Torrie wrote:
> On 12/14/2014 07:47 PM, Mark Lawrence wrote:
>> I didn't realise that Python was so smart. It can indicate a syntax
>> error at the final 't' in print before it gets to the opening bracket
>> that is required for the print function in Pytho
On 12/14/2014 07:47 PM, Mark Lawrence wrote:
> I didn't realise that Python was so smart. It can indicate a syntax
> error at the final 't' in print before it gets to the opening bracket
> that is required for the print function in Python 3 (and Python 2 if
> you're using "from __future__ impor
> Thank you very much. Appreciated ! But the first requirement was to convert
> format1 to format2 as below:
>
> set interface ethernet2/5 ip 10.17.10.1/24 (format 1)
> set interfaces ge-0/0/0 unit 0 family inet address 10.17.10.1/24 (format 2)
> (set, interface, ip) = (set, interfaces, family inet
sir wrote:
^^^
Please fix.
> 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/
On 15/12/2014 02:32, Chris Roy-Smith wrote:
On 15/12/14 10:21, Simon Evans wrote:
Dear Jussi, and Billy
I have changed the input in accordance with your advice, re:
--
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC
On Mon, Dec 15, 2014 at 1:32 PM, Chris Roy-Smith
wrote:
> and here he uses a python 3.x print syntax which triggers the following
> error message
On the contrary; parens around a single argument will work just fine
in Py2 (they're simply redundant parentheses, in the same way that you
can write "
On 15/12/14 10:21, Simon Evans wrote:
Dear Jussi, and Billy
I have changed the input in accordance with your advice, re:
--
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
here the user
Thomas 'PointedEars' Lahn wrote:
> Ivan Evstegneev wrote:
>
>> I have stuck a bit with this example(took this one from the book).
>>
>> Here are a description steps of what I've done till now:
>>
>>
>> Step 1 - creating an empty namespace:
>>
>class rec: pass
>
> IMHO that is not actual
Thanks.. I appreciate your contribution!
On Sun, Dec 14, 2014 at 5:48 PM, Chris Angelico wrote:
>
> On Mon, Dec 15, 2014 at 10:41 AM, Billy Earney
> wrote:
> > Yes, you are correct. The scripts get compiled to javascript and then
> > executed in the browser. Like you say, there are limitatio
Simon Evans wrote:
> Dear Jussi, and Billy
> I have changed the input in accordance with your advice, re:
> --
> Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
> on win 32
> Type "help", "copyrig
Terry Reedy wrote:
> On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
>> Ivan Evstegneev wrote:
>>> I have stuck a bit with this example(took this one from the book).
>>>
>>> Here are a description steps of what I've done till now:
>>>
>>> Step 1 - creating an empty namespace:
>>>
>> cl
On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
Ivan Evstegneev wrote:
I have stuck a bit with this example(took this one from the book).
Here are a description steps of what I've done till now:
Step 1 - creating an empty namespace:
class rec: pass
IMHO that is not actually creat
On Mon, Dec 15, 2014 at 10:41 AM, Billy Earney wrote:
> Yes, you are correct. The scripts get compiled to javascript and then
> executed in the browser. Like you say, there are limitations, but most of
> these focus around browser security issues, and on the plus side, these
> scripts do not g
ChrisA,
Yes, you are correct. The scripts get compiled to javascript and then
executed in the browser. Like you say, there are limitations, but most of
these focus around browser security issues, and on the plus side, these
scripts do not get executed on the server side, so that helps reduce r
On Mon, Dec 15, 2014 at 2:07 AM, Billy Earney wrote:
> Students can create, edit, load, save, and execute Python scripts directly
> in the browser.
Importantly, these scripts are actually executed in the client - they
are NOT being sent to the server for execution. That means there are
limitation
Dear Jussi, and Billy
I have changed the input in accordance with your advice, re:
--
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for
Ivan Evstegneev wrote:
> I have stuck a bit with this example(took this one from the book).
>
> Here are a description steps of what I've done till now:
>
>
> Step 1 - creating an empty namespace:
>
class rec: pass
IMHO that is not actually creating a namespace; it is just
declaring/def
Albert-Jan Roskam wrote:
I was trying to change the one-dim array into a two-dim array so
I could easily retrieve columns. I now use a pandas DataFrame to do that.
Numpy can do that, if I understand what you want correctly,
but it requires an unintuitive trick.
The trick is to index the array
Dear Steven,
I very appreciate your answer.
You just explained a lot of background things and you did it in more
explicit and simple way than it've appeared in the book.
I also agree with you about the fact that there are some advanced topics
spread within a book's text.
It is sometimes hard to
Hi,
I am new to python and I am trying to use pycuda but get some
error on the following script. My environement is :
Python 2.7.6
libboost 1.54
gcc/g++ 4.8.2
CUDA 6.5
import pycuda.autoinit
import pycuda.driver as drv
import numpy
from pycuda.compiler import
It looks like the last line (producer_entries...) is not indented at the
same extent as the previous line. Maybe this is causing the issue?
On Sun, Dec 14, 2014 at 10:15 AM, Simon Evans
wrote:
>
> Dear Python programmers,
> Having input the line of code in text:
> cd Soup
> to the Windows consol
Greetings!
For the past few months, I've been developing a website for educators and
students to learn computer programming (ie, Python). My first project has
been to create a basic programming environment entirely within a browser.
Students can create, edit, load, save, and execute Python script
Le dimanche 14 décembre 2014 14:10:22 UTC-5, Stefanos Karasavvidis a écrit :
> thanks for replying gst.
>
> I've thought already of patching the Charset class, but hoped for a cleaner
> solution.
>
>
> This ALIASES dict has already all the iso names *with* a dash. So it must get
> striped som
On Mon, Dec 15, 2014 at 1:48 AM, Simon Evans wrote:
> Thanks Guys
> This book keeps swapping from the Python console to the Windows - without
> telling you, but it is the only book out there on 'Beautiful Soup' so I have
> got to put up with it. There's more problems with it, but I will start a
thanks for replying gst.
I've thought already of patching the Charset class, but hoped for a cleaner
solution.
This ALIASES dict has already all the iso names *with* a dash. So it must
get striped somewhere else.
sk
On Sun, Dec 14, 2014 at 7:21 PM, gst wrote:
> Le vendredi 12 décembre 2014 04
Simon Evans writes:
> I had another attempt at inputting the code perhaps with the right
> indentation, I still get an error return, but not one that indicates
> that the code has not been read, as you suggested. re:-
> --
>
> Py
I had another attempt at inputting the code perhaps with the right indentation,
I still get an error return, but not one that indicates that the code has not
been read, as you suggested. re:-
Python 2.7.6 (default, Nov
On Sunday, December 14, 2014 9:27:14 AM UTC-8, Chris Warrick wrote:
> On Sun, Dec 14, 2014 at 6:16 PM, Luke Tomaneng wrote:
> > Here a very small program that I wrote for Codecademy. When I finished,
> > Codecademy acted like it was correct, but testing of this code revealed
> > otherwise.
> > -
Ivan Evstegneev wrote:
> Hello Everyone,
>
> I have stuck a bit with this example(took this one from the book).
The example you are working on (adding external functions as methods) is
actually a bit more complicated than it seems, as you have discovered. You
have this:
class rec: pass
rec.name
On Sunday, December 14, 2014 9:24:54 AM UTC-8, Luke Tomaneng wrote:
> On Friday, December 12, 2014 4:40:01 AM UTC-8, Delgado Motto wrote:
> > I travel alot, if not just interested in things of pocketable portability,
> > and was curious if you can tell me if Python can be LEARNED from beginner
>
On Sun, Dec 14, 2014 at 6:16 PM, Luke Tomaneng wrote:
> Here a very small program that I wrote for Codecademy. When I finished,
> Codecademy acted like it was correct, but testing of this code revealed
> otherwise.
> --
> print 'Welcome to the Pig
On Friday, December 12, 2014 4:40:01 AM UTC-8, Delgado Motto wrote:
> I travel alot, if not just interested in things of pocketable portability,
> and was curious if you can tell me if Python can be LEARNED from beginner on
> an IOS device ( with interest of being able to test my code, possibly e
Le vendredi 12 décembre 2014 04:21:14 UTC-5, Stefanos Karasavvidis a écrit :
> I've hit a wall with mailman which seems to be caused by pyhon's character
> encoding names.
>
> I've narrowed the problem down to the email/charset.py file. Basically the
> following happens:
>
Hi,
it's all in th
Here a very small program that I wrote for Codecademy. When I finished,
Codecademy acted like it was correct, but testing of this code revealed
otherwise.
--
print 'Welcome to the Pig Latin Translator!'
# Start coding here!
raw_input("Enter a word:
---
On Sun, Dec 14, 2014 4:06 PM CET sir wrote:
>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-essentia
On 12/14/14 11:15 AM, Simon Evans wrote:
Dear Python programmers,
Having input the line of code in text:
cd Soup
to the Windows console, and having put the file 'EcologicalPyramid.html' into
the Directory 'Soup', on the C drive, in accordance with instructions I input
the following code to the
Hello Everyone,
I have stuck a bit with this example(took this one from the book).
Here are a description steps of what I've done till now:
Step 1 - creating an empty namespace:
>>>class rec: pass
Step 2 - adding some attributes:
>>>rec.name = 'Bob'
>>>rec.age = 40
Step 3 - Creating an in
Dear Python programmers,
Having input the line of code in text:
cd Soup
to the Windows console, and having put the file 'EcologicalPyramid.html' into
the Directory 'Soup', on the C drive, in accordance with instructions I input
the following code to the Python console, as given on page 30 of 'G
In article ,
"" <1248283...@qq.com> wrote:
> I want to delete the file "names.txt" if it exits in "/home/names.txt" in my
> remote vps server.
> import paramiko
> host = "vps ip"
> port = 22
> transport = paramiko.Transport((host, port))
> password = "key"
> username = "root"
> transport.co
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
Hello!
I'm pleased to announce version 1.7.2, a bugfix release of branch
1.7 of SQLObject.
What's new in SQLObject
===
* Fix a bug: zero-pad microseconds on the right, not on the left; 0.0835
seconds means 83500 microseconds.
For a more complete list, please see the news:
Thanks Guys
This book keeps swapping from the Python console to the Windows - without
telling you, but it is the only book out there on 'Beautiful Soup' so I have
got to put up with it. There's more problems with it, but I will start a new
thread in regard of, I don't know if its related to the
- Original Message -
> From: Steven D'Aprano
> To: python-list@python.org
> Cc:
> Sent: Sunday, December 14, 2014 12:52 AM
> Subject: Re: numpy question (fairly basic, I think)
>
> Albert-Jan Roskam wrote:
>
>> Hi,
>>
>> I am new to numpy. I am reading binary data one record at a
On Sun, Dec 14, 2014 at 6:49 AM, 水静流深 <1248283...@qq.com> wrote:
> Is there more elegant way to do the same work?
Unlikely. You have two fairly simple bits of code in your example, one
to connect to the remote server, the other to check for the file's
existence and remove it. The only extra elegan
I want to delete the file "names.txt" if it exits in "/home/names.txt" in my
remote vps server.
import paramiko
host = "vps ip"
port = 22
transport = paramiko.Transport((host, port))
password = "key"
username = "root"
transport.connect(username = username, password = password)
sftp = paramiko.SFT
On Sun, Dec 14, 2014 at 10:51 PM, Steven D'Aprano
wrote:
> I don't have access to a Windows box to check, otherwise I would do it
> myself. What happens if you specify a non-existent drive letter?
>
> open("Q:\\xxx") # Assuming you don't have a drive Q.
Hmm. I just grabbed one (granted, it's XP
Chris Angelico wrote:
> On Sun, Dec 14, 2014 at 10:03 PM, Steven D'Aprano
> wrote:
>> Run this code and show us what it prints:
>>
>> import os
>> print(os.stat("F:\\")
>> print(os.access("F:\\", os.O_RDWR))
>
> (With an extra close parenthesis on the first print call)
Thanks.
> I'm suspicio
On Sun, Dec 14, 2014 at 10:03 PM, Steven D'Aprano
wrote:
> Run this code and show us what it prints:
>
> import os
> print(os.stat("F:\\")
> print(os.access("F:\\", os.O_RDWR))
(With an extra close parenthesis on the first print call)
I'm suspicious here that drive F might not even exist. I woul
sir wrote:
> 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'
Are you sure that you have an F
On 14-12-2014 10:05, sir wrote:
> 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
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
57 matches
Mail list logo