Questions tagged [python-3.x]

For questions about Python programming that are specific to version 3+ of the language. Use the more generic [python] tag on all Python questions, and only add this one if your question is version-specific. Use the [python-2.x] tags for Python 2 questions.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Why does this import code work in Visual Studio Code but not IDLE?

File Structure Main Folder Program.py Module_Folder MODULE_1.py MODULE_2.py MODULE_3.py In "Program.py" I am using the following line to import MODULE_1 into Program.py: &...
0
votes
0answers
6 views

How to Automate MS Word using python

I have ms word document and I want to change setting like font size, font name and paragraph properties using python, I have written the code and it runs without errors but it does not apply the ...
0
votes
0answers
4 views

Testing instance methods in Python using mock

I have a class similarly structured to this: class TestClass: def a(self): pass def b(self): self.a() I want to test if running TestClass().b() successfully calls TestClass()....
0
votes
2answers
13 views

How does python treat a for loop within a range where upper bound and lower bound is the same?

So if i write the following code: for i in range(1,1): <whatever> does the loop exit as the i value has already exceeded the upper bound or does something else occur within the loop?
0
votes
1answer
18 views

Reindex with multiindex and create empty dates

How can I create empty rows from 7 days before 2016-01-01 going to January 2015 for each country? I tried reindexing. I need to retain the multiindex df value date ...
0
votes
0answers
10 views

Unable to figure out how I can write the results back to the same worksheet when I go for concurrent.futures

I've used openpyxl library to read different ticker names from a worksheet and then use those tickers in a website to produce results and finally write the results back to the same worksheet right ...
0
votes
0answers
13 views

Element <option> could not be scrolled into view Python Selenium

I'm new to selenium and facing issue while selecting an option from the dropdown. HTML Code: <select id="fileselection" class="selectpicker show-menu-arrow" name="...
0
votes
0answers
9 views

solving unicodeEncodeError when loading excel data to MariaDD python3

I am trying to load a bunch of excel files into a MariaDB 10.5 with python3 using openpyxl to load workbooks. Connection charset is set to UTF8, however I am still getting: return codecs....
-3
votes
0answers
9 views

“SyntaxError: invalid syntax” why? [closed]

Why i can't use * with python3.6.8 in Visual Studio Code?And it will be mistoken with SyntaxError: invalid syntax. Because I was interested, I learned python by myself.But when I used * to split ...
0
votes
0answers
4 views

Access element from csr_matrix

I have created a Sparse matrix using the Scipy dok_matrix method as follows: sparse_dtm = dok_matrix((num_documents, vocabulary_size), dtype=np.float32) for doc_index, document in enumerate(data_list):...
0
votes
2answers
29 views

Generate random string with specific pattern

I'm trying to generate a wordlist using random module. The pattern I want is like this: D7FE-PWO3-ODKE I can generate the strings but I'm not able to figure out how can I get that hyphen (-) between ...
-1
votes
0answers
16 views

How to create a optimization function? [closed]

I would like to create an optimization function, let me explain. First, here's my database : https://drive.google.com/file/d/1xHDxpVgVUYGKg5l3AGqhp6e2FfF1Cqn2/view?usp=sharing My goal is to create a ...
0
votes
0answers
9 views

AttributeError: 'Thread' object has no attribute 'recv' - Python

Edit-Problem: I was trying to make a chatroom with two people, and it works fine, but the input("Message: ") is overlayed by the new message from the other client. Something like this: ...
0
votes
2answers
26 views

Is it possible to send messages outside a function?

I'm writing a discord.py script and I wanted to make alerts for my original code but I'm not sure how to write it properly: @client.event async def on_ready(): print('Client is ready.') ...
0
votes
0answers
12 views

Algorithm error - Why is my exit condition not respected?

My having troubles understanding why is my code not working like I think it should. This function is supposed to fill up a 2 dimensional list with 1 instead of 0 given some parameters: x = to tell it ...

15 30 50 per page
1
2 3 4 5
18493
久草视频新免费_日韩视频一中文字暮_欧美三级片