If I run echo a; echo b in bash the result will be that both commands are run. However if I use subprocess then the first command is run, printing out the whole of the rest of the line. The code below echos a; echo b instead of a b, how do I get it to run both commands? Answer
Tag: python
tkinter – screen width and height of secondary display?
I have a dual monitors set up (laptop screen and external monitor). My laptop screen is my primary display and external monitor is secondary. Both have different screen sizes. In my python tkinter script, i have used winfo_screenwidth() and winfo_screenheight() to detect the screen width and height so that I …
Boxplots in matplotlib: Markers and outliers
I have some questions about boxplots in matplotlib: Question A. What do the markers that I highlighted below with Q1, Q2, and Q3 represent? I believe Q1 is maximum and Q3 are outliers, but what is Q2? Question B How does matplotlib identify outliers? (i.e. how does it know that they are…
using “getElementsByTagName” to get tag in python
my XML file is my code is I want to get value of element with tagname ‘string name=”ID”‘ but the error comes if i replace to the output comes “nCGhwaZNpy6” since its the first element of that list but second element is “02.11.2013 Scott Mobile” which also get sa…
How do I uninstall python from web platform installer?
I’ve installed python and some other packages using web platform installer, but I was having some issues getting a Django project to work so I uninstalled everything and am trying to get it going from scratch. Web Platform Installer still shows that I have ‘Windows Azure SDK for Python” and …
sqlalchemy generic foreign key (like in django ORM)
Does sqlalchemy have something like django’s GenericForeignKey? And is it right to use generic foreign fields. My problem is: I have several models (for example, Post, Project, Vacancy, nothing special there) and I want to add comments to each of them. And I want to use only one Comment model. Does it w…
Does Python intern strings?
In Java, explicitly declared Strings are interned by the JVM, so that subsequent declarations of the same String results in two pointers to the same String instance, rather than two separate (but identical) Strings. For example: My question is, does CPython (or any other Python runtime) do the same thing for …
how to play wav file in python?
I tried pygame for playing wav file like this: but It change the voice and I don’t know why! I read this link solutions and can’t solve my problem with playing wave file! for this solution I dont know what should I import? and for this solution /dev/dsp dosen’t exist in new version of linux …
Beautifulsoup sibling structure with br tags
I’m trying to parse a HTML document using the BeautifulSoup Python library, but the structure is getting distorted by <br> tags. Let me just give you an example. Input HTML: HTML that BeautifulSoup interprets: In the source, the spans could be considered siblings. After parsing (using the default …
Saving custom user model with django-allauth
I have django custom user model MyUser with one extra field: I also have according to these instructions custom all-auth Signup form class: After submitting SignupForm (field for property MyUser.age is rendered corectly), I get this error: IntegrityError at /accounts/signup/ (1048, “Column ‘age…