Re: Display, EasyProcess
Larry Martell wrote: > I have some code that uses the pyvirtualdisplay package and it works fine. > > pyvirtualdisplay,Display calls EasyProcess like this: > >@classmethod >def check_installed(cls): >EasyProcess([PROGRAM, '-help'], url=URL, >ubuntu_package=PACKAGE).check_installed() > > I made a branch and made some changes. In the branch, when I > instantiate Display and it gets to this point it fails with: > > TypeError: __init__() got an unexpected keyword argument 'url' I took a look at the source, and the code causing the error was removed back in december: https://github.com/ponty/PyVirtualDisplay/commit/37613e36cf311bf855ac0af7850ffc85ac0635c6#diff-cdb8c67ac0a9554cd28f4f4bfc06fcf4 I suggest that you update your version of the pyvirtualdisplay package. -- https://mail.python.org/mailman/listinfo/python-list
pip UX studies: Test pip's new resolver and help us document dependency conflicts
Hi there, It's Bernard and Nicole from the pip Team. The team is working on the improving the way that pip resolves package dependency conflicts. We're asking for your help to test pip's new resolver. We're especially interested in hearing from people who have projects with complex dependencies. By complex dependencies we mean projects that look like this: - have at least 10 package dependencies - some package are pinned to specific versions - that you always have a dependency issue when installing it - you have to put in hacks, workarounds, or fixes Currently, we’re trying to discover all the ways in which pip‘s dependency resolver fails, so that we can work out what error messages and/or debugging information we should display. You can find out what we'd like you to do on this blog post: http://www.ei8fdb.org/thoughts/2020/05/test-pips-alpha-resolver-and-help-us-document-dependency-conflicts/ If you're into social media, we'd appreciate if you'd boost these messages too: https://twitter.com/nlhkabu/status/1263132447971172352 https://social.ei8fdb.org/@bernard/104205537250874117 You can sign-up for other UX Studies also: http://www.ei8fdb.org/thoughts/2020/03/pip-ux-study-recruitment/ If you've got any questions, reply here off or on-list. Thanks, Bernard & Nicole pip Team UX -- Bernard Tyers, User research & Interaction Design Sane UX Design Twitter: @bernardtyers PGP Key: keybase.io/ei8fdb I am currently working with the Python Software Foundation, and Open Technology Fund -- https://mail.python.org/mailman/listinfo/python-list
Getting value of a variable without changing the expression in Python
Lets say i have a expression: flowrate=(veloctiy*area) i can find the flowrate with this expression but if i dont wanna change the expression and want to find the velocity by giving it value of area and flowrate ,how do i do this in python? is there any library or package or module for this? -- https://mail.python.org/mailman/listinfo/python-list
Re: Getting value of a variable without changing the expression in Python
On 5/21/20 5:56 AM, [email protected] wrote: > Lets say i have a expression: > flowrate=(veloctiy*area) > i can find the flowrate with this expression > but if i dont wanna change the expression and want to find the velocity by > giving it value of area and flowrate ,how do i do this in python? > is there any library or package or module for this? Python, like most computer languages doesn't directly support that sort of operation, one key point here is that in that context = means assign, or change to, and implies that the name on the left takes on the value to the right. There may be a library somewhere that allows you to pass "flowrate=veloctiy*area" (note, changed to a string) and the values for flowrate and area and it solves for veloctiy. Or a library where you do something like def flowrate_fun(veloctiy): return veloctiy*area veloctiy = solve(flowrate_fun, flowrate) i.e. you pass a function and it finds what input make the function have a give value. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list
Re: Getting value of a variable without changing the expression in Python
[email protected] wrote: > Lets say i have a expression: > flowrate=(veloctiy*area) > i can find the flowrate with this expression > but if i dont wanna change the expression and want to find the velocity by > giving it value of area and flowrate ,how do i do this in python? is there > any library or package or module for this? With sympy ttps://docs.sympy.org/latest/tutorial/intro.html you can write: >>> import sympy >>> f, v, a = sympy.symbols("flowrate velocity area") >>> sympy.solve(v*a - f, a) [flowrate/velocity] >>> sympy.solve(v*a - f, f) [area*velocity] -- https://mail.python.org/mailman/listinfo/python-list
Installation Error
Hi, I have been learning and using Python to create a program to play Mah Jongg and it was going well until my windows 10 computer started receiving an update. My computer restarted and Python was gone. I have attempted to reinstall with a message that the install was successful. When I started to use it I got the following message. pythonw.exe - System Error The code execution cannot proceed because python38.dll was not found. Reinstalling the program may fix this problem. I have reinstalled python several times. Repaired it several times but continue to get the same error. I uninstalled the bad Windows update but still had the same problem trying to get python running. Please help, Charlie Seagraves -- https://mail.python.org/mailman/listinfo/python-list
Re: Display, EasyProcess
On Thu, May 21, 2020 at 3:44 AM Peter Otten <[email protected]> wrote: > > Larry Martell wrote: > > > I have some code that uses the pyvirtualdisplay package and it works fine. > > > > pyvirtualdisplay,Display calls EasyProcess like this: > > > >@classmethod > >def check_installed(cls): > >EasyProcess([PROGRAM, '-help'], url=URL, > >ubuntu_package=PACKAGE).check_installed() > > > > I made a branch and made some changes. In the branch, when I > > instantiate Display and it gets to this point it fails with: > > > > TypeError: __init__() got an unexpected keyword argument 'url' > > I took a look at the source, and the code causing the error was removed back > in december: > > https://github.com/ponty/PyVirtualDisplay/commit/37613e36cf311bf855ac0af7850ffc85ac0635c6#diff-cdb8c67ac0a9554cd28f4f4bfc06fcf4 > > I suggest that you update your version of the pyvirtualdisplay package. Thanks. That did the trick! -- https://mail.python.org/mailman/listinfo/python-list
Re: Installation Error
On 21/05/2020 5:28 am, Charles Seagraves wrote: Hi, I have been learning and using Python to create a program to play Mah Jongg and it was going well until my windows 10 computer started receiving an update. My computer restarted and Python was gone. I have attempted to reinstall with a message that the install was successful. When I started to use it I got the following message. pythonw.exe - System Error The code execution cannot proceed because python38.dll was not found. Reinstalling the program may fix this problem. I have reinstalled python several times. Repaired it several times but continue to get the same error. I uninstalled the bad Windows update but still had the same problem trying to get python running. That sounds horrible. Have you tried installing Python 3.7 or 3.9? 32bit? 64bit? Also, I would try doing a custom install to a better location than the Windows standard place. My favourite is C:\Python36, C:\Python37, C:\Python38 etc. All the best Mike Please help, Charlie Seagraves -- https://mail.python.org/mailman/listinfo/python-list
Re: Installation Error
Do you have DirectX latest version? It should have solved the problem. If not already installed then you might try to install it. On Thu, 21 May, 2020, 10:29 pm Charles Seagraves, wrote: > Hi, > I have been learning and using Python to create a program to play Mah Jongg > and it was going well until my windows 10 computer started receiving an > update. My computer restarted and Python was gone. I have attempted to > reinstall with a message that the install was successful. When I started to > use it I got the following message. > > pythonw.exe - System Error > The code execution cannot proceed because python38.dll was not found. > Reinstalling the program may fix this problem. > > I have reinstalled python several times. Repaired it several times but > continue to get the same error. > I uninstalled the bad Windows update but still had the same problem trying > to get python running. > > Please help, > Charlie Seagraves > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
PyCharm, how to setup self contained subprojects
Hi, I should provide python code for (Spring) microservice patform. In microservice paradigm, each microservice should do a simple task, so python code beneath it should be very small. As a PyCharm (community) user, I don't know how to set up such development environment. Each microservice could be a separate PyCharm project, but these projects should share some common classes. For example, let's say that you have a class for communication with outer world. Each PyCharm project (microservice) should use instance of this class, and do the different things with its data. I would like to avoid coping this common object to each PyCharm project (and prevent refactoring). Another, requirement is deployment of PyCharm project to the microservice platform. At the moment, my each microservice code is in separate project. I am coping each project files on separate folder on deployment server. So, each PyCharm project has its own main.py (the name of main.py can be different for each microservice). On deployment servers I cannot install anything. Another approach would be to have single PyCharm project with many root directories for microservices and multiple main.py files. In this case, when I deploy a single microservice, I will have trouble finding out what files I should copy (common classes), or to copy everything from PyCharm project, but specify main.py for specific microservice (root). If anyone is in the same situation, please share how you have set up PyCharm for such purpose, and how you are doing development. Regards -- https://mail.python.org/mailman/listinfo/python-list
creating a csv from information I have printed to screen
How do I edit the code below to create a csv file which includes the
information I have printed at the bottom?
I'm pulling arrival data from an airport website and printing out only the
flight info. I want to save that flight info to a CSV file.
import requests
from bs4 import BeautifulSoup
cookies = {
'ApplicationGatewayAffinity':
'1d2ad8ab214d1293a4e31bcd161589fa82a54a39bb7b3be80b503996092d4296',
'ApplicationGatewayAffinityCORS':
'1d2ad8ab214d1293a4e31bcd161589fa82a54a39bb7b3be80b503996092d4296',
}
headers = {
'Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
'Accept':
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-User': '?1',
'Sec-Fetch-Dest': 'document',
'Referer': 'https://www.google.com/',
'Accept-Language': 'en-GB,en;q=0.9,en-US;q=0.8,fr;q=0.7,nl;q=0.6',
}
response = requests.get('https://www.corkairport.com/arrivals-departures',
headers=headers, cookies=cookies)
#print(response.content)
soup = BeautifulSoup(response.content, 'html.parser')
#print(soup.prettify())
## commented out as it did not print as expected
# headers = soup.find_all('th')
# for header in headers:
# for content in header.contents:
# value = str(header).strip().replace('\n', '')
# if len(value) == 0:
# print('"0"', end=',')
# elif value[0].lower() in 'abcdefghijklmnopqrstuvwxyz<':
# print('\n' + value, end=',')
# else:
# print('"' + value + '"', end=',')
print('Arriving From', 'Airline', 'Scheduled to arrive','Latest
Update','Status')
cells = soup.find_all('td')
#print(cells)
for cell in cells:
for content in cell.contents:
value = str(content).strip().replace('\n', '')
if len(value) == 0:
print('"0"', end=',')
elif value[0].lower() in 'abcdefghijklmnopqrstuvwxyz<':
print('\n' + value, end=',')
else:
print('"' + value + '"', end=',')
--
https://mail.python.org/mailman/listinfo/python-list
