标签: syntax-error

Python:不存在的行上的无效语法错误

我正在使用 Notepad ++ 编写代码,但在不额外的行上不断收到无效语法错误。

代码在第 54 行停止,并表示错误出现在第 55 行。

我假设这是一个与复制和粘贴相关的错误,但我似乎找不到修复它的方法。

任何建议都会很棒。

编辑 - 第 53 / 54 行代码;

city = hashmap.get(cities,'TX', '不存在')

print "'TX' 州的城市是:%s" % city

我得到的错误是;

文件 ex38.py,第 55 行 ^ SytanError:无效 sytanx

python syntax-error

-2
推荐指数
1
解决办法
9950
查看次数

我无法在 Visual Studio Code 中编写 CSS 边距

我是 Visual Studio Code 的新手,正在学习 html 和 css,我正在学习使用边距,然后我注意到我无法在文件 css 中的 Visual Studio 代码中编写边距。这是我的示例代码:

.headerContainer{
    background-color: red;
    width: 40%
    margin:auto
}
Run Code Online (Sandbox Code Playgroud)

它一直给我错误分号预期的CSS(css-semicolonexpected)

我希望我需要在 Visual Studio Code 中进行一些更改

html css margins syntax-error visual-studio-code

-2
推荐指数
1
解决办法
117
查看次数

另一个PHP语法错误

这是错误:

解析错误:语法错误,第9行/home/idghosti/public_html/testground/mma/include/footer.php中的意外'}'

这是代码:

<?php
    } else {
        error_reporting(0);

        if  (mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"))

        //Message sent!
        //It the message that will be displayed when the user click the sumbit button
        //You can modify the text if you want
        echo nl2br("
        <div class=\"MsgSent\">
            <h1>Congratulations!!</h1>
            <p>Thank you <b>$name</b>, your message is sent!<br /> We will get back to you as soon as possible.</p>
        </div>
       ");

        else

        // Display error message if the message failed to send
        echo "
        <div class=\"MsgError\"> …
Run Code Online (Sandbox Code Playgroud)

php syntax-error

-3
推荐指数
1
解决办法
250
查看次数

Python语法错误,'break'在循环之外

try:

    ip = float(input("Enter a number to find it's absolute value (press 'e' to exit):"))
    if ip == 'e':
        break
Run Code Online (Sandbox Code Playgroud)

Python说断裂不在循环中.有没有人有任何想法如何解决这个问题?提前致谢.

python loops syntax-error break

-3
推荐指数
1
解决办法
9639
查看次数

语法错误...找不到它

下面的SQL语法中有一个错误,据说是在最后一行(结束:"));")根据抛出的错误.我看不出有什么不对.这里有人发现它吗?

没有其他错误抛出.只是语法错误.但是,它声明"......在......'附近使用正确的语法",但引用第244行,即执行结束.

$save = $database->prepare('INSERT INTO checklists VALUES(:id, :name, :user, :agent, :status, :date_created, :date_submitted, :last_updated, :technique, :machine, :ink, :finish, :item, :thickness, :rolls, :sheets, :deformation, :deformation_details, :surface, :surface_details, :process, :process_details, :quality, :quality_details, :drying, :drying_details, :finishing, :finishing_details, :reason, :how, :uid');
$save->execute(array(
    ':id' => ' ',
    ':name' => $name,
    ':user' => $printer,
    ':agent' => $agent,
    ':status' => '0',
    ':date_created' => $stamp,
    ':date_submitted' => $sub,
    ':last_updated' => $stamp,
    ':technique' => '',
    ':machine' => '',
    ':ink' => '',
    ':finish' => '',
    ':item' => '',
    ':thickness' …
Run Code Online (Sandbox Code Playgroud)

php sql syntax pdo syntax-error

-3
推荐指数
1
解决办法
70
查看次数

SQL WHERE语法错误

当我跑:

$query = "UPDATE subjects SET
               menu_name = '{$menu_name}',
               position = {$position},
               visible =  {$visible},
               WHERE ID = {$ID}";
$result = mysql_query($query, $connection);
Run Code Online (Sandbox Code Playgroud)

我回来了:

您的SQL语法有错误; 检查与MySQL服务器版本对应的手册,以便在第5行的"WHERE ID = 1"附近使用正确的语法

php mysql syntax-error

-3
推荐指数
1
解决办法
45
查看次数

解析错误:语法错误,第107行意外T_VARIABLE

以下代码中的第107行是

$sql="INSERT INTO " $table_name " (confirm_code,name,password,email,address,phone,education,date_of_birth) VALUES 
        ('".$confirm_code."','".$name."','".$pwd."','".$email."','".$adres."','".$phno."','".$educon."','".$dob."') "; "
Run Code Online (Sandbox Code Playgroud)

我得到了意想不到的T_VARIABLE;

<?php
if(isset($_POST['Register']))
{ 
    $name= $_POST['uname'];
    $pwd= $_POST['pswd'];
    $email= $_POST['email'];
    $phno= $_POST['phno']; 
    $adrs= str_replace("'","`",$_POST['adres']);
    $adres  =   $adrs;
    $educon= $_POST['educon']; 
    $dob= $_POST['dob'];
    $chkname    =   "select email from ".USREG." where email='".$email."'";
    $res        =       mysql_query($chkname, $con) or die(mysql_error());
    $chkresult=mysql_fetch_array($res);
    $uemail= $chkresult['email'];
     //print_r($uemail);die();
     include ('config.php');
     $table_name=temp_members_db;
     $confirm_code=md5(uniqid(rand()));
        if($uemail==$email)
        {
            echo ' <p style="color:red">Email <b> '.$email.' </b> Already exists</p>';
        }
        else
        {
            $sql="INSERT INTO " $table_name      "(confirm_code,name,password,email,address,phone,education,date_of_birth) VALUES 
             ('".$confirm_code."','".$name."','".$pwd."','".$email."','".$adres."','".$phno."','".$educon."','".$dob."') ";
             $result  = mysql_query($sql, $con) …
Run Code Online (Sandbox Code Playgroud)

php syntax-error

-3
推荐指数
1
解决办法
4217
查看次数

Python'else'语句 - 无效语法

我是Python的新手,并一直试图为我的Murmur服务器设置一个小显示器.

我试图完成以下内容但未能弄清楚问题是什么.

任何帮助将不胜感激!:)

usersnotauth=0
users=server.getUsers()
for key in users.keys():
  if (users[key].userid == -1):
    usersnotauth+=1

if users > 0:

    lcd.set_cursor_position(0, 0)
    backlight.rgb(255,255,255)
    lcd.write("Online Users: %1" % users

else:

    lcd.set_cursor_position(0, 0)
    lcd.write("No Online Users")
    backlight.rgb(0,0,0)
Run Code Online (Sandbox Code Playgroud)

错误:

File "MurmurDisplay.py", line 81
    else:
       ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

python if-statement syntax-error

-3
推荐指数
1
解决办法
958
查看次数

解析错误:语法错误,第39行意外"20"(T_LNUMBER)

你好伙计我在这个脚本中有问题解析错误:语法错误,第39行意外'20'(T_LNUMBER)

<?php  
  header('Content-type: text/plain; charset=utf-8'); 
  echo '<p>Zamowienie przyjete o: <br/>'; 
  echo date('H:i.jSF'); 
  echo '</p>';  //Opis do daty //H - godzina w systemie 24 H // i - minuty // j - dzien miesiaca   //S - przedrostek porzadkowy TH //F - miesiac dodany slownie   
  echo'<p>Panstwa zamowienie wyglada nastepujaco: </p>'; 
  echo $_POST['iloscopon'].'&nbsp opon</br>'; 
  echo $_POST['iloscoleju'].'&nbsp oleju</br>'; 
  echo $_POST['iloscswiec'].'&nbsp swiec</br>'; 
  echo $_POST['ilosczarowek'].'&nbsp ?arówki</br>'; 
  echo $_POST['ilosctlokow'].'&nbsp t?oki</br>';   // zliczanie ilosci zamowionych towarow   $ilosc=0;
  $ilosc=$_POST['iloscopon']+$_POST['iloscoleju']+$_POST['iloscswieac']+$_POST['ilosczarowek']+$_POST['ilosctlokow']; 
  echo 'Ilosc zamowionych towarow: '.$ilosc.'<br/>';   //zliczanie wartosci zamowionych towarow   $wartosc=0.00; …
Run Code Online (Sandbox Code Playgroud)

php post syntax-error

-3
推荐指数
1
解决办法
938
查看次数

ActionScript synax错误

因为2.0就像java,现在在3.0中,我在这段代码中找不到我的错误:

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;
public class Main {
public static void main(String[] args){
String hostName = "localhost";
Int portNumber = 16834;
String str = "starttimer\r\n"; 
try {
    @SuppressWarnings("resource")
    Socket socket = new Socket(hostName, portNumber);
    OutputStreamWriter osw = new <br>OutputStreamWriter(socket.getOutputStream(), "UTF-8");$
    send(str, osw);
} catch (Exception e) {
        System.err.println(e.getMessage());
    }
}
static void send(String str, OutputStreamWriter o) throws IOException {
    o.write(str, 0, str.length());
    o.flush();
}
Run Code Online (Sandbox Code Playgroud)

}
顺便说不要担心哪里是去数据

syntax-error actionscript-3

-3
推荐指数
1
解决办法
26
查看次数