Questions tagged [python-3.7]

Version of the Python programming language released in June 27, 2018. For issues that are specific to Python 3.7. Use the more generic [python] and [python-3.x] tags where possible.

Python 3.7 was released on June 27, 2018 (PEP 537).


Use this tag if your question is specifically related to Python 3.7. Otherwise, use the following guidelines to determine which tag(s) you should add to your question:

  • If your question applies to Python in general, use only the tag.
  • If your question applies to Python 3.x but not to Python 2.x, add the tag .
  • If you aren't sure, tag your question with and mention which version you're using in the post.

References

3992 questions
1
vote
3 answers

python shelve: same objects become different objects after reopening shelve

I am seeing this behavior using shelve: import shelve my_shelve = shelve.open('/tmp/shelve', writeback=True) my_shelve['a'] = {'foo': 'bar'} my_shelve['b'] = my_shelve['a'] id(my_shelve['a']) # 140421814419392 id(my_shelve['b']) #…
1
vote
2 answers

Strong typed python3.7 - return type and params are not failed

I don't quite understand why this is not failing: def hello(name: str) -> int: ending:int = '!!!' return f'Hello {name} {ending}' print(hello('John')) # Hello John !!! And if there is already possibility to strong type python?
Meroz
  • 697
  • 1
  • 6
  • 22
1
vote
2 answers

Using Python regular expressions to find and edit the contents of a text file

I have a text file full of amino acids (CA-Final.txt) as well as some other data. Here is a snippet of the text file ATOM 109 CA ASER A 48 10.832 19.066 -2.324 0.50 61.96 C ATOM 121 CA AALA A 49 12.327 22.569 …
1
vote
1 answer

Python - How to use multiprocessing Lock in class instance?

I am using Python 3.7 on Windows. What I am trying to do: - lock a method of an instance of a class, when another process has acquired that same lock. Attempts: I have already successfully done this, but I don't want a global variable here for the…
Connor
  • 173
  • 3
  • 11
1
vote
1 answer

Is it possible to gather multiple values with Twilio IVR?

I have a view function that needs to gather multiple pieces of information in one call (it's a quick outbound call - the user answers and is to be immediately prompted for these data points), based on data pulled from a DB. What I'd like the view…
zbbz
  • 177
  • 1
  • 1
  • 9
1
vote
1 answer

File Exist For Python 3.7.1

in my project I'm doing, I've always used this part of the script to check if a file existed or not: path = os.path.join("myfile.txt") conf = Path(path) try: lc = conf.resolve() except FileNotFoundError: print("new") else: …
BlackFenix06
  • 535
  • 1
  • 5
  • 17
1
vote
1 answer

Importing agents and their attributes from CSV in mesa

My data is in .csv format and each row of data represents each agent while each column represents a certain attribute. My question is how to assign agents and their attributes from a csv file in Mesa? Could anyone help me with how to import them…
Mo Pa
  • 11
  • 2
1
vote
2 answers

Rename python 3.7 executable without breaking stuff

I have renamed python.exe to python37.exe to avoid conflict with other versions. It works for running python, but if I run pip37.exe (located in /Scripts) I get the following error: Fatal error in launcher: Unable to create process using…
1
vote
1 answer

Get topological order of graph from adjacency matrix

For a given adjacency matrix I would like to get the topological order of the graph as output in Python. For example something like this: In[1]: a = np.array([[1,1,0,0],[0,1,0,0],[1,0,1,1],[0,1,0,1]]) In[1]: topoOrder(a) Out[1]: array([[3, 1, 4,…
1
vote
1 answer

Chromedriver executable may have wrong permissions

Hell, so I am running widows 10 with the latest webdriver in selenium python 3.7. I've had this code work on another machine but when I use it on my new laptop I get the error in the title. I have the driver in my path in multiple places and I…
1
vote
3 answers

Cannot run AWS Lambda using snowflake-connector

When I deployed my lambda and try to run it, it generates the following error: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory Why? What can I do about it? I have in my requirements.txt the following.…
1
vote
0 answers

For loop with Enumerate generates TypeError: 'int' object is not iterable, Python

I want to take a list and use enumerate to easily get the index and value of each element in the list. For some reason it keeps giving me the same error. I'm pretty new to Python, but not remotely new to coding. I would appreciate any…
1
vote
3 answers

Python Variable Not Working In If Statement

I am using selenium to loop through URL's from a txt file and grab a specific serial number that is listed on each URL. Then I want to reference an excel file and find the cell next to the serial number and print that value. My problem is when I am…
iDKxTrue
  • 21
  • 2
1
vote
3 answers

How to extract the minimum position of a string in a nested list

I have a nested list of words with lots of duplicates, and a list of uniquewords which is a set of the list words. I want to find the minimum starting point of an item in word. For instance: words = [['apple',5],['apple',7],['apple',8],['pear',9],…
song0089
  • 2,381
  • 7
  • 35
  • 60
1
vote
1 answer

(Dask) How to distribute expensive resource needed for computation?

What is the best way to distribute a task across a dataset that uses a relatively expensive-to-create resource or object for the computation. # in pandas df = pd.read_csv(...) foo = Foo() # expensive initialization. result = df.apply(lambda x:…
cjlovering
  • 57
  • 1
  • 4
1 2 3
99
100