Hi Taishi, and welcome.
On Wed, Jul 24, 2019 at 03:21:03AM +, TAISHI KAWAMURA wrote:
[...]
> I'm suspecting that Anaconda might keep raising the error, or simply
> there are bugs in the codes. However, I can't be sure what the real
> cause is.
Almost certainly it will be a bug in your code
On 24/07/19 3:21 PM, TAISHI KAWAMURA wrote:
Hi tutors on Tutor,
I'm Taishi from Japan working in a data analytics team.
Currently, I'm trying to analyse purchase data of a fashion brand.
However, mysterious KeyErrors started occurring continuously when I was coding,
and I haven't been able to
Hi tutors on Tutor,
I'm Taishi from Japan working in a data analytics team.
Currently, I'm trying to analyse purchase data of a fashion brand.
However, mysterious KeyErrors started occurring continuously when I was coding,
and I haven't been able to get that fixed.
Although I asked this questio
Prateek wrote:
> Hi
>
> Whenever I use help(input) inside Python shell i get the following output:
>
help(input)
> Help on built-in function input in module builtins:
>
> input(...)
> input([prompt]) -> string
>
> I want to know what the significance of "-> string". I have tried
On 23 September 2017 at 15:15, Prateek wrote:
> input(...)
> input([prompt]) -> string
>
> I want to know what the significance of "-> string". I have tried
> consulting several books but none of them gave me a clear-cut explanation
> for this.
This indicates the return type: input() returns
Hi
Whenever I use help(input) inside Python shell i get the following output:
>>>
>>> help(input)
Help on built-in function input in module builtins:
input(...)
input([prompt]) -> string
I want to know what the significance of "-> string". I have tried
consulting several books but none of
On 10/18/2014 02:36 PM, George R Goffe wrote:
> Hi,
>
> When you run a python program, it appears that stdin, stdout, and stderr are
> opened automatically.
>
> I've been trying to find out how you tell if there's data in stdin (like when
> you pipe data to a python program) rather
> than in a
Hi,
Wow. Lots of feedback. REALLY GOOD FEEDBACK!
This was my first question to this list. Let me clarify my question.
I want to use tst.py as follows:
tst.py input-file output-file OR
cat data-file | tst.py - output-file OR
cat data-file | tst.py output-file
tst.py input-file output-file works
* Peter Otten <__pete...@web.de> [2014-10-19 10:05]:
> George R Goffe wrote:
>
> > When you run a python program, it appears that stdin, stdout, and stderr
> > are opened automatically.
> >
> > I've been trying to find out how you tell if there's data in stdin (like
> > when you pipe data to a py
On 18/10/14 19:36, George R Goffe wrote:
When you run a python program, it appears that stdin, stdout, and stderr are
opened automatically.
correct.
I've been trying to find out how you tell if there's data in stdin
Same way you tell if there's data in any file/stream - you read
from it.
George R Goffe wrote:
> When you run a python program, it appears that stdin, stdout, and stderr
> are opened automatically.
>
> I've been trying to find out how you tell if there's data in stdin (like
> when you pipe data to a python program) rather than in a named input file.
> It seems like mo
On Sat, Oct 18, 2014 at 11:36:43AM -0700, George R Goffe wrote:
> Hi,
>
> When you run a python program, it appears that stdin, stdout, and
> stderr are opened automatically.
>
> I've been trying to find out how you tell if there's data in stdin
> (like when you pipe data to a python program) r
Are you planning to pipe data to a python program? If so please
specify and you will get more complete answers.
Specifically I am thinking you want information pertaining to
subprocess in the standard library.
https://docs.python.org/3/library/subprocess.html
On Sat, Oct 18, 2014 at 2:36 PM, Georg
George R Goffe writes:
> When you run a python program, it appears that stdin, stdout, and
> stderr are opened automatically.
That's true of any program on a POSIX-compliant operating system.
> I've been trying to find out how you tell if there's data in stdin
> (like when you pipe data to a py
Hi,
When you run a python program, it appears that stdin, stdout, and stderr are
opened automatically.
I've been trying to find out how you tell if there's data in stdin (like when
you pipe data to a python program) rather
than in a named input file. It seems like most/all the Unix/Linux
comm
On Wed, Oct 3, 2012 at 2:53 PM, Alan Gauld wrote:
>
> The only times you really need to worry about maxsize is when interfacing to
> external non-python code.
It's not generally a problem, but if you're on a 32-bit platform, for
which sys.maxsize is 2**31 - 1, that sets the maximum length of a
se
On 03/10/12 12:33, eryksun wrote:
On Wed, Oct 3, 2012 at 1:28 AM, Katya Stolpovskaya
Thank you for you reply, but with "long" I got the same error:
from sys import *
long
Traceback (most recent call last):
File "", line 1, in
long
NameError: name 'long' is not defined
I assumed some fam
On Wed, Oct 3, 2012 at 1:28 AM, Katya Stolpovskaya
wrote:
>
> Thank you for you reply, but with "long" I got the same error:
>
from sys import *
long
>
> Traceback (most recent call last):
> File "", line 1, in
> long
> NameError: name 'long' is not defined
I assumed some familiarity w
On Tue, Oct 2, 2012 at 12:55 PM, Katya Stolpovskaya
wrote:
>
> I have this error:
>
from sys import *
maxint
> Traceback (most recent call last):
> File "", line 1, in
> maxint
> NameError: name 'maxint' is not defined
>
>
> What does it mean and how to deal with it?
The "int" type in
On 02/10/2012 17:55, Katya Stolpovskaya wrote:
Hi all,
I have this error:
from sys import *
maxint
Traceback (most recent call last):
File "", line 1, in
maxint
NameError: name 'maxint' is not defined
What does it mean and how to deal with it?
Thank you in advance,
Katya
_
Katya Stolpovskaya wrote:
> I have this error:
>
from sys import *
maxint
> Traceback (most recent call last):
> File "", line 1, in
> maxint
> NameError: name 'maxint' is not defined
>
>
> What does it mean and how to deal with it?
You are probably using Python 3 which doesn't have
Hi all,
I have this error:
>>> from sys import *
>>> maxint
Traceback (most recent call last):
File "", line 1, in
maxint
NameError: name 'maxint' is not defined
What does it mean and how to deal with it?
Thank you in advance,
Katya
--
AKA XIAOJIA
__
贾晓磊 wrote:
> hi, all:
>
> python's version: 2.6.
> MySQLdb version: 1.2.3.
>
> I once encounter with a question like this:
> File
> "/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-
x86_64.egg/MySQLdb/connections.py",
>
> line 36, in defaulterrorhandler
> raise erro
hi, all:
python's version: 2.6.
MySQLdb version: 1.2.3.
I once encounter with a question like this:
File
"/usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/MySQLdb/connections.py",
line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError
On 11/01/2011 10:19 AM, Jose Amoreira wrote:
HiOn Tuesday, November 01, 2011 01:55:18 PM Joel Goldstick wrote:
On Tue, Nov 1, 2011 at 9:48 AM, Jefferson Ragot wrote:
In a Vista command prompt if I typed this:
>>> python somescript.py filename
Will sys.argv[1] return a valid path o
On 11/01/2011 10:05 AM, Hugo Arts wrote:
On Tue, Nov 1, 2011 at 2:48 PM, Jefferson Ragot wrote:
In a Vista command prompt if I typed this:
>>> python somescript.py filename
Will sys.argv[1] return a valid path or just the filename?
If it just returns the filename, is there a simpl
HiOn Tuesday, November 01, 2011 01:55:18 PM Joel Goldstick wrote:
> On Tue, Nov 1, 2011 at 9:48 AM, Jefferson Ragot wrote:
> > In a Vista command prompt if I typed this:
> > >>> python somescript.py filename
> >
> > Will sys.argv[1] return a valid path or just the filename?
> > If it ju
On Tue, Nov 1, 2011 at 2:48 PM, Jefferson Ragot wrote:
> In a Vista command prompt if I typed this:
>
> >>> python somescript.py filename
>
> Will sys.argv[1] return a valid path or just the filename?
> If it just returns the filename, is there a simple way to get the path?
>
sys.argv c
On Tue, Nov 1, 2011 at 9:48 AM, Jefferson Ragot wrote:
> In a Vista command prompt if I typed this:
>
> >>> python somescript.py filename
>
> Will sys.argv[1] return a valid path or just the filename?
> If it just returns the filename, is there a simple way to get the path?
>
> --
> Jef
In a Vista command prompt if I typed this:
>>> python somescript.py filename
Will sys.argv[1] return a valid path or just the filename?
If it just returns the filename, is there a simple way to get the path?
--
Jefferson B. Ragot
___
Tutor m
"Khalid Al-Ghamdi" wrote
class Robot:
population = 0
def __init__(self, name):
self.name=name
print ('initializing {0}'.format(self.name))
Robot.population+=1
def __del__(self):
'''I'm dying'''
print ('{0} is being destroyed!'.format(self.name))
On Sun, Oct 25, 2009 at 10:10 PM, Luke Paireepinart
wrote:
>
>
>> 2- in the final few lines where I assign an object to the class, I notice
>> that a parameter was entered in the class name, "Robot(D23)", although when
>> defining the class I didn't put any arguments for it.
>>
> Yes you did,
> __
On Sun, Oct 25, 2009 at 8:06 PM, Khalid Al-Ghamdi wrote:
> Hi everybody,
> So I'm new to python and have questions about the following code:
>
> def __init__(self, name):
> '''initializes the data'''
> self.name=name
> print ('initializing {0}'.format(self.name))
>
> dr
Hi everybody,
So I'm new to python and have questions about the following code:
class Robot:
'''Represents a Robot with a name.
Deletes and makes Robots for testing perpuses'''
#a var for counting the number of Robots
population = 0
def __init__(self, name):
'''initializes t
On Tue, Sep 23, 2008 at 11:16 AM, John Toliver <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> The book I have says when you anticipate that you will be working with
> numbers larger than what python can handle, you place an "L" after the
> number to signal python to treat it as a large number.
Your b
On Tue, Sep 23, 2008 at 04:24:48PM +0100, Adam Bark wrote:
> 2008/9/23 John Toliver <[EMAIL PROTECTED]>
>
> > Greetings,
> >
> > The book I have says when you anticipate that you will be working with
> > numbers larger than what python can handle, you place an "L" after the
> > number to signal py
2008/9/23 John Toliver <[EMAIL PROTECTED]>
> Greetings,
>
> The book I have says when you anticipate that you will be working with
> numbers larger than what python can handle, you place an "L" after the
> number to signal python to treat it as a large number. Does this
> "treating" of the number
Greetings,
The book I have says when you anticipate that you will be working with
numbers larger than what python can handle, you place an "L" after the
number to signal python to treat it as a large number. Does this
"treating" of the number only mean that Python won't try to represent
the numbe
On Tue, Jun 17, 2008 at 1:46 AM, Christopher Spears
<[EMAIL PROTECTED]> wrote:
> I am confused by this statement:
i = iter(a)
>
> Why do I need to turn 'a' into an iterator? Didn't I already do this when I
> constructed the class?
Yes, a is already an iterator.
> As a test, I tried the fo
I've been learning about how to implement an iterator in a class from Core
Python Programming (2nd Edition).
>>> class AnyIter(object):
... def __init__(self, data, safe=False):
... self.safe = safe
... self.iter = iter(data)
...
... def __iter__(self):
... return self
> I'm fairly new to python, and trying to get used to the indentation. I
> just encountered my first problem with it. I wrote the following code:
>
> for ord in f_ord:
>if not ordliste.has_key(ord) :
>ordliste[ord] = {}
>for word in e_ord:
>if ordliste[ord].h
Christopher Arndt wrote:
> [EMAIL PROTECTED] schrieb:
>
>> I suppose there is a good way to do indent whole blocks like this, but I
>> haven't found out what it is. Could anybody help me out?
>>
>
> Yes, get a good source code editor that has the ability to (de)indent whole
> blocks of cod
[EMAIL PROTECTED] schrieb:
> I suppose there is a good way to do indent whole blocks like this, but I
> haven't found out what it is. Could anybody help me out?
Yes, get a good source code editor that has the ability to (de)indent whole
blocks of code with one keystroke. This is a must-have for w
Hi,
I'm fairly new to python, and trying to get used to the indentation. I
just encountered my first problem with it. I wrote the following code:
for ord in f_ord:
if not ordliste.has_key(ord) :
ordliste[ord] = {}
for word in e_ord:
if ordliste[ord
Thanks.
It means, you take a datetime object and then using a timedelta object,
perform the addition, the language takes care of changing the date if the
time crosses midnight.
WOW... this makes life a lot easier..
Have a brilliant evening.
Best Regards,
Asrarahmed Kadri
On 11/18/06, Kent John
Asrarahmed Kadri wrote:
> Hi ,
>
>
> I have a question:
>
> Is it possible to add seconds to a datetime object and get the result as
> a new datetime object. I mean when we keep adding, for example, 3600
> seconds, the date will get changed after 24 iterations. Is it possible
> to carry ou
Hi ,
I have a question:
Is it possible to add seconds to a datetime object and get the result as a
new datetime object. I mean when we keep adding, for example, 3600 seconds,
the date will get changed after 24 iterations. Is it possible to carry out
such an operation ?
TIA.
Best Regards,
Asrar
"kristinn didriksson" <[EMAIL PROTECTED]> wrote
> In my understanding, return area in the first routine
> makes the value of area an instance of areaCirc
No, it simply assigns the value returned by areaCirc to
area within .
areaCirc assigns
4*(math.pi)*(diameter/2)**2
to its local variable
kristinn didriksson wrote:
> Hello,
> I am still wrestling with the concept of values going
> between functions. (just starting out)The program
> below works seems to work, but here is my question.
> In my understanding, return area in the first routine
> makes the value of area an instance of area
Hello,
I am still wrestling with the concept of values going
between functions. (just starting out)The program
below works seems to work, but here is my question.
In my understanding, return area in the first routine
makes the value of area an instance of areaCirc and I
use areaCirc in the other pr
import traceback
try:
something_funny()
except:
traceback.print_exc()
should do the trick for you.
Dustin
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi Folks,
I want to know how we can print the error message when an exception is generated. I mean "the exact error message that is generated by the python interpreter."
My code is as under:
def check_date(date,num_days): # this function takes a date and number of days and returns the st
linda.s wrote:
> On 5/28/06, Bob Gailer <[EMAIL PROTECTED]> wrote:
>> linda.s wrote:
>> When I test the following code,
>> I got something like (use 80 as argument):
>> 80?F=27?C
>> Why '?' appear?
>>
>> # code
>> print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))
>>
>> On my compute
On 5/28/06, Bob Gailer <[EMAIL PROTECTED]> wrote:
>
> linda.s wrote:
> When I test the following code,
> I got something like (use 80 as argument):
> 80?F=27?C
> Why '?' appear?
>
> # code
> import string, sys
>
> # If no arguments were given, print a helpful message
> if len(sys.argv)==1:
> pri
When I run this program using your code on Ubuntu
Linux, I get:
~$ ./c2f.py 44
44\uF = 7\uC
Please notice that the code you have posted has
indentation block errors.
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protec
linda.s wrote:
When I test the following code,
I got something like (use 80 as argument):
80?F=27?C
Why '?' appear?
# code
import string, sys
# If no arguments were given, print a helpful message
if len(sys.argv)==1:
print 'Usage: celsius temp1 temp2 ...'
sys.exit(0)
# Loop over t
>> Let's compare the output to what we think is producing it. The very
>> last statement in the program looks like the thing we want to watch:
>>
>> print '%i\260F = %i\260C' % (int(fahrenheit), int(celsius+.5))
>>
>> One thing that caught me off guard is the '\260' thing. Can you explain
>
On 5/28/06, Danny Yoo <[EMAIL PROTECTED]> wrote:
>
>
> On Sun, 28 May 2006, linda.s wrote:
>
> > When I test the following code,
> > I got something like (use 80 as argument):
> > 80?F=27?C
> > Why '?' appear?
>
>
> Hi Linda,
>
> Let's compare the output to what we think is producing it. The very
On Sun, 28 May 2006, linda.s wrote:
> When I test the following code,
> I got something like (use 80 as argument):
> 80?F=27?C
> Why '?' appear?
Hi Linda,
Let's compare the output to what we think is producing it. The very last
statement in the program looks like the thing we want to watch:
When I test the following code,
I got something like (use 80 as argument):
80?F=27?C
Why '?' appear?
# code
import string, sys
# If no arguments were given, print a helpful message
if len(sys.argv)==1:
print 'Usage: celsius temp1 temp2 ...'
sys.exit(0)
# Loop over the arguments
for i in
On Sun, 5 Feb 2006, Marilyn Davis wrote:
> On Sun, 5 Feb 2006, Bian Alex wrote:
>
> > How can I get a string from a random file.
> > For Example:
> > Delete On : Copy
> > Owner : Bn
> > Personalized: 5
> > PersonalizedName: MyDocuments
> >
> > I want to get the st
On Sun, 5 Feb 2006, Bian Alex wrote:
> How can I get a string from a random file.
> For Example:
> Delete On : Copy
> Owner : Bn
> Personalized: 5
> PersonalizedName: MyDocuments
>
> I want to get the string after 'Owner' ( In example is 'Bn')
>
> 'import re' ?
Y
On 2/5/06, Bian Alex <[EMAIL PROTECTED]> wrote:
How can I get a string from a random file.
For Example:
Del ete On : CopyOwner : BnPersonalized: 5PersonalizedName : My Documents
I want to get the string after 'Owner' ( In example is 'Bn')
'import re' ?
Pls help.h
How can I get a string from a random file.
For Example:
Del ete On : CopyOwner : BnPersonalized: 5PersonalizedName : My Documents
I want to get the string after 'Owner' ( In example is 'Bn')
'import re' ?
Pls help.
___
t; <[EMAIL PROTECTED]>
To:
Sent: Sunday, July 03, 2005 8:10 AM
Subject: [Tutor] a question
when I type sys.ps2 after import sys,
I got the message like:
Traceback (most recent call last):
File "", line 1, in -toplevel-
sys.ps2
AttributeError: 'module' object has n
Xinyue Ye wrote:
> when I type sys.ps2 after import sys,
> I got the message like:
> Traceback (most recent call last):
> File "", line 1, in -toplevel-
> sys.ps2
> AttributeError: 'module' object has no attribute 'ps2'
> why does it happen?
>From the docs:
ps1
ps2
Strings specifying the pr
when I type sys.ps2 after import sys,
I got the message like:
Traceback (most recent call last):
File "", line 1, in -toplevel-
sys.ps2
AttributeError: 'module' object has no attribute 'ps2'
why does it happen?
___
Tutor maillist - Tutor@python.org
h
67 matches
Mail list logo