On 2023-12-25 19:53, Alan Gauld via Python-list wrote:
On 25/12/2023 05:34, geetanajali homes via Python-list wrote:
import numpy as np
import pandas as pd
import random
import matplotlib.pyplot as plt
%matplotlib inline
I get an error on the last line. I am running this code in Idle Pytho
On Tue, 26 Dec 2023 at 07:27, Chris Grace via Python-list
wrote:
> I'd also recommend a newer version of python. Python 3.4 reached end of
> life almost 5 years ago.
Uhh, putting this in perspective... until a spammer revived the thread
just now, it was asked, answered, and finished with, all bac
"%matplotlib inline" is a magic command that changes how plots render when
working with IPython. Read more here: https://stackoverflow.com/a/43028034
The article you linked assumes you are working in an IPython shell, not
IDLE. This is common in the data science world.
You may already have IPytho
On 25/12/2023 05:34, geetanajali homes via Python-list wrote:
>> import numpy as np
>> import pandas as pd
>> import random
>> import matplotlib.pyplot as plt
>> %matplotlib inline
>>
>> I get an error on the last line. I am running this code in Idle Python
>> 3.4.4 Shell...
Python names c
copyright", "credits" or "license()" for more information.
> >>> import numpy as np
> >>> import pandas as pd
> >>> import random
> >>> import matplotlib.pyplot as plt
> >>> %matplotlib inline
> SyntaxErr
Eugene Alterman writes:
> a = 1, 2, 3
>
> b = *a, # assignment - OK
> b += *a, # augmented assignment - syntax error
>
> Need to enclose in parenthesis:
>
> b += (*a,)
>
> Why isn't it allowed with an augmented assignment, while it is OK with a
> regular assignment?
>
Syntacti
a = 1, 2, 3
b = *a, # assignment - OK
b += *a, # augmented assignment - syntax error
Need to enclose in parenthesis:
b += (*a,)
Why isn't it allowed with an augmented assignment, while it is OK with a
regular assignment?
--
https://mail.python.org/mailman/listinfo/python-
On Fri, 09 Mar 2018 00:47:21 +, MRAB wrote:
> On 2018-03-08 23:57, Ben Finney wrote:
>> You mean the tool is not always looking for mistakes while you type?
[...]
>> Certainly it'd be good to always have a *perfect* overseer checking for
>> mistakes . Until that happy day, though, let's use t
On 2018-03-08 23:57, Ben Finney wrote:
Chris Angelico writes:
On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote:
> In many cases, those eyes can be virtual and non-human.
>
> That's what syntax highlighting, and tools even more impressive
> (e.g. linting tools that run continually), offer in
On 03/08/2018 05:30 PM, Ben Finney wrote:
Not sufficiently, it seems. Check the line preceding the ‘return’
statement.
Indeed. :-/
Then, switch to using a programmer's text editor (I prefer Emacs) that
can spot these syntax errors while you type.
The sad thing is that I am. Just too bone-
On 03/08/2018 05:26 PM, Chris Angelico wrote:
On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote:
(Because I certainly can't.)
ips.update(_san_dnsname_ips(cname, True)
return ips
I've checked for tabs and mismatched parentheses.
Check the immediately preceding line (t
cname in cnames:
>> if not cname.endswith('.'):
>> cname = u'%s.%s' % (cname, zone)
>> ips.update(_san_dnsname_ips(cname, True)
>> return ips
>>
>
> 2.7 and 3.6 are
put the '|', thus
indicating that there is no ')' matching the function call '('
return ips
If you delete the helpful indent signal to type return here, ...
2.7 and 3.6 are both giving me:
File "/tmp/test.py", line 32
return ips
)
else:
for cname in cnames:
if not cname.endswith('.'):
cname = u'%s.%s' % (cname, zone)
ips.update(_san_dnsname_ips(cname, True)
return ips
2.7 and 3.6 are both giving me:
File "/tmp/test.py&q
On Fri, Mar 9, 2018 at 10:57 AM, Ben Finney wrote:
> Chris Angelico writes:
>
>> On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney
>> wrote:
>> > In many cases, those eyes can be virtual and non-human.
>> >
>> > That's what syntax highlighting, and tools even more impressive
>> > (e.g. linting tools
Chris Angelico writes:
> On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney
> wrote:
> > In many cases, those eyes can be virtual and non-human.
> >
> > That's what syntax highlighting, and tools even more impressive
> > (e.g. linting tools that run continually), offer in a programmer's
> > text edito
On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney wrote:
> Chris Angelico writes:
>
>> (Sometimes, you just need another pair of eyes.)
>
> In many cases, those eyes can be virtual and non-human.
>
> That's what syntax highlighting, and tools even more impressive (e.g.
> linting tools that run continua
Chris Angelico writes:
> (Sometimes, you just need another pair of eyes.)
In many cases, those eyes can be virtual and non-human.
That's what syntax highlighting, and tools even more impressive (e.g.
linting tools that run continually), offer in a programmer's text
editor: a pair of eyes lookin
Ian Pilcher writes:
> > ips.update(_san_dnsname_ips(cname, True)
> > return ips
>
> 2.7 and 3.6 are both giving me:
>
> File "/tmp/test.py", line 32
> return ips
> ^
> SyntaxError: invalid syntax
>
> I
On Fri, Mar 9, 2018 at 10:23 AM, Ian Pilcher wrote:
> (Because I certainly can't.)
>
>> ips.update(_san_dnsname_ips(cname, True)
>> return ips
>
>
> 2.7 and 3.6 are both giving me:
>
> File "/tmp/test.py", line 32
> re
for cname in cnames:
if not cname.endswith('.'):
cname = u'%s.%s' % (cname, zone)
ips.update(_san_dnsname_ips(cname, True)
return ips
2.7 and 3.6 are both giving me:
Fi
On Wed, 10 Aug 2016 06:20 am, Ltc Hotspot wrote:
> Hi, Everyone:
>
> What is the source of the following,
> 'error message: SyntaxError: invalid syntax (, line 2)'
>
> v. Python 3.3
>
> Code reads:
>
> x=1
> if x==1
> # indent 4 spaces
>
On 09Aug2016 20:22, Rob Gaddi wrote:
Ltc Hotspot wrote:
What is the source of the following,
'error message: SyntaxError: invalid syntax (, line 2)'
v. Python 3.3
Code reads:
x=1
if x==1
# indent 4 spaces
print "x = 1"
A missing colon, the appropriate location
Ltc Hotspot wrote:
> Hi, Everyone:
>
> What is the source of the following,
> 'error message: SyntaxError: invalid syntax (, line 2)'
>
> v. Python 3.3
>
> Code reads:
>
> x=1
> if x==1
> # indent 4 spaces
> print "x = 1"
>
Hi, Everyone:
What is the source of the following,
'error message: SyntaxError: invalid syntax (, line 2)'
v. Python 3.3
Code reads:
x=1
if x==1
# indent 4 spaces
print "x = 1"
Hal
--
https://mail.python.org/mailman/listinfo/python-list
;>> import matplotlib.pyplot as plt
>>> %matplotlib inline
SyntaxError: invalid syntax
What am I doing wrong? Suggested reading?
TIA,
Mike
--
https://mail.python.org/mailman/listinfo/python-list
win32
Type "copyright", "credits" or "license()" for more information.
>>> import numpy as np
>>> import pandas as pd
>>> import random
>>> import matplotlib.pyplot as plt
>>> %matplotlib inline
SyntaxError: invalid
quot;copyright", "credits" or "license()" for more information.
> >>> import numpy as np
> >>> import pandas as pd
> >>> import random
> >>> import matplotlib.pyplot as plt
> >>> %matplotlib inline
> SyntaxE
ht", "credits" or "license()" for more information.
>>>> import numpy as np
>>>> import pandas as pd
>>>> import random
>>>> import matplotlib.pyplot as plt
>>>> %matplotlib inline
> SyntaxError: invalid syntax
#x27;, dir = filepath, delete = False) as tf: tempfile = tf.name
>> with open(real_file, 'r') as f: for line in islice(f, 1, None):
>> tf.write(line) rename(tempfile, real_file)
>>
>> But that gave:
>> File "", line 6
>> rename(tempfile, real
tempfile = tf.name
> with open(real_file, 'r') as f:
> for line in islice(f, 1, None):
> tf.write(line)
> rename(tempfile, real_file)
>
> But that gave:
> File "", line 6
> rename(tempfile, real_file)
rite(line)
rename(tempfile, real_file)
But that gave:
File "", line 6
rename(tempfile, real_file)
^
SyntaxError: invalid syntax
Why?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.python.org/mailman/listinfo/python-list
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 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
On 12/11/2014 02:40 PM, Chris Angelico wrote:
On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote:
Please give your environment when starting a new thread. Python version and
OS version. In this case, I'm guessing Windows, because I have to guess
something to give a meaningful answer.
On 12/11
On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote:
> Please give your environment when starting a new thread. Python version and
> OS version. In this case, I'm guessing Windows, because I have to guess
> something to give a meaningful answer.
>
> On 12/11/2014 02:21 PM, Simon Evans wrote:
>> Py
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 more information.
cd Soup
File "", line 1
cd Soup
^
SyntaxError: invalid syntax
cd is not a
-
> 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 more information.
> >>> cd Soup
> File &qu
SC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> cd Soup
File "", line 1
cd Soup
^
SyntaxError: invalid syntax
>>>
--
Success.
Whats happening is that the second wget command is not recognizing the
--no-check-certificate. So I went around the problem and installed it manually.
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.zip
--no-check-certificate
unzip setuptools-7.0.zip
python2.7
Hi Chris,
Yep that got me closer. I found that using | sudo python2.7 was a bad command.
So I changed over to | python2.7.
[root@myserver tmp]# wget https://bootstrap.pypa.io/ez_setup.py
--no-check-certificate -O - | python2.7
--2014-12-01 12:57:07-- https://bootstrap.pypa.io/ez_setup.py
Re
t;", line 51
> with archive_context(archive_filename):
> ^
> SyntaxError: invalid syntax
When you run 'python', you apparently are getting the old version
still. Try 'python2.7' instead.
If you used a bash alias to change the meaning of the word
saved [10476/10476]
File "", line 51
with archive_context(archive_filename):
^
SyntaxError: invalid syntax
Any help or direction would be greatly appreciated.
Billy,
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, 14 Nov 2013 07:05:08 -0800, johannes.gunz97 wrote:
> Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann:
>> obviously total mewbiew:
>>
>> My first program in Python Windows
>>
>> print "Hello World"
>>
>> I select Run/Run Module and get an error:
>>
>> Syntax error, w
On 11/14/2013 10:05 AM, johannes.gun...@gmail.com wrote:
Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann:
obviously total mewbiew:
My first program in Python Windows
print "Hello World"
I assume you are running Python 3 in which case you need
print("Hello World")
--
Bob
Am Donnerstag, 12. März 2009 07:57:11 UTC+1 schrieb Henrik Bechmann:
> obviously total mewbiew:
>
> My first program in Python Windows
>
> print "Hello World"
>
> I select Run/Run Module and get an error:
>
> Syntax error, with the closing quote highlighted.
>
> Tried with single quotes as wel
On Thursday, March 12, 2009 3:25:53 PM UTC+8, John Machin wrote:
> On Mar 12, 5:57 pm, Henrik Bechmann wrote:
> > obviously total mewbiew:
> >
> > My first program in Python Windows
>
> What is that you are callind "Python Windows"? What version of Python
> are you running?
>
> 2.X: print "Hello
On Wed 09 Jan 2013 09:20:10 PM EST, andydtay...@gmail.com wrote:
Thanks for your help guys.
I was actually doing a few things wrong, but I have got this script to work by
declaring fields as varchar and all values as strings. But I would like to log
journey time values in hours/minutes, so I w
Thanks for your help guys.
I was actually doing a few things wrong, but I have got this script to work by
declaring fields as varchar and all values as strings. But I would like to log
journey time values in hours/minutes, so I will have to look into the following:
1. Retrieving this data from
xp.py", line 15
cursor.execute("INSERT INTO tubecross (station_code, SAJ, SPB, SOQ) VALUES (%s,
%s, %s, %s)",(SAJ, 00:00, 00:22, 00:27))
^
SyntaxError: invalid syntax
&qu
t;INSERT INTO tubecross (station_code, SAJ, SPB, SOQ) VALUES (%s,
%s, %s, %s)",(SAJ, 00:00, 00:22, 00:27))
^
SyntaxError: invalid syntax
Thanks for your help
00:00 etc are not quoted?
- mitya
--
Lark's Tongue Guide to Python: http://lightbird.net/larks/
--
http://mail.python.org/mailman/listinfo/python-list
her/TFLJPAPI$ python
creat_db_exp.py
File "creat_db_exp.py", line 15
cursor.execute("INSERT INTO tubecross (station_code, SAJ, SPB, SOQ) VALUES
(%s, %s, %s, %s)",(SAJ, 00:00, 00:22, 00:27))
In
andydtay...@gmail.com writes:
> I'm a bit stuck on this "INSERT INTO" syntax error. I have no idea why it's
What syntax error? It's always helpful if you can post the actual error
message.
> not working actually... I've tried changing column types to char but that
> didn't work. I've gone
Hi,
I'm a bit stuck on this "INSERT INTO" syntax error. I have no idea why it's not
working actually... I've tried changing column types to char but that didn't
work. I've gone a bit blind looking at it, but hopefully you can set me right.
With the '#'d out lines instead the file does work.
Wh
Thanks a lot guys. Seriously when u get stuck on such issues it really
drives u nuts and that is when this awesome comes to the rescue.
This python mailing list rocks.
On Wed, Nov 7, 2012 at 4:31 PM, Roy Smith wrote:
> In article ,
> Demian Brecht wrote:
>
> > On 2012-11-07, at 3:17 PM, Smara
In article ,
Demian Brecht wrote:
> On 2012-11-07, at 3:17 PM, Smaran Harihar wrote:
> > Any idea where am I going wrong?
>
> Looks like you're missing a closing parenthesis:
What I find is useful in situations like this is to just let emacs
auto-indent the code. When it starts indenting (o
On Wed, Nov 7, 2012 at 11:17 PM, Smaran Harihar
wrote:
> Hi guys,
>
> I am stuck in one of those non identifiable error location in the code. The
> code keeps giving invalid syntax. This is my code.
>
> I am using the same code for another code and not sure why this is not
>
On 2012-11-07, at 3:17 PM, Smaran Harihar wrote:
> Any idea where am I going wrong?
Looks like you're missing a closing parenthesis:
w.record(collection[i][0], MAT[0], TSD[0], AnnTMin[0], ANNPREC[0],
float(collection[i][2]), float(collection[i][1])
should be
w.record(collection[i][0], MAT[0]
Hi guys,
I am stuck in one of those non identifiable error location in the code. The
code keeps giving invalid syntax. This is my code<http://dpaste.com/826792/>
.
I am using the same code for another code and not sure why this is not
working. This is the traceback <http://dpaste.c
e the problem here?
>>
>> l=[]
>>>>> num=600851475143
>>>>> i=1
>>>>> while i<=num:
>>... if num%i==0:
>>... l.append(i)
>>... i+=1
>>... print max(l)
>> File "", line 5
>> print
>> i=1
>>>> while i<=num:
>... if num%i==0:
>... l.append(i)
>... i+=1
>... print max(l)
> File "", line 5
>print max(l)
>^
>SyntaxError: invalid syntax
You have to insert an empty line after the end of the while loop (befor
i==0:
> ... l.append(i)
> ... i+=1
> ... print max(l)
> File "", line 5
> print max(l)
> ^
> SyntaxError: invalid syntax
It is a indentation error. It should be like:
>>> while i<=num:
... if num%i==0:
... l.append(i)
... i+=1
...
>>> print max(l)
--
http://mail.python.org/mailman/listinfo/python-list
Just checked my version. Its showing 2.6.5.
>>> sys.version
'2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3]'
--
http://mail.python.org/mailman/listinfo/python-list
l.append(i)
> ... i+=1
> ... print max(l)
> File "", line 5
> print max(l)
> ^
> SyntaxError: invalid syntax
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Hi,
if you are using python 3, you'd (most likely) need to adapt
... l.append(i)
> ... i+=1
> ... print max(l)
> File "", line 5
> print max(l)
> ^
> SyntaxError: invalid syntax
>
>
You must be using Python 3. Along with many, many other changes, Python
3 uses a print function instead of a prin
Its an indentation error
--
A-M-I-T S|S
--
http://mail.python.org/mailman/listinfo/python-list
ot;, line 5
print max(l)
^
SyntaxError: invalid syntax
--
http://mail.python.org/mailman/listinfo/python-list
15 print("counter: ", counter
16
17 while (end == 0): #
<---returns syntax error on this while statement
Among other responses, there is no indent after print.
should be
print()
while x:
#now i
On Fri, Jan 7, 2011 at 8:55 PM, Chris Rebert wrote:
> On Fri, Jan 7, 2011 at 9:46 PM, Garland Fulton
> wrote:
>
> > 1 #!/bin/bash/python
>
> > What is
> > wrong with my shebang line?
>
> Its path is invalid (unless you're using a *very* weird system).
> /bin/bash is the bash shell executable
On Fri, Jan 7, 2011 at 9:46 PM, Garland Fulton wrote:
> 1 #!/bin/bash/python
> What is
> wrong with my shebang line?
Its path is invalid (unless you're using a *very* weird system).
/bin/bash is the bash shell executable; bash is completely unrelated
to Python. Further, /bin/bash is a file, n
On Fri, Jan 7, 2011 at 8:28 PM, Ned Deily wrote:
> In article
> ,
> Garland Fulton wrote:
> > I don't understand what I'm doing wrong i've tried several different
> cases
> > for what i am doing here. Will someone please point my error out.
>
> > 15 print("counter: ", counter
>
> Missi
In article
,
Garland Fulton wrote:
> I don't understand what I'm doing wrong i've tried several different cases
> for what i am doing here. Will someone please point my error out.
> 15 print("counter: ", counter
Missing ")" on line 15.
--
Ned Deily,
n...@acm.org
--
http://mail.p
On Fri, Jan 7, 2011 at 9:18 PM, Garland Fulton wrote:
> I don't understand what I'm doing wrong i've tried several different cases
> for what i am doing here. Will someone please point my error out.
> Thank you.
>
> 1 #!/bin/bash/python
This shebang undoubtedly erroneous.
> 5 if( 0 > x |
I don't understand what I'm doing wrong i've tried several different cases
for what i am doing here. Will someone please point my error out.
Thank you.
1 #!/bin/bash/python
2 import math
3 try:
4 x = int(input("Enter your number: "))
5 if( 0 > x | x > 2147483647):
6 r
How about you just isolate the first few lines
On Thu, Jan 14, 2010 at 2:43 PM, Ray Holt wrote:
> try:
> #open file stream
> file = open(file_name, "w"
> except IOError:
> print "There was an error writing to", file_name
> sys.exit()
Notice anything now? Something missing perhaps
Ray Holt wrote:
Why am I getting an invalid systax on the first except in the following
code. It was copid from the python tutorial for beginners. Thanks, Ray
import sys
try:
#open file stream
file = open(file_name, "w"
[snip]
Missing ")".
--
http://mail.python.org/mailman/listinfo/py
Why am I getting an invalid systax on the first except in the following
code. It was copid from the python tutorial for beginners. Thanks, Ray
import sys
try:
#open file stream
file = open(file_name, "w"
except IOError:
print "There was an error writing to", file_name
sys.exit()
pri
On Sun, Dec 20, 2009 at 08:40:05AM -0500, Ray Holt wrote:
> Why am I getting an invalid syntax error on the following:
> os.chdir(c:\\Python_Modules). The error message says the colon after c
You need to pass either a string literal or a variable. If you're
passing a string, like you
On Sun, 20 Dec 2009 08:40:05 -0500
"Ray Holt" wrote:
> Why am I getting an invalid syntax error on the following:
> os.chdir(c:\\Python_Modules). The error message says the colon after c is
You forgot the quotes around the string. I am not on Windows but I
think the followi
Putting quotemarks "" around the path would be a good start, I think.
Cheers,
Xav
On Sun, Dec 20, 2009 at 11:40 PM, Ray Holt wrote:
> Why am I getting an invalid syntax error on the following:
> os.chdir(c:\\Python_Modules). The error message says the colon after c is
> inv
Why am I getting an invalid syntax error on the following:
os.chdir(c:\\Python_Modules). The error message says the colon after c is
invalid syntax. Why is it saying this when I am trying to change directory
to c:\Python_Modules. Thanks, Ray
--
http://mail.python.org/mailman/listinfo/python-list
self.make = ConsProd.goods[2]
> self.tech = ConsProd.tech
> self.gross_production = (0.0,0.0,self. tech*G.L)
> ConsProd.total_production[2] += self.gross_production
> [2]
> G.cps3[self] = self.gross_production[2]
>
> the h
On Tue, 13 Oct 2009 23:54:58 +0100, MRAB wrote:
>> syntax error:
>> There' an error in your program: invalid syntax.
>>
> There are also a number of spelling mistakes.
Shame on you MRAB, you'll letting down the fine old Internet tradition
that anytime you poi
h = ConsProd.tech
self.gross_production = (0.0,0.0,self. tech*G.L)
ConsProd.total_production[2] += self.gross_production
[2]
G.cps3[self] = self.gross_production[2]
the hint is the small window at python:
syntax error:
There' an error in your pro
eeply appreciate!
the program is below:
the hint is the small window at python:
syntax error:
There' an error in your program: invalid syntax.
Always copy-and-paste the complete error message. Do not try to paraphrase or
retype the message.
Your problem is this line:
self.dema
f.gross_production = (0.0,0.0,self. tech*G.L)
ConsProd.total_production[2] += self.gross_production
[2]
G.cps3[self] = self.gross_production[2]
the hint is the small window at python:
syntax error:
There' an error in your program: invalid syntax.
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
Python Newsgroup wrote:
Gotcha, I got started from the telnet example listed in the docs. The
linux install was via yum and installed 2.x instead. That explains it.
Althought print (tn.read_all () ) runs in 2.x on linux.
I have another problem maybe you cna help me with. My telnet
Python Newsgroup wrote:
Gotcha, I got started from the telnet example listed in the docs. The
linux install was via yum and installed 2.x instead. That explains it.
Althought print (tn.read_all () ) runs in 2.x on linux.
I have another problem maybe you cna help me with. My telnet output
jibb
")
tn.write("ls\n")
tn.write("exit\n")
print tn.read_all()
Regardless of the script content, running in windows I constently get
this SyntaxError:
C:\Python30>python c:\Python30\scripts\telnet.py
File "c:\Python30\scripts\telnet.py", line 20
print tn
if password:
tn.read_until("Password: ")
tn.write(password + "\n")
tn.write("ls\n")
tn.write("exit\n")
print tn.read_all()
Regardless of the script content, running in windows I constently get
this SyntaxError:
C:\Python30>python c:\Python30\script
30\scripts\telnet.py
File "c:\Python30\scripts\telnet.py", line 20
print tn.read_all()
^
SyntaxError: invalid syntax
C:\Python30>
The same script works fine from linux.
I have also notices some other slight differences: this is my original
script that runs and completes but only if I commen
30\scripts\telnet.py
File "c:\Python30\scripts\telnet.py", line 20
print tn.read_all()
^
SyntaxError: invalid syntax
C:\Python30>
There's the clue:
In python 3.X, print is a function call
print(tn.read_all() )
with lots of formatting and line-ending features
In python 2.X, print
ord: ")
tn.write(password + "\n")
tn.write("ls\n")
tn.write("exit\n")
print tn.read_all()
Regardless of the script content, running in windows I constently get this
SyntaxError:
C:\Python30>python c:\Python30\scripts\telnet.py
File "c:\Python30\
On Thursday 12 March 2009 07:45:55 am Dotan Cohen wrote:
> I do not think that is the best way to go about learning Python. Why
> learn an arguably depreciating version when the new version is
> available.
Because it is not only the language that matters, you also need the libraries
to accomplis
On Mar 12, 7:45 am, Dotan Cohen wrote:
> > Welcome to the list. As a newbie myself, I ran into the Python3 vrs
> > 2.6 issue. May I suggest starting with 2.6? There is many more books
> > and internet stuff you can learn with in 2.6 - and the examples will
> > work. As Garry wrote, once you und
On 12 Mar, 12:45, Dotan Cohen wrote:
>
[starting with 2.6]
> I do not think that is the best way to go about learning Python. Why
> learn an arguably depreciating version when the new version is
> available. I agree that there are not many tutorial written for Python
> 3 however there are enough
> Welcome to the list. As a newbie myself, I ran into the Python3 vrs
> 2.6 issue. May I suggest starting with 2.6? There is many more books
> and internet stuff you can learn with in 2.6 - and the examples will
> work. As Garry wrote, once you understand 2.6, 3.0 will not be a
> challenge.
>
I
On Mar 12, 2:25 am, John Machin wrote:
> On Mar 12, 5:57 pm, Henrik Bechmann wrote:
>
> > obviously total mewbiew:
>
> > My first program in Python Windows
>
> What is that you are callind "Python Windows"? What version of Python
> are you running?
>
> 2.X: print "Hello World"
> should work.
>
>
On Mar 12, 5:57 pm, Henrik Bechmann wrote:
> obviously total mewbiew:
>
> My first program in Python Windows
What is that you are callind "Python Windows"? What version of Python
are you running?
2.X: print "Hello World"
should work.
3.X: print is now a function,
print("Hello World")
should wor
> obviously total mewbiew:
>
> My first program in Python Windows
>
> print "Hello World"
>
> I select Run/Run Module and get an error:
>
> Syntax error, with the closing quote highlighted.
>
> Tried with single quotes as well. Same problem.
>
> Can someone explain my mistake?
Are you using python
1 - 100 of 164 matches
Mail list logo