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
;>> 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 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
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 Feb 7, 10:21 pm, ajaksu <[EMAIL PROTECTED]> wrote:
> On Feb 7, 12:52 pm, [EMAIL PROTECTED] wrote:
>
> > I try to install Python in a Dell D620 with XP PRO version 5.1.2600
> > and I am getting this error. I assume that some dlls are missing but I
> > installed form a fresh python-2.5.1.msi with
On Feb 7, 12:52 pm, [EMAIL PROTECTED] wrote:
> I try to install Python in a Dell D620 with XP PRO version 5.1.2600
> and I am getting this error. I assume that some dlls are missing but I
> installed form a fresh python-2.5.1.msi without errors msg.
>
> Thanks
>
> Roberto
What is the install path
On Feb 7, 2008 8:52 AM, <[EMAIL PROTECTED]> wrote:
> I try to install Python in a Dell D620 with XP PRO version 5.1.2600
> and I am getting this error. I assume that some dlls are missing but I
> installed form a fresh python-2.5.1.msi without errors msg.
>
> Thanks
>
> Roberto
>
>
Sounds like a
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
File "", line 1
import this
^
SyntaxError: invalid syntax
>>> 2 + 2
File "", line 1
2 + 2
n, and someone with mysqldb
installed could try to reproduce your problem.
>
> exact error message: SyntaxError: Invalid Syntax
Inexact! The message would have been
SyntaxError: invalid syntax
Please *DON'T* type in what you think you remember you think you saw on
the screen; *COPY/PAS
ronrsr wrote:
> the syntax error comes in the main program, in any line that follows
> the import statement.
>
in which case, don't you think it might be the "import" statement that's
causing the problem. What is stopping you from showing us the whole
source? Or at least the import statement as
s code to be compiled.
> exact error message: SyntaxError: Invalid Syntax
a complete syntax error usually includes a traceback:
Traceback (most recent call last):
File "program.py", line 1, in
import module
File "module.py", line 25
if 1
^
SyntaxE
the syntax error comes in the main program, in any line that follows
the import statement.
ronrsr wrote:
> the exact code that is triggering the error message is:
>
> zc = zsql.connect()
>
>
> exact error message: SyntaxError: Invalid Syntax
>
>
> but any statem
the exact code that is triggering the error message is:
zc = zsql.connect()
exact error message: SyntaxError: Invalid Syntax
but any statement that follows the import statement will trigger it.
bests,
r-sr-
Roberto Bonvallet wrote:
> ronrsr wrote:
> > thanks for the spee
ronrsr wrote:
> thanks for the speedy answer. what i meant was:
>
> return MySQLdb.connect (host = "db91b.pair.com",
> user = "homebase",
>passwd = "Newspaper2",
>db = "homebase_zingers"
> );
thanks for the speedy answer. what i meant was:
return MySQLdb.connect (host = "db91b.pair.com",
user = "homebase",
passwd = "Newspaper2",
db = "homebase_zingers"
);
but even when I have
In <[EMAIL PROTECTED]>, ronrsr wrote:
> def connect():
>
>
>return = MySQLdb.connect (host = "db91x..com",
^
You can't assign to a keyword. Just leave this ``=`` out.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list
here's some of the surrounding code from the main program:
querystring = querystring + " ORDER BY keywords ";
#SQL
import zsql
zc = zsql.connect()
print("return from open")
zq = zc.query(querystring).dictresult()
ronrsr wrote:
> no matter where I place this imported file,the statement
ronrsr wrote:
> return = MySQLdb.connect (host = "db91x..com",
> user = "",
>passwd = "x",
>db = "homebase_zingers"
> );
return is a reserved keyword. You cannot have a variable
no matter where I place this imported file,the statement after it in
the main program gets a syntax error, regardless of the syntax.
I think I may have changed something in this file, but I'm stuck. Can
anyone help?
#!/usr/local/bin/python
# Copyright 2004 by Stephen Masterman
#Change the db co
On Tue, 27 Dec 2005 09:32:18 GMT
"DIBS" <[EMAIL PROTECTED]> wrote:
> >>> python sudoku.py
> File "", line 1
>python sudoku.py
> ^
>
> >>>SyntaxError: invalid syntax
>
> Thanks for your help.
&g
"DIBS" <[EMAIL PROTECTED]> wrote:
> >>> python sudoku.py
> File "", line 1
>python sudoku.py
> ^
>
> >>>SyntaxError: invalid syntax
> Thanks for your help.
> The above is the extact message.
th
>>> python sudoku.py
File "", line 1
python sudoku.py
^
>>>SyntaxError: invalid syntax
Thanks for your help.
The above is the extact message.
DIBS
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message
news
Steven D'Aprano wrote:
> Please post the *full* traceback of the error, not just the last
> description.
>
> For example, something like this:
>
> >>> x = x+*9
> File "", line 1
> x = x+*9
> ^
> SyntaxError: invalid syntax
&
On Tue, 27 Dec 2005 07:40:12 +, DIBS wrote:
> I'm new to Python and I don't understand what I'm doing wrong.
>
> I'm running windows xp.
>
> In the command line window, I type:
> Python Sudoku.py
>
> and I get the response"
>
> Synt
I'm new to Python and I don't understand what I'm doing wrong.
I'm running windows xp.
In the command line window, I type:
Python Sudoku.py
and I get the response"
SyntaxError: invalid syntax
If anyone cane help me I'd be very grateful.
--
http://mail.pyth
47 matches
Mail list logo