Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I am trying to run a simple tutorial I found using VSCode and Seaborn. This code runs in pycharm fine with the chart popping up, but in VSCode nothing happens. No error code or anything.
With Pycharm it runs fine and I get the pop-up with the chart. Any ideas?
'''
import seaborn as sns
import matplotlib.pyplot as plt
df = sns.load_dataset("penguins")
sns.jointplot(data=df, x="flipper_length_mm", y="bill_length_mm", hue="species")
plt.show()
'''
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 days ago.
The community is reviewing whether to reopen this question as of 5 days ago.
Improve this question
I am new to programming/python. I have installed python v3.10 and other dependencies and using PyCharm as IDE.
I created new porject from IDE and did pip install backtrader[plotting] from terminal. After that I created new python file and copied code from its documentation. However run button is disabled for the project.
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import backtrader as bt
if __name__ == '__main__':
cerebro = bt.Cerebro()
print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue())
cerebro.run()
print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())
I am following backtrader documentation from https://www.backtrader.com/docu/quickstart/quickstart/
Your help/pointer towards how to get started on this is highly appreciated. Thanks!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I want to print some data from spreadsheet. I decided to use python. How can I call out a "Print preview"? For example like this:
I tried something like this:
os.startfile('test.txt', 'print')
but it doesn't make a print preview.
I am using Python 3.9.
Use this (tested on Windows 10):
import subprocess
subprocess.call(['notepad', '/p', "test.txt"])
On Linux use:
import os
os.system("lp text.txt")
As to previewing the file on screen, just use print function. If you want graphics use tkinter or any other graphics library (PyQt, etc)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am creating a python tkinter application which always stays on the desktop. To do this, I need to check whether any other window is maximized or not, similar to WS_MAXIMIZE in Visual Basic .NET, or GetWindowPlacement API. Is there any way to do this?
Looking forward to your replies!
You can use pip install pygetwindow to get pygetwindow
import pygetwindow as gw
notepadWindow = gw.getWindowsWithTitle('Untitled')[0]
notepadWindow.isMaximized
Here I have a notepad open and am checking if it is maximised or minimsed!
Documentation for help: https://pypi.org/project/PyGetWindow/
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
ImportError: cannot import name 'HTML' from 'IPython' (C:\Users\sriva\Anaconda3\lib\site-packages\IPython\__init__.py)
you should import html like this:
from IPython.display import HTML
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Is it possible to implement the following style of graph in Python?
http://fivethirtyeight.com/features/every-nba-teams-chance-of-winning-in-every-minute-across-every-game/
I specifically require being able to hover (or click) on a data point and the whole line is then highlighted while the others are made dull.
Yes! Matplotlib is probably your best bet, although there are also a lot of newer libraries such as Bokeh with similar functionalities.
See this question for more detail on how to use Matplotlib and this one, for a better hover implementation.
Here's a great walk-through of a variety of options for making this sort of graph: http://nbviewer.ipython.org/gist/msund/11349097