space

How to get rid of spaces when printing text and variables in python

强颜欢笑 提交于 2019-12-02 00:44:09
I want to make it so the user enters his name/age and it outputs the name and age in ten years. I have set it out like this: print("Let's find out how old you will be in 10 Years.\n") name = input("name: ") print("\nNow enter your age,",name,"\n") age = int(input("age: ")) ageinten = age + 10 print("\n",name,"you will be",ageinten,"in ten years.") input("Press Enter to close") The output is like this: Let's find out how old you will be in 10 Years. name: Example Now enter your age, Example age: 20 Example you will be 30 in ten years. Press Enter to close But I want it without the space before

Script not recieving url properly

…衆ロ難τιáo~ 提交于 2019-12-01 21:01:55
问题 I am using a combined batch and java script I found to retrieve the html from a web site using a batch file and one we address is not returning the desired output as it appears when I use the url in firefox. The script I am using to pull the html is: @if (@This==@IsBatch) @then @echo off rem **** batch zone ********************************************************* setlocal enableextensions disabledelayedexpansion rem Batch file will delegate all the work to the script engine if not "%~1"==""

Script not recieving url properly

喜夏-厌秋 提交于 2019-12-01 19:25:53
I am using a combined batch and java script I found to retrieve the html from a web site using a batch file and one we address is not returning the desired output as it appears when I use the url in firefox. The script I am using to pull the html is: @if (@This==@IsBatch) @then @echo off rem **** batch zone ********************************************************* setlocal enableextensions disabledelayedexpansion rem Batch file will delegate all the work to the script engine if not "%~1"=="" ( cscript //E:JScript "%~dpnx0" %1 ) rem End of batch area. Ensure batch ends execution before reaching

What's wrong with putting spaces in $_GET variables

不问归期 提交于 2019-12-01 17:52:05
If I for example have my url looking like index.php?category=IT%20&%20Soft. Then i try to print "$_GET[category]" i only get "IT" and not "IT & Soft". What is wrong here? It's frustrating me. The problem is not the spaces, but the ampersand. Use %26 instead, like this: index.php?category=IT%20%26%20Soft The ampersand indicates that you are beginning another field (like category=IT&subcategory=somethingelse ). You can see a list of reserved characters on Wikipedia . Spaces and ampersands (&) aren't valid and need to be encoded for use in parameter values. Run your arguments through 'urlencode'

ChartJS – is there any way to remove blank space around pie charts?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 16:42:57
I am dealing with a chart that has unwanted spacing on left and right side. I've been trying to remove it with no luck, and I don't know what else to do now. I've read the documentation thoroughly, but can't seem to find a solution. Is this possible to do? Let me know if more info is necessary, and I'll supply it. Edit: <div> <canvas id="chart-gender"></canvas> </div> <script> var gender_data = [10, 35]; var graph_gender_preset = { labels: ["Female", "Male"], datasets: [ { data: gender_data, backgroundColor: ["#0fa0e3", "#ff3549"] } ] }; var ctx3 = $("#chart-gender"); var chart_gender = new

writing fixed width, space delimited CSV output in Python

坚强是说给别人听的谎言 提交于 2019-12-01 16:31:26
I would like to write a fixed width, space delimited and minimally quoted CSV file using Python's csv writer. An example of the output: item1 item2 "next item1" "next item2" anotheritem1 anotheritem2 If I use writer.writerow( ("{0:15s}".format(item1), "{0:15s}".format(item2)) ) ... then, with the space delimiter, the formatting is broken as either quotes or escapes (depending on the csv.QUOTE_* constant) are added due to the trailing spaces of the items formatting: "item1 " "item2 " "next item1 " "next item2 " "anotheritem1 " "anotheritem2 " Of course, I could format everything myself: writer

What's wrong with putting spaces in $_GET variables

。_饼干妹妹 提交于 2019-12-01 16:16:57
问题 If I for example have my url looking like index.php?category=IT%20&%20Soft. Then i try to print "$_GET[category]" i only get "IT" and not "IT & Soft". What is wrong here? It's frustrating me. 回答1: The problem is not the spaces, but the ampersand. Use %26 instead, like this: index.php?category=IT%20%26%20Soft The ampersand indicates that you are beginning another field (like category=IT&subcategory=somethingelse ). You can see a list of reserved characters on Wikipedia. 回答2: Spaces and

ChartJS – is there any way to remove blank space around pie charts?

丶灬走出姿态 提交于 2019-12-01 15:39:57
问题 I am dealing with a chart that has unwanted spacing on left and right side. I've been trying to remove it with no luck, and I don't know what else to do now. I've read the documentation thoroughly, but can't seem to find a solution. Is this possible to do? Let me know if more info is necessary, and I'll supply it. Edit: <div> <canvas id="chart-gender"></canvas> </div> <script> var gender_data = [10, 35]; var graph_gender_preset = { labels: ["Female", "Male"], datasets: [ { data: gender_data,

MYSQL TINYBLOB vs LONGBLOB

亡梦爱人 提交于 2019-12-01 15:08:14
This is a follow up for my previous question: Blob and Storage Requirement I did some testing using SHOW TABLE STATUS , and found out that the total disk space used actually only depends on the size of actual files uploaded to the database and not on the type (e.g. TINYBLOB or LONGBLOG) of the column. So, if that's not the case then what difference does make when we choose one over the other of the BLOB types? Each size of blob field reserves extra bytes to hold size information. A longblob uses 4+n bytes of storage, where n is the actual size of the blob you're storing. If you're only ever

how to define a space in a regular expression (in awk)?

拥有回忆 提交于 2019-12-01 12:56:35
I want to print the texts inside of " " . for example I have the following strings: gfdg "jkfgh" "jkfd fdgj fd-" ghjhgj gfggf "kfdjfdgfhbg" "fhfghg" jhgj jhfjhg "dfgdf" fgf fgfdg "dfj jfdg jhfgjd" "hfgdh jfdhgd jkfghfd" hgjghj And I want to print only the following: "jkfgh" "jkfd fdgj fd-" "kfdjfdgfhbg" "fhfghg" "dfgdf" "dfj jfdg jhfgjd" "hfgdh jfdhgd jkfghfd" I have tried awk with the following regular expression: awk '{for(i = 1; i <= NF; i++) if($i ~ /^\"[A-Za-z.$]*([A-Za-z.$][[:space:]]*[A-Za-z.$])*\"$/) print $i}' sample.txt but it prints everything before space and actually does not