reload

How to refresh sys.path?

我们两清 提交于 2019-11-28 00:01:56
问题 I've installed some packages during the execution of my script as a user. Those packages were the first user packages, so python didn't add ~/.local/lib/python2.7/site-packages to the sys.path before script run. I want to import those installed packages. But I cannot because they are not in sys.path . How can I refresh sys.path ? I'm using python 2.7. 回答1: As explained in What sets up sys.path with Python, and when? sys.path is populated with the help of builtin site.py module. So you just

Reset ipython kernel

人盡茶涼 提交于 2019-11-27 22:56:35
问题 I was wondering if there is a way to restart the ipython kernel without closing it, like the kernel restart function that exists in the notebook. I tried %reset but that doesn't seem to clear the imports. 回答1: Even though it would be handy if %reset would clear the namespace and the cache for the imports (as in the notebook) one can explicitly reload a previously imported module using importlib.reload in python3.4 or imp.reload in python3.0-3.3 (and if needed reset the kernel in a second step

How to force page refreshes or reloads in jQuery?

北慕城南 提交于 2019-11-27 20:38:36
问题 The code below displays a Google map and search results when you enter an address and hit the submit button. I've been playing with it to try and force the page to completely refresh or reload once you hit the submit button. But I can't get it to work right. It loads the results "in page," but I'd like the page to completely refresh when the results load, like when you hit the back button on your browser. Hope that makes sense. I think the answer lies in this line of code but I don't know

How to refresh jqplot bar chart without redrawing the chart

会有一股神秘感。 提交于 2019-11-27 20:19:35
问题 I have a jqplot bar chart and I want the chart data to be changed when the user changes the value on a drop-down list. That works, but the problem is the bar chart redraws, one over another, each time the user changes the values. How can I update or reload the bars without drawing the whole thing again? Is there any property value to be set? Chart data changes according to an ajax call: $.ajax({ url: '/Home/ChartData', type: 'GET', data: { Id: Id }, dataType: 'json', success: function (data)

Reload/refresh page in browser without re-submitting form?

最后都变了- 提交于 2019-11-27 18:49:31
问题 I have a form on a php page that is submitted to the same page. I noticed that if I reload/refresh the page the form gets re-submitted. How do I code to avoid this in the most easy way? 回答1: One possibility is, to implement the post-redirect-get approach. Simply said, a POST request will be never delivered to the browser. Instead you execute all necessary actions and store the information you need in the session, and then you make a redirect with code 303. $page = 'show_result.php'; header(

hot reloading / swapping with Python [duplicate]

≡放荡痞女 提交于 2019-11-27 18:46:29
问题 This question already has an answer here: How do I unload (reload) a module? 18 answers I want code changes to take effect immediately during development. How can I detect changed files and reload them in the running Python (2.7) application? Edit: After reading the pages linked by 'Ivo van der Wijk', I think it would be best to restart the web application when code changes - like Django does. So the actual question is: How to monitor file modifications? 回答1: This question has been asked a

Change hash without reload in jQuery

徘徊边缘 提交于 2019-11-27 18:06:21
I have the following code: $('ul.questions li a').click(function(event) { $('.tab').hide(); $($(this).attr('href')).fadeIn('slow'); event.preventDefault(); window.location.hash = $(this).attr('href'); }); This simply fades a div in based on when you click but I want the page URL hash tag to change when you click so people can copy and bookmark it. At the moment this effectively reloads the page when the hash tag is change. Is it possible to change the hash tag and not reload the page to prevent the jumping effect? This works for me $('ul.questions li a').click(function(event) { event

Button that refreshes the page on click

允我心安 提交于 2019-11-27 18:03:59
I need a button that will refresh the page on the user's click. I tried this: <input type="button" value="Reload Page" onClick="reload"> or <input type="button" value="Refresh Page" onClick="refresh"> But neither worked. Use onClick with window.location.reload() , i.e. : <button value="Refresh Page" onClick="window.location.reload();"> Or history.go(0) , i.e.: <button value="Refresh Page" onClick="history.go(0);"> Or window.location.href=window.location.href for ' full ' reload, i.e.: <button value="Refresh Page" onClick="window.location.href=window.location.href"> This works for me HTML

How to reload a clojure file in REPL

血红的双手。 提交于 2019-11-27 16:38:00
What is the preferred way of reloading functions defined in a Clojure file without having to restart the REPL. Right now, in order to use the updated file I have to: edit src/foo/bar.clj close the REPL open the REPL (load-file "src/foo/bar.clj") (use 'foo.bar) In addition, (use 'foo.bar :reload-all) does not result in required effect, which is evaluating the modified bodies of functions and returning new values, instead of behaving as the source haven't changed at all. Documentation: load-file use Or (use 'your.namespace :reload) papachan There is also an alternative like using tools.namespace

Javascript: How to truly reload a site with an anchor tag?

旧街凉风 提交于 2019-11-27 15:34:59
问题 Take this code snippet for example: window.location.href = 'mysite.htm#images'; Already being on the site mysite.htm and triggering the reload thru location.href won't reload the page but jump to the anchor named within the URL. I need a mechanism to truly reload the page. Any ideas? PS: I tried location's other methods but none of them does the trick :( EDIT Don't hang on the filetype htm . I'd need it for dynamic sites as well. 回答1: After you set the specified URL into location, issue